Exemplo n.º 1
0
menu_format(const MENU * menu, int *rows, int *cols)
{
    if (rows)
        *rows = Normalize_Menu(menu)->frows;
    if (cols)
        *cols = Normalize_Menu(menu)->fcols;
}
Exemplo n.º 2
0
menu_win(const MENU * menu)
{
  const MENU *m = Normalize_Menu(menu);

  T((T_CALLED("menu_win(%p)"), (const void *)menu));
  returnWin(Get_Menu_UserWin(m));
}
Exemplo n.º 3
0
set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col)
{
  MENU *m;			/* split for ATAC workaround */

  T((T_CALLED("set_menu_spacing(%p,%d,%d,%d)"),
     (void *)menu, s_desc, s_row, s_col));

  m = Normalize_Menu(menu);

  assert(m);
  if (m->status & _POSTED)
    RETURN(E_POSTED);

  if (((s_desc < 0) || (s_desc > MAX_SPC_DESC)) ||
      ((s_row < 0) || (s_row > MAX_SPC_ROWS)) ||
      ((s_col < 0) || (s_col > MAX_SPC_COLS)))
    RETURN(E_BAD_ARGUMENT);

  m->spc_desc = (short)(s_desc ? s_desc : 1);
  m->spc_rows = (short)(s_row ? s_row : 1);
  m->spc_cols = (short)(s_col ? s_col : 1);
  _nc_Calculate_Item_Length_and_Width(m);

  RETURN(E_OK);
}
Exemplo n.º 4
0
menu_sub(const MENU * menu)
{
  const MENU *m = Normalize_Menu(menu);

  T((T_CALLED("menu_sub(%p)"), menu));
  returnWin(Get_Menu_Window(m));
}
Exemplo n.º 5
0
menu_spacing ( const MENU *menu, int* s_desc, int* s_row, int* s_col)
{
  const MENU *m; /* split for ATAC workaround */
  m = Normalize_Menu(menu);

  assert(m);
  if (s_desc) *s_desc = m->spc_desc;
  if (s_row)  *s_row  = m->spc_rows;
  if (s_col)  *s_col  = m->spc_cols;

  RETURN(E_OK);
}
Exemplo n.º 6
0
/*---------------------------------------------------------------------------
|   Facility      :  libnmenu  
|   Function      :  int set_menu_pad(MENU *menu, int pad)
|   
|   Description   :  Set the character to be used to separate the item name
|                    from its description. This must be a printable 
|                    character.
|
|   Return Values :  E_OK              - success
|                    E_BAD_ARGUMENT    - an invalid value has been passed
+--------------------------------------------------------------------------*/
int set_menu_pad(MENU *menu, int pad)
{
  bool do_refresh = (menu != (MENU*)0);

  if (!isprint((unsigned char)pad))
    RETURN(E_BAD_ARGUMENT);
  
  Normalize_Menu( menu );
  menu->pad = pad;
  
  if (do_refresh)
      Refresh_Menu( menu );

  RETURN(E_OK);
}
Exemplo n.º 7
0
set_menu_pad(MENU * menu, int pad)
{
    bool do_refresh = (menu != (MENU *) 0);

    T((T_CALLED("set_menu_pad(%p,%d)"), menu, pad));

    if (!isprint(UChar(pad)))
        RETURN(E_BAD_ARGUMENT);

    Normalize_Menu(menu);
    menu->pad = pad;

    if (do_refresh)
        Refresh_Menu(menu);

    RETURN(E_OK);
}
Exemplo n.º 8
0
menu_opts_on(MENU * menu, Menu_Options opts)
{
  MENU *cmenu = menu;		/* use a copy because set_menu_opts must detect

				   NULL menu itself to adjust its behavior */

  T((T_CALLED("menu_opts_on(%p,%d)"), menu, opts));

  opts &= ALL_MENU_OPTS;
  if (opts & ~ALL_MENU_OPTS)
    RETURN(E_BAD_ARGUMENT);
  else
    {
      Normalize_Menu(cmenu);
      opts = cmenu->opt | opts;
      returnCode(set_menu_opts(menu, opts));
    }
}
Exemplo n.º 9
0
menu_spacing(const MENU * menu, int *s_desc, int *s_row, int *s_col)
{
  const MENU *m;		/* split for ATAC workaround */

  T((T_CALLED("menu_spacing(%p,%p,%p,%p)"),
     (const void *)menu,
     (void *)s_desc,
     (void *)s_row,
     (void *)s_col));

  m = Normalize_Menu(menu);

  assert(m);
  if (s_desc)
    *s_desc = m->spc_desc;
  if (s_row)
    *s_row = m->spc_rows;
  if (s_col)
    *s_col = m->spc_cols;

  RETURN(E_OK);
}
Exemplo n.º 10
0
menu_mark (const MENU * menu)
{
  return Normalize_Menu( menu )->mark;
}
Exemplo n.º 11
0
/*---------------------------------------------------------------------------
|   Facility      :  libnmenu  
|   Function      :  int menu_pad(const MENU *menu)
|   
|   Description   :  Return the value of the padding character
|
|   Return Values :  The pad character
+--------------------------------------------------------------------------*/
int menu_pad(const MENU * menu)
{
  return (Normalize_Menu( menu ) -> pad);
}
Exemplo n.º 12
0
set_menu_userptr (MENU * menu, void * userptr)
{
  Normalize_Menu(menu)->userptr = userptr;
  RETURN( E_OK );
}
Exemplo n.º 13
0
menu_userptr(const MENU * menu)
{
  T((T_CALLED("menu_userptr(%p)"), menu));
  returnVoidPtr(Normalize_Menu(menu)->userptr);
}
Exemplo n.º 14
0
set_menu_userptr(MENU * menu, void *userptr)
{
  T((T_CALLED("set_menu_userptr(%p,%p)"), menu, userptr));
  Normalize_Menu(menu)->userptr = userptr;
  RETURN(E_OK);
}
Exemplo n.º 15
0
menu_pad(const MENU * menu)
{
    T((T_CALLED("menu_pad(%p)"), menu));
    returnCode(Normalize_Menu(menu)->pad);
}
Exemplo n.º 16
0
menu_userptr (const MENU * menu)
{
  return( Normalize_Menu(menu)->userptr);
}
Exemplo n.º 17
0
menu_opts(const MENU * menu)
{
  T((T_CALLED("menu_opts(%p)"), menu));
  returnMenuOpts(ALL_MENU_OPTS & Normalize_Menu(menu)->opt);
}