Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include
File: cursesm.h
// * This makes emacs happy -*-Mode: C++;-*-
[0] Fix | Delete
/****************************************************************************
[1] Fix | Delete
* Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
[2] Fix | Delete
* *
[3] Fix | Delete
* Permission is hereby granted, free of charge, to any person obtaining a *
[4] Fix | Delete
* copy of this software and associated documentation files (the *
[5] Fix | Delete
* "Software"), to deal in the Software without restriction, including *
[6] Fix | Delete
* without limitation the rights to use, copy, modify, merge, publish, *
[7] Fix | Delete
* distribute, distribute with modifications, sublicense, and/or sell *
[8] Fix | Delete
* copies of the Software, and to permit persons to whom the Software is *
[9] Fix | Delete
* furnished to do so, subject to the following conditions: *
[10] Fix | Delete
* *
[11] Fix | Delete
* The above copyright notice and this permission notice shall be included *
[12] Fix | Delete
* in all copies or substantial portions of the Software. *
[13] Fix | Delete
* *
[14] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
[15] Fix | Delete
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
[16] Fix | Delete
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
[17] Fix | Delete
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
[18] Fix | Delete
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
[19] Fix | Delete
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
[20] Fix | Delete
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
[21] Fix | Delete
* *
[22] Fix | Delete
* Except as contained in this notice, the name(s) of the above copyright *
[23] Fix | Delete
* holders shall not be used in advertising or otherwise to promote the *
[24] Fix | Delete
* sale, use or other dealings in this Software without prior written *
[25] Fix | Delete
* authorization. *
[26] Fix | Delete
****************************************************************************/
[27] Fix | Delete
[28] Fix | Delete
/****************************************************************************
[29] Fix | Delete
* Author: Juergen Pfeifer, 1997 *
[30] Fix | Delete
****************************************************************************/
[31] Fix | Delete
[32] Fix | Delete
// $Id: cursesm.h,v 1.30 2014/08/09 22:06:18 Adam.Jiang Exp $
[33] Fix | Delete
[34] Fix | Delete
#ifndef NCURSES_CURSESM_H_incl
[35] Fix | Delete
#define NCURSES_CURSESM_H_incl 1
[36] Fix | Delete
[37] Fix | Delete
#include <cursesp.h>
[38] Fix | Delete
[39] Fix | Delete
extern "C" {
[40] Fix | Delete
# include <menu.h>
[41] Fix | Delete
}
[42] Fix | Delete
//
[43] Fix | Delete
// -------------------------------------------------------------------------
[44] Fix | Delete
// This wraps the ITEM type of <menu.h>
[45] Fix | Delete
// -------------------------------------------------------------------------
[46] Fix | Delete
//
[47] Fix | Delete
class NCURSES_IMPEXP NCursesMenuItem
[48] Fix | Delete
{
[49] Fix | Delete
friend class NCursesMenu;
[50] Fix | Delete
[51] Fix | Delete
protected:
[52] Fix | Delete
ITEM *item;
[53] Fix | Delete
[54] Fix | Delete
inline void OnError (int err) const THROW2(NCursesException const, NCursesMenuException) {
[55] Fix | Delete
if (err != E_OK)
[56] Fix | Delete
THROW(new NCursesMenuException (err));
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
public:
[60] Fix | Delete
NCursesMenuItem (const char* p_name = NULL,
[61] Fix | Delete
const char* p_descript = NULL)
[62] Fix | Delete
: item(0)
[63] Fix | Delete
{
[64] Fix | Delete
item = p_name ? ::new_item (p_name, p_descript) : STATIC_CAST(ITEM*)(0);
[65] Fix | Delete
if (p_name && !item)
[66] Fix | Delete
OnError (E_SYSTEM_ERROR);
[67] Fix | Delete
}
[68] Fix | Delete
// Create an item. If you pass both parameters as NULL, a delimiting
[69] Fix | Delete
// item is constructed which can be used to terminate a list of
[70] Fix | Delete
// NCursesMenu objects.
[71] Fix | Delete
[72] Fix | Delete
NCursesMenuItem& operator=(const NCursesMenuItem& rhs)
[73] Fix | Delete
{
[74] Fix | Delete
if (this != &rhs) {
[75] Fix | Delete
*this = rhs;
[76] Fix | Delete
}
[77] Fix | Delete
return *this;
[78] Fix | Delete
}
[79] Fix | Delete
[80] Fix | Delete
NCursesMenuItem(const NCursesMenuItem& rhs)
[81] Fix | Delete
: item(0)
[82] Fix | Delete
{
[83] Fix | Delete
(void) rhs;
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
virtual ~NCursesMenuItem ();
[87] Fix | Delete
// Release the items memory
[88] Fix | Delete
[89] Fix | Delete
inline const char* name () const {
[90] Fix | Delete
return ::item_name (item);
[91] Fix | Delete
}
[92] Fix | Delete
// Name of the item
[93] Fix | Delete
[94] Fix | Delete
inline const char* description () const {
[95] Fix | Delete
return ::item_description (item);
[96] Fix | Delete
}
[97] Fix | Delete
// Description of the item
[98] Fix | Delete
[99] Fix | Delete
inline int (index) (void) const {
[100] Fix | Delete
return ::item_index (item);
[101] Fix | Delete
}
[102] Fix | Delete
// Index of the item in an item array (or -1)
[103] Fix | Delete
[104] Fix | Delete
inline void options_on (Item_Options opts) {
[105] Fix | Delete
OnError (::item_opts_on (item, opts));
[106] Fix | Delete
}
[107] Fix | Delete
// Switch on the items options
[108] Fix | Delete
[109] Fix | Delete
inline void options_off (Item_Options opts) {
[110] Fix | Delete
OnError (::item_opts_off (item, opts));
[111] Fix | Delete
}
[112] Fix | Delete
// Switch off the item's option
[113] Fix | Delete
[114] Fix | Delete
inline Item_Options options () const {
[115] Fix | Delete
return ::item_opts (item);
[116] Fix | Delete
}
[117] Fix | Delete
// Retrieve the items options
[118] Fix | Delete
[119] Fix | Delete
inline void set_options (Item_Options opts) {
[120] Fix | Delete
OnError (::set_item_opts (item, opts));
[121] Fix | Delete
}
[122] Fix | Delete
// Set the items options
[123] Fix | Delete
[124] Fix | Delete
inline void set_value (bool f) {
[125] Fix | Delete
OnError (::set_item_value (item,f));
[126] Fix | Delete
}
[127] Fix | Delete
// Set/Reset the items selection state
[128] Fix | Delete
[129] Fix | Delete
inline bool value () const {
[130] Fix | Delete
return ::item_value (item);
[131] Fix | Delete
}
[132] Fix | Delete
// Retrieve the items selection state
[133] Fix | Delete
[134] Fix | Delete
inline bool visible () const {
[135] Fix | Delete
return ::item_visible (item);
[136] Fix | Delete
}
[137] Fix | Delete
// Retrieve visibility of the item
[138] Fix | Delete
[139] Fix | Delete
virtual bool action();
[140] Fix | Delete
// Perform an action associated with this item; you may use this in an
[141] Fix | Delete
// user supplied driver for a menu; you may derive from this class and
[142] Fix | Delete
// overload action() to supply items with different actions.
[143] Fix | Delete
// If an action returns true, the menu will be exited. The default action
[144] Fix | Delete
// is to do nothing.
[145] Fix | Delete
};
[146] Fix | Delete
[147] Fix | Delete
// Prototype for an items callback function.
[148] Fix | Delete
typedef bool ITEMCALLBACK(NCursesMenuItem&);
[149] Fix | Delete
[150] Fix | Delete
// If you don't like to create a child class for individual items to
[151] Fix | Delete
// overload action(), you may use this class and provide a callback
[152] Fix | Delete
// function pointer for items.
[153] Fix | Delete
class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem
[154] Fix | Delete
{
[155] Fix | Delete
private:
[156] Fix | Delete
ITEMCALLBACK* p_fct;
[157] Fix | Delete
[158] Fix | Delete
public:
[159] Fix | Delete
NCursesMenuCallbackItem(ITEMCALLBACK* fct = NULL,
[160] Fix | Delete
const char* p_name = NULL,
[161] Fix | Delete
const char* p_descript = NULL )
[162] Fix | Delete
: NCursesMenuItem (p_name, p_descript),
[163] Fix | Delete
p_fct (fct) {
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
NCursesMenuCallbackItem& operator=(const NCursesMenuCallbackItem& rhs)
[167] Fix | Delete
{
[168] Fix | Delete
if (this != &rhs) {
[169] Fix | Delete
*this = rhs;
[170] Fix | Delete
}
[171] Fix | Delete
return *this;
[172] Fix | Delete
}
[173] Fix | Delete
[174] Fix | Delete
NCursesMenuCallbackItem(const NCursesMenuCallbackItem& rhs)
[175] Fix | Delete
: NCursesMenuItem(rhs),
[176] Fix | Delete
p_fct(0)
[177] Fix | Delete
{
[178] Fix | Delete
}
[179] Fix | Delete
[180] Fix | Delete
virtual ~NCursesMenuCallbackItem();
[181] Fix | Delete
[182] Fix | Delete
bool action();
[183] Fix | Delete
};
[184] Fix | Delete
[185] Fix | Delete
// This are the built-in hook functions in this C++ binding. In C++ we use
[186] Fix | Delete
// virtual member functions (see below On_..._Init and On_..._Termination)
[187] Fix | Delete
// to provide this functionality in an object oriented manner.
[188] Fix | Delete
extern "C" {
[189] Fix | Delete
void _nc_xx_mnu_init(MENU *);
[190] Fix | Delete
void _nc_xx_mnu_term(MENU *);
[191] Fix | Delete
void _nc_xx_itm_init(MENU *);
[192] Fix | Delete
void _nc_xx_itm_term(MENU *);
[193] Fix | Delete
}
[194] Fix | Delete
[195] Fix | Delete
//
[196] Fix | Delete
// -------------------------------------------------------------------------
[197] Fix | Delete
// This wraps the MENU type of <menu.h>
[198] Fix | Delete
// -------------------------------------------------------------------------
[199] Fix | Delete
//
[200] Fix | Delete
class NCURSES_IMPEXP NCursesMenu : public NCursesPanel
[201] Fix | Delete
{
[202] Fix | Delete
protected:
[203] Fix | Delete
MENU *menu;
[204] Fix | Delete
[205] Fix | Delete
private:
[206] Fix | Delete
NCursesWindow* sub; // the subwindow object
[207] Fix | Delete
bool b_sub_owner; // is this our own subwindow?
[208] Fix | Delete
bool b_framed; // has the menu a border?
[209] Fix | Delete
bool b_autoDelete; // Delete items when deleting menu?
[210] Fix | Delete
[211] Fix | Delete
NCursesMenuItem** my_items; // The array of items for this menu
[212] Fix | Delete
[213] Fix | Delete
// This structure is used for the menu's user data field to link the
[214] Fix | Delete
// MENU* to the C++ object and to provide extra space for a user pointer.
[215] Fix | Delete
typedef struct {
[216] Fix | Delete
void* m_user; // the pointer for the user's data
[217] Fix | Delete
const NCursesMenu* m_back; // backward pointer to C++ object
[218] Fix | Delete
const MENU* m_owner;
[219] Fix | Delete
} UserHook;
[220] Fix | Delete
[221] Fix | Delete
// Get the backward pointer to the C++ object from a MENU
[222] Fix | Delete
static inline NCursesMenu* getHook(const MENU *m) {
[223] Fix | Delete
UserHook* hook = STATIC_CAST(UserHook*)(::menu_userptr(m));
[224] Fix | Delete
assert(hook != 0 && hook->m_owner==m);
[225] Fix | Delete
return const_cast<NCursesMenu*>(hook->m_back);
[226] Fix | Delete
}
[227] Fix | Delete
[228] Fix | Delete
friend void _nc_xx_mnu_init(MENU *);
[229] Fix | Delete
friend void _nc_xx_mnu_term(MENU *);
[230] Fix | Delete
friend void _nc_xx_itm_init(MENU *);
[231] Fix | Delete
friend void _nc_xx_itm_term(MENU *);
[232] Fix | Delete
[233] Fix | Delete
// Calculate ITEM* array for the menu
[234] Fix | Delete
ITEM** mapItems(NCursesMenuItem* nitems[]);
[235] Fix | Delete
[236] Fix | Delete
protected:
[237] Fix | Delete
// internal routines
[238] Fix | Delete
inline void set_user(void *user) {
[239] Fix | Delete
UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu));
[240] Fix | Delete
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
[241] Fix | Delete
uptr->m_user = user;
[242] Fix | Delete
}
[243] Fix | Delete
[244] Fix | Delete
inline void *get_user() {
[245] Fix | Delete
UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu));
[246] Fix | Delete
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
[247] Fix | Delete
return uptr->m_user;
[248] Fix | Delete
}
[249] Fix | Delete
[250] Fix | Delete
void InitMenu (NCursesMenuItem* menu[],
[251] Fix | Delete
bool with_frame,
[252] Fix | Delete
bool autoDeleteItems);
[253] Fix | Delete
[254] Fix | Delete
inline void OnError (int err) const THROW2(NCursesException const, NCursesMenuException) {
[255] Fix | Delete
if (err != E_OK)
[256] Fix | Delete
THROW(new NCursesMenuException (this, err));
[257] Fix | Delete
}
[258] Fix | Delete
[259] Fix | Delete
// this wraps the menu_driver call.
[260] Fix | Delete
virtual int driver (int c) ;
[261] Fix | Delete
[262] Fix | Delete
// 'Internal' constructor to create a menu without association to
[263] Fix | Delete
// an array of items.
[264] Fix | Delete
NCursesMenu( int nlines,
[265] Fix | Delete
int ncols,
[266] Fix | Delete
int begin_y = 0,
[267] Fix | Delete
int begin_x = 0)
[268] Fix | Delete
: NCursesPanel(nlines,ncols,begin_y,begin_x),
[269] Fix | Delete
menu (STATIC_CAST(MENU*)(0)),
[270] Fix | Delete
sub(0),
[271] Fix | Delete
b_sub_owner(0),
[272] Fix | Delete
b_framed(0),
[273] Fix | Delete
b_autoDelete(0),
[274] Fix | Delete
my_items(0)
[275] Fix | Delete
{
[276] Fix | Delete
}
[277] Fix | Delete
[278] Fix | Delete
public:
[279] Fix | Delete
// Make a full window size menu
[280] Fix | Delete
NCursesMenu (NCursesMenuItem* Items[],
[281] Fix | Delete
bool with_frame=FALSE, // Reserve space for a frame?
[282] Fix | Delete
bool autoDelete_Items=FALSE) // Autocleanup of Items?
[283] Fix | Delete
: NCursesPanel(),
[284] Fix | Delete
menu(0),
[285] Fix | Delete
sub(0),
[286] Fix | Delete
b_sub_owner(0),
[287] Fix | Delete
b_framed(0),
[288] Fix | Delete
b_autoDelete(0),
[289] Fix | Delete
my_items(0)
[290] Fix | Delete
{
[291] Fix | Delete
InitMenu(Items, with_frame, autoDelete_Items);
[292] Fix | Delete
}
[293] Fix | Delete
[294] Fix | Delete
// Make a menu with a window of this size.
[295] Fix | Delete
NCursesMenu (NCursesMenuItem* Items[],
[296] Fix | Delete
int nlines,
[297] Fix | Delete
int ncols,
[298] Fix | Delete
int begin_y = 0,
[299] Fix | Delete
int begin_x = 0,
[300] Fix | Delete
bool with_frame=FALSE, // Reserve space for a frame?
[301] Fix | Delete
bool autoDelete_Items=FALSE) // Autocleanup of Items?
[302] Fix | Delete
: NCursesPanel(nlines, ncols, begin_y, begin_x),
[303] Fix | Delete
menu(0),
[304] Fix | Delete
sub(0),
[305] Fix | Delete
b_sub_owner(0),
[306] Fix | Delete
b_framed(0),
[307] Fix | Delete
b_autoDelete(0),
[308] Fix | Delete
my_items(0)
[309] Fix | Delete
{
[310] Fix | Delete
InitMenu(Items, with_frame, autoDelete_Items);
[311] Fix | Delete
}
[312] Fix | Delete
[313] Fix | Delete
NCursesMenu& operator=(const NCursesMenu& rhs)
[314] Fix | Delete
{
[315] Fix | Delete
if (this != &rhs) {
[316] Fix | Delete
*this = rhs;
[317] Fix | Delete
NCursesPanel::operator=(rhs);
[318] Fix | Delete
}
[319] Fix | Delete
return *this;
[320] Fix | Delete
}
[321] Fix | Delete
[322] Fix | Delete
NCursesMenu(const NCursesMenu& rhs)
[323] Fix | Delete
: NCursesPanel(rhs),
[324] Fix | Delete
menu(rhs.menu),
[325] Fix | Delete
sub(rhs.sub),
[326] Fix | Delete
b_sub_owner(rhs.b_sub_owner),
[327] Fix | Delete
b_framed(rhs.b_framed),
[328] Fix | Delete
b_autoDelete(rhs.b_autoDelete),
[329] Fix | Delete
my_items(rhs.my_items)
[330] Fix | Delete
{
[331] Fix | Delete
}
[332] Fix | Delete
[333] Fix | Delete
virtual ~NCursesMenu ();
[334] Fix | Delete
[335] Fix | Delete
// Retrieve the menus subwindow
[336] Fix | Delete
inline NCursesWindow& subWindow() const {
[337] Fix | Delete
assert(sub!=NULL);
[338] Fix | Delete
return *sub;
[339] Fix | Delete
}
[340] Fix | Delete
[341] Fix | Delete
// Set the menus subwindow
[342] Fix | Delete
void setSubWindow(NCursesWindow& sub);
[343] Fix | Delete
[344] Fix | Delete
// Set these items for the menu
[345] Fix | Delete
inline void setItems(NCursesMenuItem* Items[]) {
[346] Fix | Delete
OnError(::set_menu_items(menu,mapItems(Items)));
[347] Fix | Delete
}
[348] Fix | Delete
[349] Fix | Delete
// Remove the menu from the screen
[350] Fix | Delete
inline void unpost (void) {
[351] Fix | Delete
OnError (::unpost_menu (menu));
[352] Fix | Delete
}
[353] Fix | Delete
[354] Fix | Delete
// Post the menu to the screen if flag is true, unpost it otherwise
[355] Fix | Delete
inline void post(bool flag = TRUE) {
[356] Fix | Delete
flag ? OnError (::post_menu(menu)) : OnError (::unpost_menu (menu));
[357] Fix | Delete
}
[358] Fix | Delete
[359] Fix | Delete
// Get the numer of rows and columns for this menu
[360] Fix | Delete
inline void scale (int& mrows, int& mcols) const {
[361] Fix | Delete
OnError (::scale_menu (menu, &mrows, &mcols));
[362] Fix | Delete
}
[363] Fix | Delete
[364] Fix | Delete
// Set the format of this menu
[365] Fix | Delete
inline void set_format(int mrows, int mcols) {
[366] Fix | Delete
OnError (::set_menu_format(menu, mrows, mcols));
[367] Fix | Delete
}
[368] Fix | Delete
[369] Fix | Delete
// Get the format of this menu
[370] Fix | Delete
inline void menu_format(int& rows,int& ncols) {
[371] Fix | Delete
::menu_format(menu,&rows,&ncols);
[372] Fix | Delete
}
[373] Fix | Delete
[374] Fix | Delete
// Items of the menu
[375] Fix | Delete
inline NCursesMenuItem* items() const {
[376] Fix | Delete
return *my_items;
[377] Fix | Delete
}
[378] Fix | Delete
[379] Fix | Delete
// Get the number of items in this menu
[380] Fix | Delete
inline int count() const {
[381] Fix | Delete
return ::item_count(menu);
[382] Fix | Delete
}
[383] Fix | Delete
[384] Fix | Delete
// Get the current item (i.e. the one the cursor is located)
[385] Fix | Delete
inline NCursesMenuItem* current_item() const {
[386] Fix | Delete
return my_items[::item_index(::current_item(menu))];
[387] Fix | Delete
}
[388] Fix | Delete
[389] Fix | Delete
// Get the marker string
[390] Fix | Delete
inline const char* mark() const {
[391] Fix | Delete
return ::menu_mark(menu);
[392] Fix | Delete
}
[393] Fix | Delete
[394] Fix | Delete
// Set the marker string
[395] Fix | Delete
inline void set_mark(const char *marker) {
[396] Fix | Delete
OnError (::set_menu_mark (menu, marker));
[397] Fix | Delete
}
[398] Fix | Delete
[399] Fix | Delete
// Get the name of the request code c
[400] Fix | Delete
inline static const char* request_name(int c) {
[401] Fix | Delete
return ::menu_request_name(c);
[402] Fix | Delete
}
[403] Fix | Delete
[404] Fix | Delete
// Get the current pattern
[405] Fix | Delete
inline char* pattern() const {
[406] Fix | Delete
return ::menu_pattern(menu);
[407] Fix | Delete
}
[408] Fix | Delete
[409] Fix | Delete
// true if there is a pattern match, false otherwise.
[410] Fix | Delete
bool set_pattern (const char *pat);
[411] Fix | Delete
[412] Fix | Delete
// set the default attributes for the menu
[413] Fix | Delete
// i.e. set fore, back and grey attribute
[414] Fix | Delete
virtual void setDefaultAttributes();
[415] Fix | Delete
[416] Fix | Delete
// Get the menus background attributes
[417] Fix | Delete
inline chtype back() const {
[418] Fix | Delete
return ::menu_back(menu);
[419] Fix | Delete
}
[420] Fix | Delete
[421] Fix | Delete
// Get the menus foreground attributes
[422] Fix | Delete
inline chtype fore() const {
[423] Fix | Delete
return ::menu_fore(menu);
[424] Fix | Delete
}
[425] Fix | Delete
[426] Fix | Delete
// Get the menus grey attributes (used for unselectable items)
[427] Fix | Delete
inline chtype grey() const {
[428] Fix | Delete
return ::menu_grey(menu);
[429] Fix | Delete
}
[430] Fix | Delete
[431] Fix | Delete
// Set the menus background attributes
[432] Fix | Delete
inline chtype set_background(chtype a) {
[433] Fix | Delete
return ::set_menu_back(menu,a);
[434] Fix | Delete
}
[435] Fix | Delete
[436] Fix | Delete
// Set the menus foreground attributes
[437] Fix | Delete
inline chtype set_foreground(chtype a) {
[438] Fix | Delete
return ::set_menu_fore(menu,a);
[439] Fix | Delete
}
[440] Fix | Delete
[441] Fix | Delete
// Set the menus grey attributes (used for unselectable items)
[442] Fix | Delete
inline chtype set_grey(chtype a) {
[443] Fix | Delete
return ::set_menu_grey(menu,a);
[444] Fix | Delete
}
[445] Fix | Delete
[446] Fix | Delete
inline void options_on (Menu_Options opts) {
[447] Fix | Delete
OnError (::menu_opts_on (menu,opts));
[448] Fix | Delete
}
[449] Fix | Delete
[450] Fix | Delete
inline void options_off(Menu_Options opts) {
[451] Fix | Delete
OnError (::menu_opts_off(menu,opts));
[452] Fix | Delete
}
[453] Fix | Delete
[454] Fix | Delete
inline Menu_Options options() const {
[455] Fix | Delete
return ::menu_opts(menu);
[456] Fix | Delete
}
[457] Fix | Delete
[458] Fix | Delete
inline void set_options (Menu_Options opts) {
[459] Fix | Delete
OnError (::set_menu_opts (menu,opts));
[460] Fix | Delete
}
[461] Fix | Delete
[462] Fix | Delete
inline int pad() const {
[463] Fix | Delete
return ::menu_pad(menu);
[464] Fix | Delete
}
[465] Fix | Delete
[466] Fix | Delete
inline void set_pad (int padch) {
[467] Fix | Delete
OnError (::set_menu_pad (menu, padch));
[468] Fix | Delete
}
[469] Fix | Delete
[470] Fix | Delete
// Position the cursor to the current item
[471] Fix | Delete
inline void position_cursor () const {
[472] Fix | Delete
OnError (::pos_menu_cursor (menu));
[473] Fix | Delete
}
[474] Fix | Delete
[475] Fix | Delete
// Set the current item
[476] Fix | Delete
inline void set_current(NCursesMenuItem& I) {
[477] Fix | Delete
OnError (::set_current_item(menu, I.item));
[478] Fix | Delete
}
[479] Fix | Delete
[480] Fix | Delete
// Get the current top row of the menu
[481] Fix | Delete
inline int top_row (void) const {
[482] Fix | Delete
return ::top_row (menu);
[483] Fix | Delete
}
[484] Fix | Delete
[485] Fix | Delete
// Set the current top row of the menu
[486] Fix | Delete
inline void set_top_row (int row) {
[487] Fix | Delete
OnError (::set_top_row (menu, row));
[488] Fix | Delete
}
[489] Fix | Delete
[490] Fix | Delete
// spacing control
[491] Fix | Delete
// Set the spacing for the menu
[492] Fix | Delete
inline void setSpacing(int spc_description,
[493] Fix | Delete
int spc_rows,
[494] Fix | Delete
int spc_columns) {
[495] Fix | Delete
OnError(::set_menu_spacing(menu,
[496] Fix | Delete
spc_description,
[497] Fix | Delete
spc_rows,
[498] Fix | Delete
spc_columns));
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function