diff options
author | Pixel <pixel@nobis-crew.org> | 2009-11-04 11:56:41 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2009-11-04 11:59:33 -0800 |
commit | d577d991b97ae2b5ee1af23641bcffc3f83af5b2 (patch) | |
tree | 590639d50205d1bcfaff2a7d2dc6ebf3f373c7ed /iup/srccontrols/matrix/iupmat_focus.c |
Initial import. Contains the im, cd and iup librairies, and a "working" Makefile for them under linux.
Diffstat (limited to 'iup/srccontrols/matrix/iupmat_focus.c')
-rwxr-xr-x | iup/srccontrols/matrix/iupmat_focus.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/iup/srccontrols/matrix/iupmat_focus.c b/iup/srccontrols/matrix/iupmat_focus.c new file mode 100755 index 0000000..3c000f8 --- /dev/null +++ b/iup/srccontrols/matrix/iupmat_focus.c @@ -0,0 +1,58 @@ +/** \file + * \brief iupmatrix focus control + * + * See Copyright Notice in "iup.h" + */ + +#include <stdlib.h> + +#include "iup.h" +#include "iupcbs.h" + +#include <cd.h> + +#include "iup_object.h" +#include "iup_attrib.h" +#include "iup_str.h" +#include "iup_stdcontrols.h" + +#include "iupmat_def.h" +#include "iupmat_aux.h" +#include "iupmat_focus.h" +#include "iupmat_draw.h" + + +void iupMatrixFocusSet(Ihandle* ih, int lin, int col) +{ + ih->data->lines.focus_cell = lin; + ih->data->columns.focus_cell = col; +} + +int iupMatrixFocus_CB(Ihandle* ih, int focus) +{ + int rc = IUP_DEFAULT; + + if (!iupMatrixIsValid(ih, 1)) + return IUP_DEFAULT; + + if (iupStrEqualNoCase(IupGetGlobal("DRIVER"), "Motif")) + { + if (focus && iupAttribGet(ih, "_IUPMAT_DOUBLE_CLICK")) + { + iupAttribSetStr(ih, "_IUPMAT_DOUBLE_CLICK", NULL); + return IUP_DEFAULT; + } + } + + ih->data->has_focus = focus; + iupMatrixDrawUpdate(ih); + + if (focus) + iupMatrixAuxCallEnterCellCb(ih); + else + iupMatrixAuxCallLeaveCellCb(ih); + + return rc; +} + + |