コード例 #1
0
ファイル: iupwin_button.c プロジェクト: defdef/iup
static char* winButtonGetBgColorAttrib(Ihandle* ih)
{
  /* the most important use of this is to provide
     the correct background for images */
  if (iupwin_comctl32ver6 && ih->data->type&IUP_BUTTON_IMAGE && !iupAttribGet(ih, "IMPRESS"))
  {
    COLORREF cr;
    if (iupwinDrawGetThemeButtonBgColor(ih->handle, &cr))
      return iupStrReturnStrf("%d %d %d", (int)GetRValue(cr), (int)GetGValue(cr), (int)GetBValue(cr));
  }

  if (iupAttribGet(ih, "IMPRESS"))
    return iupBaseNativeParentGetBgColorAttrib(ih);
  else
    return NULL;
}
コード例 #2
0
static char* winToggleGetBgColorAttrib(Ihandle* ih)
{
    /* the most important use of this is to provide
       the correct background for images */
    if (iupwin_comctl32ver6 && ih->data->type==IUP_TOGGLE_IMAGE)
    {
        COLORREF cr;
        if (iupwinDrawGetThemeButtonBgColor(ih->handle, &cr))
            return iupStrReturnStrf("%d %d %d", (int)GetRValue(cr), (int)GetGValue(cr), (int)GetBValue(cr));
    }

    if (ih->data->type == IUP_TOGGLE_TEXT)
        return iupBaseNativeParentGetBgColorAttrib(ih);
    else
        return IupGetGlobal("DLGBGCOLOR");
}
コード例 #3
0
ファイル: iupwin_button.c プロジェクト: svn2github/iup-iup
static char* winButtonGetBgColorAttrib(Ihandle* ih)
{
  /* the most important use of this is to provide
     the correct background for images */
  if (iupwin_comctl32ver6 && !iupAttribGet(ih, "IMPRESS"))
  {
    COLORREF cr;
    if (iupwinDrawGetThemeButtonBgColor(ih->handle, &cr))
    {
      char* str = iupStrGetMemory(20);
      sprintf(str, "%d %d %d", (int)GetRValue(cr), (int)GetGValue(cr), (int)GetBValue(cr));
      return str;
    }
  }

  if (iupAttribGet(ih, "IMPRESS"))
    return iupBaseNativeParentGetBgColorAttrib(ih);
  else
    return NULL;
}