예제 #1
0
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);
}
예제 #2
0
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);
}
예제 #3
0
파일: iupwin_button.c 프로젝트: defdef/iup
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);
}
예제 #4
0
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);
}
예제 #5
0
파일: iup_colorbar.c 프로젝트: Airr/iup_mac
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 */
}
예제 #6
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);
}
예제 #7
0
파일: iup_dial.c 프로젝트: Vulcanior/IUP
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 */
}
예제 #8
0
static int iTreeSetActiveAttrib(Ihandle* ih, const char* value)
{
  iupBaseSetActiveAttrib(ih, value);
  iupTreeRepaint(ih);
  return 1;
}
예제 #9
0
static int iMatrixSetActiveAttrib(Ihandle* ih, const char* value)
{
  iupBaseSetActiveAttrib(ih, value);
  iupMatrixDraw(ih, 1);
  return 0;
}
예제 #10
0
static int iColorBrowserSetActiveAttrib(Ihandle* ih, const char* value)
{
  iupBaseSetActiveAttrib(ih, value);
  iColorBrowserUpdateDisplay(ih);
  return 0;   /* do not store value in hash table */
}
예제 #11
0
static int iFlatButtonSetActiveAttrib(Ihandle* ih, const char* value)
{
  iupBaseSetActiveAttrib(ih, value);
  iupdrvRedrawNow(ih);
  return 0; 
}