static int winToggleSetActiveAttrib(Ihandle* ih, const char* value) { /* update the inactive image if necessary */ if (ih->data->type==IUP_TOGGLE_IMAGE) { if (iupwin_comctl32ver6 || ih->data->flat) { iupBaseSetActiveAttrib(ih, value); iupdrvRedrawNow(ih); return 0; } else { int active = iupStrBoolean(value); int check = SendMessage(ih->handle, BM_GETCHECK, 0, 0L); if (active) iupAttribSet(ih, "_IUPWIN_ACTIVE", "YES"); else iupAttribSet(ih, "_IUPWIN_ACTIVE", "NO"); winToggleUpdateImage(ih, active, check); return 0; } } return iupBaseSetActiveAttrib(ih, value); }
static int gtkButtonSetActiveAttrib(Ihandle* ih, const char* value) { /* update the inactive image if necessary */ if (ih->data->type & IUP_BUTTON_IMAGE) { if (!iupStrBoolean(value)) { char* name = iupAttribGet(ih, "IMINACTIVE"); if (name) gtkButtonSetPixbuf(ih, name, 0); else { /* if not defined then automaticaly create one based on IMAGE */ name = iupAttribGet(ih, "IMAGE"); gtkButtonSetPixbuf(ih, name, 1); /* make_inactive */ } } else { /* must restore the normal image */ char* name = iupAttribGet(ih, "IMAGE"); gtkButtonSetPixbuf(ih, name, 0); } } return iupBaseSetActiveAttrib(ih, value); }
static int winButtonSetActiveAttrib(Ihandle* ih, const char* value) { /* redraw IMINACTIVE image if any */ if (ih->data->type != IUP_BUTTON_TEXT) iupdrvPostRedraw(ih); return iupBaseSetActiveAttrib(ih, value); }
static int gtkToggleSetActiveAttrib(Ihandle* ih, const char* value) { /* update the inactive image if necessary */ if (ih->data->type == IUP_TOGGLE_IMAGE) gtkToggleUpdateImage(ih, iupStrBoolean(value), gtkToggleGetCheck(ih)); return iupBaseSetActiveAttrib(ih, value); }
static int iColorbarSetActiveAttrib(Ihandle* ih, const char* value) { iupBaseSetActiveAttrib(ih, value); cdIupCalcShadows(ih->data->bgcolor, &ih->data->light_shadow, &ih->data->mid_shadow, &ih->data->dark_shadow); if (!iupdrvIsActive(ih)) ih->data->light_shadow = ih->data->mid_shadow; iColorbarRepaint(ih); return 0; /* do not store value in hash table */ }
static int motLabelSetActiveAttrib(Ihandle* ih, const char* value) { /* update the inactive image if necessary */ if (ih->data->type == IUP_LABEL_IMAGE && !iupStrBoolean(value)) { if (!iupAttribGet(ih, "IMINACTIVE")) { /* if not defined then automaticaly create one based on IMAGE */ char* name = iupAttribGet(ih, "IMAGE"); iupmotSetPixmap(ih, name, XmNlabelInsensitivePixmap, 1); /* make_inactive */ } } return iupBaseSetActiveAttrib(ih, value); }
static int iDialSetActiveAttrib(Ihandle* ih, const char* value) { unsigned char r, g, b; iupBaseSetActiveAttrib(ih, value); value = iupAttribGetStr(ih, "FGCOLOR"); if (!iupStrToRGB(value, &r, &g, &b)) return 0; iDialUpdateFgColors(ih, r, g, b); cdIupCalcShadows(ih->data->bgcolor, &ih->data->light_shadow, &ih->data->mid_shadow, &ih->data->dark_shadow); if (!iupdrvIsActive(ih)) ih->data->light_shadow = ih->data->mid_shadow; iDialRepaint(ih); return 0; /* do not store value in hash table */ }
static int iTreeSetActiveAttrib(Ihandle* ih, const char* value) { iupBaseSetActiveAttrib(ih, value); iupTreeRepaint(ih); return 1; }
static int iMatrixSetActiveAttrib(Ihandle* ih, const char* value) { iupBaseSetActiveAttrib(ih, value); iupMatrixDraw(ih, 1); return 0; }
static int iColorBrowserSetActiveAttrib(Ihandle* ih, const char* value) { iupBaseSetActiveAttrib(ih, value); iColorBrowserUpdateDisplay(ih); return 0; /* do not store value in hash table */ }
static int iFlatButtonSetActiveAttrib(Ihandle* ih, const char* value) { iupBaseSetActiveAttrib(ih, value); iupdrvRedrawNow(ih); return 0; }