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/matrix/iupmat_mark.c | |
parent | e9a184546b18cf3b796bd560561f312934004c54 (diff) |
Upgrading to IUP 3.2 - and cleaning up.
Diffstat (limited to 'iup/srccontrols/matrix/iupmat_mark.c')
-rwxr-xr-x | iup/srccontrols/matrix/iupmat_mark.c | 30 |
1 files changed, 25 insertions, 5 deletions
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 { |