示例#1
0
static int motToggleSetImPressAttrib(Ihandle* ih, const char* value)
{
    if (ih->data->type == IUP_TOGGLE_IMAGE)
    {
        iupmotSetPixmap(ih, value, XmNselectPixmap, 0);
        return 1;
    }
    else
        return 0;
}
示例#2
0
static int motToggleSetImInactiveAttrib(Ihandle* ih, const char* value)
{
    if (ih->data->type == IUP_TOGGLE_IMAGE)
    {
        iupmotSetPixmap(ih, value, XmNlabelInsensitivePixmap, 0);
        return 1;
    }
    else
        return 0;
}
示例#3
0
static int motLabelSetImageAttrib(Ihandle* ih, const char* value)
{
  if (ih->data->type == IUP_LABEL_IMAGE)
  {
    iupmotSetPixmap(ih, value, XmNlabelPixmap, 0);

    if (!iupdrvIsActive(ih))
    {
      if (!iupAttribGet(ih, "IMINACTIVE"))
      {
        /* if not active and IMINACTIVE is not defined 
           then automaticaly create one based on IMAGE */
        iupmotSetPixmap(ih, value, XmNlabelInsensitivePixmap, 1); /* make_inactive */
      }
    }
    return 1;
  }
  else
    return 0;
}
示例#4
0
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);
}