コード例 #1
0
ファイル: iupmot_dialog.c プロジェクト: svn2github/iup-iup
static int motDialogGetMenuSize(Ihandle* ih)
{
  if (ih->data->menu)
    return iupdrvMenuGetMenuBarSize(ih->data->menu);
  else
    return 0;
}
コード例 #2
0
ファイル: iupgtk_dialog.c プロジェクト: LuaDist/iup
static int gtkDialogGetMenuSize(Ihandle* ih)
{
#ifdef HILDON
  return 0;
#else
  if (ih->data->menu && !iupgtk_globalmenu)
    return iupdrvMenuGetMenuBarSize(ih->data->menu);
  else
    return 0;
#endif
}
コード例 #3
0
ファイル: iupgtk_dialog.c プロジェクト: ivanceras/iup-mirror
static int gtkDialogGetMenuSize(Ihandle* ih)
{
#ifdef HILDON
  return 0;
#else                    
  if (ih->data->menu && !iupStrBoolean(IupGetGlobal("GLOBALMENU")))
    return iupdrvMenuGetMenuBarSize(ih->data->menu);
  else
    return 0;
#endif
}
コード例 #4
0
ファイル: iupwin_dialog.c プロジェクト: ivanceras/iup-mirror
void iupdrvDialogGetDecoration(Ihandle* ih, int *border, int *caption, int *menu)
{
  if (ih->data->menu)
    *menu = iupdrvMenuGetMenuBarSize(ih->data->menu);
  else
    *menu = 0;

  if (ih->handle)
  {
    winDialogGetWindowDecor(ih, border, caption, *menu);
  }
  else
  {
    int padded_border = 0;
    int has_titlebar = iupAttribGetBoolean(ih, "MAXBOX")  ||
                       iupAttribGetBoolean(ih, "MINBOX")  ||
                       iupAttribGetBoolean(ih, "MENUBOX") || 
                       iupAttribGet(ih, "TITLE");

    *caption = 0;
    if (has_titlebar)
    {
      if (iupAttribGetBoolean(ih, "TOOLBOX") && iupAttribGet(ih, "PARENTDIALOG"))
        *caption = GetSystemMetrics(SM_CYSMCAPTION); /* tool window */
      else
        *caption = GetSystemMetrics(SM_CYCAPTION);   /* normal window */

      padded_border = GetSystemMetrics(SM_CXPADDEDBORDER);
    }

    *border = 0;
    if (iupAttribGetBoolean(ih, "RESIZE"))
    {
      /* has_border */
      *border = GetSystemMetrics(SM_CXFRAME);     /* Thickness of the sizing border around the perimeter of a window  */
    }                                             /* that can be resized, in pixels.                                  */
    else if (has_titlebar)
    {
      /* has_border */
      *border = GetSystemMetrics(SM_CXFIXEDFRAME);  /* Thickness of the frame around the perimeter of a window        */
    }                                               /* that has a caption but is not sizable, in pixels.              */
    else if (iupAttribGetBoolean(ih, "BORDER"))
    {
      /* has_border */
      *border = GetSystemMetrics(SM_CXBORDER);
    }

    if (*border)
      *border += padded_border;
  }
}
コード例 #5
0
ファイル: iupwin_dialog.c プロジェクト: svn2github/iup-iup
void iupdrvDialogGetDecoration(Ihandle* ih, int *border, int *caption, int *menu)
{
  if (ih->data->menu)
    *menu = iupdrvMenuGetMenuBarSize(ih->data->menu);
  else
    *menu = 0;

  if (ih->handle)
  {
    iupdrvGetWindowDecor(ih->handle, border, caption);

    if (*menu)
      *caption -= *menu;
  }
  else
  {
    int has_titlebar = iupAttribGetInt(ih, "MAXBOX")  ||
                      iupAttribGetInt(ih, "MINBOX")  ||
                      iupAttribGetInt(ih, "MENUBOX") || 
                      IupGetAttribute(ih, "TITLE");  /* must use IupGetAttribute to check from the native implementation */

    *caption = 0;
    if (has_titlebar)
    {
      if (iupAttribGetInt(ih, "TOOLBOX") && iupAttribGet(ih, "PARENTDIALOG"))
        *caption = GetSystemMetrics(SM_CYSMCAPTION); /* tool window */
      else
        *caption = GetSystemMetrics(SM_CYCAPTION);   /* normal window */
    }

    *border = 0;
    if (iupAttribGetInt(ih, "RESIZE"))
    {
      *border = GetSystemMetrics(SM_CXFRAME);     /* Thickness of the sizing border around the perimeter of a window  */
    }                                             /* that can be resized, in pixels.                                  */
    else if (has_titlebar)
    {
      *border = GetSystemMetrics(SM_CXFIXEDFRAME);  /* Thickness of the frame around the perimeter of a window        */
    }                                               /* that has a caption but is not sizable, in pixels.              */
    else if (iupAttribGetInt(ih, "BORDER"))
    {
      *border = GetSystemMetrics(SM_CXBORDER);
    }
  }
}