diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-09-09 02:26:30 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-09-09 02:32:26 +0200 |
commit | 7505e88db66798b2b8fcdff2d92a7136cd826b5b (patch) | |
tree | b6ced565318f8e8112e35cb0ad53abe4212ef8de /iup/srccontrols | |
parent | e9a184546b18cf3b796bd560561f312934004c54 (diff) |
Upgrading to IUP 3.2 - and cleaning up.
Diffstat (limited to 'iup/srccontrols')
-rwxr-xr-x | iup/srccontrols/config.mak | 48 | ||||
-rwxr-xr-x | iup/srccontrols/make_uname | 3 | ||||
-rwxr-xr-x | iup/srccontrols/make_uname.bat | 4 | ||||
-rwxr-xr-x | iup/srccontrols/matrix/iupmat_def.h | 1 | ||||
-rwxr-xr-x | iup/srccontrols/matrix/iupmat_mark.c | 30 | ||||
-rwxr-xr-x | iup/srccontrols/matrix/iupmatrix.c | 4 |
6 files changed, 28 insertions, 62 deletions
diff --git a/iup/srccontrols/config.mak b/iup/srccontrols/config.mak deleted file mode 100755 index 10f11e1..0000000 --- a/iup/srccontrols/config.mak +++ /dev/null @@ -1,48 +0,0 @@ -PROJNAME = iup -LIBNAME = iupcontrols -OPT = YES - -INCLUDES = ../include ../src . - -SRCCOLOR = iup_colorbrowser.c iup_colorhsi.c iup_colorbrowserdlg.c -SRCCOLOR := $(addprefix color/, $(SRCCOLOR)) - -SRCMATRIX = iupmat_key.c iupmat_mark.c iupmat_aux.c iupmat_mem.c iupmat_mouse.c iupmat_numlc.c \ - iupmat_colres.c iupmat_draw.c iupmat_focus.c iupmat_getset.c iupmatrix.c \ - iupmat_scroll.c iupmat_edit.c -SRCMATRIX := $(addprefix matrix/, $(SRCMATRIX)) - -SRC = iup_cdutil.c iup_gauge.c iup_cells.c iup_colorbar.c iup_controls.c \ - iup_dial.c iup_oldmask.c \ - $(SRCCOLOR) $(SRCMATRIX) - -LIBS = iup iupcd -LDIR = ../lib/$(TEC_UNAME) -USE_CD = Yes - -# force the definition of math functions using float -# Some compilers do not define them -ifeq ($(TEC_UNAME), dll) - DEFINES += IUP_DEFMATHFLOAT -endif -ifeq ($(TEC_UNAME), vc6) - DEFINES += IUP_DEFMATHFLOAT -endif -ifeq ($(TEC_UNAME), dll7) - DEFINES += IUP_DEFMATHFLOAT -endif -ifeq ($(TEC_UNAME), vc7) - DEFINES += IUP_DEFMATHFLOAT -endif -ifneq ($(findstring ow, $(TEC_UNAME)), ) - DEFINES += IUP_DEFMATHFLOAT -endif -ifneq ($(findstring bc, $(TEC_UNAME)), ) - DEFINES += IUP_DEFMATHFLOAT -endif -ifneq ($(findstring AIX, $(TEC_UNAME)), ) - DEFINES += IUP_DEFMATHFLOAT -endif -ifneq ($(findstring SunOS, $(TEC_UNAME)), ) - DEFINES += IUP_DEFMATHFLOAT -endif diff --git a/iup/srccontrols/make_uname b/iup/srccontrols/make_uname deleted file mode 100755 index cc4b881..0000000 --- a/iup/srccontrols/make_uname +++ /dev/null @@ -1,3 +0,0 @@ -#This builds all the libraries of the folder for 1 uname - -tecmake $1 $2 $3 $4 $5 $6 $7 diff --git a/iup/srccontrols/make_uname.bat b/iup/srccontrols/make_uname.bat deleted file mode 100755 index f0a0722..0000000 --- a/iup/srccontrols/make_uname.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -REM This builds all the libraries of the folder for 1 uname - -call tecmake %1 %2 %3 %4 %5 %6 diff --git a/iup/srccontrols/matrix/iupmat_def.h b/iup/srccontrols/matrix/iupmat_def.h index 225cc16..dd414c8 100755 --- a/iup/srccontrols/matrix/iupmat_def.h +++ b/iup/srccontrols/matrix/iupmat_def.h @@ -82,6 +82,7 @@ struct _IcontrolData int use_title_size; /* use title contents when calculating cell size */ int need_calcsize; int first_redraw; + int inside_markedit_cb; /* avoid recursion */ /* attributes */ int mark_continuous, mark_mode, mark_multiple; diff --git a/iup/srccontrols/matrix/iupmat_mark.c b/iup/srccontrols/matrix/iupmat_mark.c index 99aad32..bffd6ce 100755 --- a/iup/srccontrols/matrix/iupmat_mark.c +++ b/iup/srccontrols/matrix/iupmat_mark.c @@ -62,8 +62,12 @@ static void iMatrixMarkCellSet(Ihandle* ih, int lin, int col, int mark, IFniii m if (ih->data->callback_mode) { - if (markedit_cb) + if (markedit_cb && !ih->data->inside_markedit_cb) + { + ih->data->inside_markedit_cb = 1; markedit_cb(ih, lin, col, mark); + ih->data->inside_markedit_cb = 0; + } else { sprintf(str, "MARK%d:%d", lin, col); @@ -604,7 +608,7 @@ int iupMatrixSetMarkAttrib(Ihandle* ih, const char* name_id, const char* value) if (ih->data->mark_mode == IMAT_MARK_CELL) { - int mark; + int mark, ret = 0; if (lin == 0 || col == 0) /* title can NOT have a mark */ return 0; @@ -614,10 +618,24 @@ int iupMatrixSetMarkAttrib(Ihandle* ih, const char* name_id, const char* value) if (ih->data->callback_mode) { IFniii markedit_cb = (IFniii)IupGetCallback(ih, "MARKEDIT_CB"); - if (markedit_cb) + if (markedit_cb && !ih->data->inside_markedit_cb) + { + ih->data->inside_markedit_cb = 1; markedit_cb(ih, lin, col, mark); - else if (mark) - return 1; /* store the attribute */ + ih->data->inside_markedit_cb = 0; + } + else + { + char str[100] = "MARK"; + strcat(str, name_id); + if (mark) + { + iupAttribSetStr(ih, str, "1"); + ret = 1; + } + else + iupAttribSetStr(ih, str, NULL); + } } else { @@ -633,6 +651,8 @@ int iupMatrixSetMarkAttrib(Ihandle* ih, const char* name_id, const char* value) iupMatrixPrepareDrawData(ih); iupMatrixDrawCells(ih, lin, col, lin, col); } + + return ret; } else { diff --git a/iup/srccontrols/matrix/iupmatrix.c b/iup/srccontrols/matrix/iupmatrix.c index 9e379e2..c94fcdc 100755 --- a/iup/srccontrols/matrix/iupmatrix.c +++ b/iup/srccontrols/matrix/iupmatrix.c @@ -809,9 +809,9 @@ static void iMatrixComputeNaturalSizeMethod(Ihandle* ih, int *w, int *h, int *ex { int sb_size = iupdrvGetScrollbarSize(); if (ih->data->canvas.sb & IUP_SB_HORIZ) - natural_w += sb_size; + natural_h += sb_size; /* sb horizontal affects vertical size */ if (ih->data->canvas.sb & IUP_SB_VERT) - natural_h += sb_size; + natural_w += sb_size; /* sb vertical affects horizontal size */ } *w = natural_w + iMatrixGetNaturalWidth(ih); |