Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include
File: cursesf.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: cursesf.h,v 1.32 2014/08/09 22:06:11 Adam.Jiang Exp $
[33] Fix | Delete
[34] Fix | Delete
#ifndef NCURSES_CURSESF_H_incl
[35] Fix | Delete
#define NCURSES_CURSESF_H_incl 1
[36] Fix | Delete
[37] Fix | Delete
#include <cursesp.h>
[38] Fix | Delete
[39] Fix | Delete
#ifndef __EXT_QNX
[40] Fix | Delete
#include <string.h>
[41] Fix | Delete
#endif
[42] Fix | Delete
[43] Fix | Delete
extern "C" {
[44] Fix | Delete
# include <form.h>
[45] Fix | Delete
}
[46] Fix | Delete
//
[47] Fix | Delete
// -------------------------------------------------------------------------
[48] Fix | Delete
// The abstract base class for buitin and user defined Fieldtypes.
[49] Fix | Delete
// -------------------------------------------------------------------------
[50] Fix | Delete
//
[51] Fix | Delete
class NCURSES_IMPEXP NCursesFormField; // forward declaration
[52] Fix | Delete
[53] Fix | Delete
// Class to represent builtin field types as well as C++ written new
[54] Fix | Delete
// fieldtypes (see classes UserDefineFieldType...
[55] Fix | Delete
class NCURSES_IMPEXP NCursesFieldType
[56] Fix | Delete
{
[57] Fix | Delete
friend class NCursesFormField;
[58] Fix | Delete
[59] Fix | Delete
protected:
[60] Fix | Delete
FIELDTYPE* fieldtype;
[61] Fix | Delete
[62] Fix | Delete
inline void OnError(int err) const THROW2(NCursesException const, NCursesFormException) {
[63] Fix | Delete
if (err!=E_OK)
[64] Fix | Delete
THROW(new NCursesFormException (err));
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
NCursesFieldType(FIELDTYPE *f) : fieldtype(f) {
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
virtual ~NCursesFieldType() {}
[71] Fix | Delete
[72] Fix | Delete
// Set the fields f fieldtype to this one.
[73] Fix | Delete
virtual void set(NCursesFormField& f) = 0;
[74] Fix | Delete
[75] Fix | Delete
public:
[76] Fix | Delete
NCursesFieldType()
[77] Fix | Delete
: fieldtype(STATIC_CAST(FIELDTYPE*)(0))
[78] Fix | Delete
{
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
NCursesFieldType& operator=(const NCursesFieldType& rhs)
[82] Fix | Delete
{
[83] Fix | Delete
if (this != &rhs) {
[84] Fix | Delete
*this = rhs;
[85] Fix | Delete
}
[86] Fix | Delete
return *this;
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
NCursesFieldType(const NCursesFieldType& rhs)
[90] Fix | Delete
: fieldtype(rhs.fieldtype)
[91] Fix | Delete
{
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
};
[95] Fix | Delete
[96] Fix | Delete
//
[97] Fix | Delete
// -------------------------------------------------------------------------
[98] Fix | Delete
// The class representing a forms field, wrapping the lowlevel FIELD struct
[99] Fix | Delete
// -------------------------------------------------------------------------
[100] Fix | Delete
//
[101] Fix | Delete
class NCURSES_IMPEXP NCursesFormField
[102] Fix | Delete
{
[103] Fix | Delete
friend class NCursesForm;
[104] Fix | Delete
[105] Fix | Delete
protected:
[106] Fix | Delete
FIELD *field; // lowlevel structure
[107] Fix | Delete
NCursesFieldType* ftype; // Associated field type
[108] Fix | Delete
[109] Fix | Delete
// Error handler
[110] Fix | Delete
inline void OnError (int err) const THROW2(NCursesException const, NCursesFormException) {
[111] Fix | Delete
if (err != E_OK)
[112] Fix | Delete
THROW(new NCursesFormException (err));
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
public:
[116] Fix | Delete
// Create a 'Null' field. Can be used to delimit a field list
[117] Fix | Delete
NCursesFormField()
[118] Fix | Delete
: field(STATIC_CAST(FIELD*)(0)),
[119] Fix | Delete
ftype(STATIC_CAST(NCursesFieldType*)(0))
[120] Fix | Delete
{
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
// Create a new field
[124] Fix | Delete
NCursesFormField (int rows,
[125] Fix | Delete
int ncols,
[126] Fix | Delete
int first_row = 0,
[127] Fix | Delete
int first_col = 0,
[128] Fix | Delete
int offscreen_rows = 0,
[129] Fix | Delete
int additional_buffers = 0)
[130] Fix | Delete
: field(0),
[131] Fix | Delete
ftype(STATIC_CAST(NCursesFieldType*)(0))
[132] Fix | Delete
{
[133] Fix | Delete
field = ::new_field(rows, ncols, first_row, first_col,
[134] Fix | Delete
offscreen_rows, additional_buffers);
[135] Fix | Delete
if (!field)
[136] Fix | Delete
OnError(errno);
[137] Fix | Delete
}
[138] Fix | Delete
[139] Fix | Delete
NCursesFormField& operator=(const NCursesFormField& rhs)
[140] Fix | Delete
{
[141] Fix | Delete
if (this != &rhs) {
[142] Fix | Delete
*this = rhs;
[143] Fix | Delete
}
[144] Fix | Delete
return *this;
[145] Fix | Delete
}
[146] Fix | Delete
[147] Fix | Delete
NCursesFormField(const NCursesFormField& rhs)
[148] Fix | Delete
: field(rhs.field), ftype(rhs.ftype)
[149] Fix | Delete
{
[150] Fix | Delete
}
[151] Fix | Delete
[152] Fix | Delete
virtual ~NCursesFormField ();
[153] Fix | Delete
[154] Fix | Delete
// Duplicate the field at a new position
[155] Fix | Delete
inline NCursesFormField* dup(int first_row, int first_col)
[156] Fix | Delete
{
[157] Fix | Delete
NCursesFormField* f = new NCursesFormField();
[158] Fix | Delete
if (!f)
[159] Fix | Delete
OnError(E_SYSTEM_ERROR);
[160] Fix | Delete
else {
[161] Fix | Delete
f->ftype = ftype;
[162] Fix | Delete
f->field = ::dup_field(field,first_row,first_col);
[163] Fix | Delete
if (!f->field)
[164] Fix | Delete
OnError(errno);
[165] Fix | Delete
}
[166] Fix | Delete
return f;
[167] Fix | Delete
}
[168] Fix | Delete
[169] Fix | Delete
// Link the field to a new location
[170] Fix | Delete
inline NCursesFormField* link(int first_row, int first_col) {
[171] Fix | Delete
NCursesFormField* f = new NCursesFormField();
[172] Fix | Delete
if (!f)
[173] Fix | Delete
OnError(E_SYSTEM_ERROR);
[174] Fix | Delete
else {
[175] Fix | Delete
f->ftype = ftype;
[176] Fix | Delete
f->field = ::link_field(field,first_row,first_col);
[177] Fix | Delete
if (!f->field)
[178] Fix | Delete
OnError(errno);
[179] Fix | Delete
}
[180] Fix | Delete
return f;
[181] Fix | Delete
}
[182] Fix | Delete
[183] Fix | Delete
// Get the lowlevel field representation
[184] Fix | Delete
inline FIELD* get_field() const {
[185] Fix | Delete
return field;
[186] Fix | Delete
}
[187] Fix | Delete
[188] Fix | Delete
// Retrieve info about the field
[189] Fix | Delete
inline void info(int& rows, int& ncols,
[190] Fix | Delete
int& first_row, int& first_col,
[191] Fix | Delete
int& offscreen_rows, int& additional_buffers) const {
[192] Fix | Delete
OnError(::field_info(field, &rows, &ncols,
[193] Fix | Delete
&first_row, &first_col,
[194] Fix | Delete
&offscreen_rows, &additional_buffers));
[195] Fix | Delete
}
[196] Fix | Delete
[197] Fix | Delete
// Retrieve info about the fields dynamic properties.
[198] Fix | Delete
inline void dynamic_info(int& dynamic_rows, int& dynamic_cols,
[199] Fix | Delete
int& max_growth) const {
[200] Fix | Delete
OnError(::dynamic_field_info(field, &dynamic_rows, &dynamic_cols,
[201] Fix | Delete
&max_growth));
[202] Fix | Delete
}
[203] Fix | Delete
[204] Fix | Delete
// For a dynamic field you may set the maximum growth limit.
[205] Fix | Delete
// A zero means unlimited growth.
[206] Fix | Delete
inline void set_maximum_growth(int growth = 0) {
[207] Fix | Delete
OnError(::set_max_field(field,growth));
[208] Fix | Delete
}
[209] Fix | Delete
[210] Fix | Delete
// Move the field to a new position
[211] Fix | Delete
inline void move(int row, int col) {
[212] Fix | Delete
OnError(::move_field(field,row,col));
[213] Fix | Delete
}
[214] Fix | Delete
[215] Fix | Delete
// Mark the field to start a new page
[216] Fix | Delete
inline void new_page(bool pageFlag = FALSE) {
[217] Fix | Delete
OnError(::set_new_page(field,pageFlag));
[218] Fix | Delete
}
[219] Fix | Delete
[220] Fix | Delete
// Retrieve whether or not the field starts a new page.
[221] Fix | Delete
inline bool is_new_page() const {
[222] Fix | Delete
return ::new_page(field);
[223] Fix | Delete
}
[224] Fix | Delete
[225] Fix | Delete
// Set the justification for the field
[226] Fix | Delete
inline void set_justification(int just) {
[227] Fix | Delete
OnError(::set_field_just(field,just));
[228] Fix | Delete
}
[229] Fix | Delete
[230] Fix | Delete
// Retrieve the fields justification
[231] Fix | Delete
inline int justification() const {
[232] Fix | Delete
return ::field_just(field);
[233] Fix | Delete
}
[234] Fix | Delete
// Set the foreground attribute for the field
[235] Fix | Delete
inline void set_foreground(chtype foreground) {
[236] Fix | Delete
OnError(::set_field_fore(field,foreground));
[237] Fix | Delete
}
[238] Fix | Delete
[239] Fix | Delete
// Retrieve the fields foreground attribute
[240] Fix | Delete
inline chtype fore() const {
[241] Fix | Delete
return ::field_fore(field);
[242] Fix | Delete
}
[243] Fix | Delete
[244] Fix | Delete
// Set the background attribute for the field
[245] Fix | Delete
inline void set_background(chtype background) {
[246] Fix | Delete
OnError(::set_field_back(field,background));
[247] Fix | Delete
}
[248] Fix | Delete
[249] Fix | Delete
// Retrieve the fields background attribute
[250] Fix | Delete
inline chtype back() const {
[251] Fix | Delete
return ::field_back(field);
[252] Fix | Delete
}
[253] Fix | Delete
[254] Fix | Delete
// Set the padding character for the field
[255] Fix | Delete
inline void set_pad_character(int padding) {
[256] Fix | Delete
OnError(::set_field_pad(field, padding));
[257] Fix | Delete
}
[258] Fix | Delete
[259] Fix | Delete
// Retrieve the fields padding character
[260] Fix | Delete
inline int pad() const {
[261] Fix | Delete
return ::field_pad(field);
[262] Fix | Delete
}
[263] Fix | Delete
[264] Fix | Delete
// Switch on the fields options
[265] Fix | Delete
inline void options_on (Field_Options opts) {
[266] Fix | Delete
OnError (::field_opts_on (field, opts));
[267] Fix | Delete
}
[268] Fix | Delete
[269] Fix | Delete
// Switch off the fields options
[270] Fix | Delete
inline void options_off (Field_Options opts) {
[271] Fix | Delete
OnError (::field_opts_off (field, opts));
[272] Fix | Delete
}
[273] Fix | Delete
[274] Fix | Delete
// Retrieve the fields options
[275] Fix | Delete
inline Field_Options options () const {
[276] Fix | Delete
return ::field_opts (field);
[277] Fix | Delete
}
[278] Fix | Delete
[279] Fix | Delete
// Set the fields options
[280] Fix | Delete
inline void set_options (Field_Options opts) {
[281] Fix | Delete
OnError (::set_field_opts (field, opts));
[282] Fix | Delete
}
[283] Fix | Delete
[284] Fix | Delete
// Mark the field as changed
[285] Fix | Delete
inline void set_changed(bool changeFlag = TRUE) {
[286] Fix | Delete
OnError(::set_field_status(field,changeFlag));
[287] Fix | Delete
}
[288] Fix | Delete
[289] Fix | Delete
// Test whether or not the field is marked as changed
[290] Fix | Delete
inline bool changed() const {
[291] Fix | Delete
return ::field_status(field);
[292] Fix | Delete
}
[293] Fix | Delete
[294] Fix | Delete
// Return the index of the field in the field array of a form
[295] Fix | Delete
// or -1 if the field is not associated to a form
[296] Fix | Delete
inline int (index)() const {
[297] Fix | Delete
return ::field_index(field);
[298] Fix | Delete
}
[299] Fix | Delete
[300] Fix | Delete
// Store a value in a fields buffer. The default buffer is nr. 0
[301] Fix | Delete
inline void set_value(const char *val, int buffer = 0) {
[302] Fix | Delete
OnError(::set_field_buffer(field,buffer,val));
[303] Fix | Delete
}
[304] Fix | Delete
[305] Fix | Delete
// Retrieve the value of a fields buffer. The default buffer is nr. 0
[306] Fix | Delete
inline char* value(int buffer = 0) const {
[307] Fix | Delete
return ::field_buffer(field,buffer);
[308] Fix | Delete
}
[309] Fix | Delete
[310] Fix | Delete
// Set the validation type of the field.
[311] Fix | Delete
inline void set_fieldtype(NCursesFieldType& f) {
[312] Fix | Delete
ftype = &f;
[313] Fix | Delete
f.set(*this); // A good friend may do that...
[314] Fix | Delete
}
[315] Fix | Delete
[316] Fix | Delete
// Retrieve the validation type of the field.
[317] Fix | Delete
inline NCursesFieldType* fieldtype() const {
[318] Fix | Delete
return ftype;
[319] Fix | Delete
}
[320] Fix | Delete
[321] Fix | Delete
};
[322] Fix | Delete
[323] Fix | Delete
// This are the built-in hook functions in this C++ binding. In C++ we use
[324] Fix | Delete
// virtual member functions (see below On_..._Init and On_..._Termination)
[325] Fix | Delete
// to provide this functionality in an object oriented manner.
[326] Fix | Delete
extern "C" {
[327] Fix | Delete
void _nc_xx_frm_init(FORM *);
[328] Fix | Delete
void _nc_xx_frm_term(FORM *);
[329] Fix | Delete
void _nc_xx_fld_init(FORM *);
[330] Fix | Delete
void _nc_xx_fld_term(FORM *);
[331] Fix | Delete
}
[332] Fix | Delete
[333] Fix | Delete
//
[334] Fix | Delete
// -------------------------------------------------------------------------
[335] Fix | Delete
// The class representing a form, wrapping the lowlevel FORM struct
[336] Fix | Delete
// -------------------------------------------------------------------------
[337] Fix | Delete
//
[338] Fix | Delete
class NCURSES_IMPEXP NCursesForm : public NCursesPanel
[339] Fix | Delete
{
[340] Fix | Delete
protected:
[341] Fix | Delete
FORM* form; // the lowlevel structure
[342] Fix | Delete
[343] Fix | Delete
private:
[344] Fix | Delete
NCursesWindow* sub; // the subwindow object
[345] Fix | Delete
bool b_sub_owner; // is this our own subwindow?
[346] Fix | Delete
bool b_framed; // has the form a border?
[347] Fix | Delete
bool b_autoDelete; // Delete fields when deleting form?
[348] Fix | Delete
[349] Fix | Delete
NCursesFormField** my_fields; // The array of fields for this form
[350] Fix | Delete
[351] Fix | Delete
// This structure is used for the form's user data field to link the
[352] Fix | Delete
// FORM* to the C++ object and to provide extra space for a user pointer.
[353] Fix | Delete
typedef struct {
[354] Fix | Delete
void* m_user; // the pointer for the user's data
[355] Fix | Delete
const NCursesForm* m_back; // backward pointer to C++ object
[356] Fix | Delete
const FORM* m_owner;
[357] Fix | Delete
} UserHook;
[358] Fix | Delete
[359] Fix | Delete
// Get the backward pointer to the C++ object from a FORM
[360] Fix | Delete
static inline NCursesForm* getHook(const FORM *f) {
[361] Fix | Delete
UserHook* hook = reinterpret_cast<UserHook*>(::form_userptr(f));
[362] Fix | Delete
assert(hook != 0 && hook->m_owner==f);
[363] Fix | Delete
return const_cast<NCursesForm*>(hook->m_back);
[364] Fix | Delete
}
[365] Fix | Delete
[366] Fix | Delete
friend void _nc_xx_frm_init(FORM *);
[367] Fix | Delete
friend void _nc_xx_frm_term(FORM *);
[368] Fix | Delete
friend void _nc_xx_fld_init(FORM *);
[369] Fix | Delete
friend void _nc_xx_fld_term(FORM *);
[370] Fix | Delete
[371] Fix | Delete
// Calculate FIELD* array for the menu
[372] Fix | Delete
FIELD** mapFields(NCursesFormField* nfields[]);
[373] Fix | Delete
[374] Fix | Delete
protected:
[375] Fix | Delete
// internal routines
[376] Fix | Delete
inline void set_user(void *user) {
[377] Fix | Delete
UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
[378] Fix | Delete
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
[379] Fix | Delete
uptr->m_user = user;
[380] Fix | Delete
}
[381] Fix | Delete
[382] Fix | Delete
inline void *get_user() {
[383] Fix | Delete
UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
[384] Fix | Delete
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
[385] Fix | Delete
return uptr->m_user;
[386] Fix | Delete
}
[387] Fix | Delete
[388] Fix | Delete
void InitForm (NCursesFormField* Fields[],
[389] Fix | Delete
bool with_frame,
[390] Fix | Delete
bool autoDeleteFields);
[391] Fix | Delete
[392] Fix | Delete
inline void OnError (int err) const THROW2(NCursesException const, NCursesFormException) {
[393] Fix | Delete
if (err != E_OK)
[394] Fix | Delete
THROW(new NCursesFormException (err));
[395] Fix | Delete
}
[396] Fix | Delete
[397] Fix | Delete
// this wraps the form_driver call.
[398] Fix | Delete
virtual int driver (int c) ;
[399] Fix | Delete
[400] Fix | Delete
// 'Internal' constructor, builds an object without association to a
[401] Fix | Delete
// field array.
[402] Fix | Delete
NCursesForm( int nlines,
[403] Fix | Delete
int ncols,
[404] Fix | Delete
int begin_y = 0,
[405] Fix | Delete
int begin_x = 0)
[406] Fix | Delete
: NCursesPanel(nlines, ncols, begin_y, begin_x),
[407] Fix | Delete
form (STATIC_CAST(FORM*)(0)),
[408] Fix | Delete
sub(0),
[409] Fix | Delete
b_sub_owner(0),
[410] Fix | Delete
b_framed(0),
[411] Fix | Delete
b_autoDelete(0),
[412] Fix | Delete
my_fields(0)
[413] Fix | Delete
{
[414] Fix | Delete
}
[415] Fix | Delete
[416] Fix | Delete
public:
[417] Fix | Delete
// Create form for the default panel.
[418] Fix | Delete
NCursesForm (NCursesFormField* Fields[],
[419] Fix | Delete
bool with_frame=FALSE, // reserve space for a frame?
[420] Fix | Delete
bool autoDelete_Fields=FALSE) // do automatic cleanup?
[421] Fix | Delete
: NCursesPanel(),
[422] Fix | Delete
form(0),
[423] Fix | Delete
sub(0),
[424] Fix | Delete
b_sub_owner(0),
[425] Fix | Delete
b_framed(0),
[426] Fix | Delete
b_autoDelete(0),
[427] Fix | Delete
my_fields(0)
[428] Fix | Delete
{
[429] Fix | Delete
InitForm(Fields, with_frame, autoDelete_Fields);
[430] Fix | Delete
}
[431] Fix | Delete
[432] Fix | Delete
// Create a form in a panel with the given position and size.
[433] Fix | Delete
NCursesForm (NCursesFormField* Fields[],
[434] Fix | Delete
int nlines,
[435] Fix | Delete
int ncols,
[436] Fix | Delete
int begin_y,
[437] Fix | Delete
int begin_x,
[438] Fix | Delete
bool with_frame=FALSE, // reserve space for a frame?
[439] Fix | Delete
bool autoDelete_Fields=FALSE) // do automatic cleanup?
[440] Fix | Delete
: NCursesPanel(nlines, ncols, begin_y, begin_x),
[441] Fix | Delete
form(0),
[442] Fix | Delete
sub(0),
[443] Fix | Delete
b_sub_owner(0),
[444] Fix | Delete
b_framed(0),
[445] Fix | Delete
b_autoDelete(0),
[446] Fix | Delete
my_fields(0)
[447] Fix | Delete
{
[448] Fix | Delete
InitForm(Fields, with_frame, autoDelete_Fields);
[449] Fix | Delete
}
[450] Fix | Delete
[451] Fix | Delete
NCursesForm& operator=(const NCursesForm& rhs)
[452] Fix | Delete
{
[453] Fix | Delete
if (this != &rhs) {
[454] Fix | Delete
*this = rhs;
[455] Fix | Delete
NCursesPanel::operator=(rhs);
[456] Fix | Delete
}
[457] Fix | Delete
return *this;
[458] Fix | Delete
}
[459] Fix | Delete
[460] Fix | Delete
NCursesForm(const NCursesForm& rhs)
[461] Fix | Delete
: NCursesPanel(rhs),
[462] Fix | Delete
form(rhs.form),
[463] Fix | Delete
sub(rhs.sub),
[464] Fix | Delete
b_sub_owner(rhs.b_sub_owner),
[465] Fix | Delete
b_framed(rhs.b_framed),
[466] Fix | Delete
b_autoDelete(rhs.b_autoDelete),
[467] Fix | Delete
my_fields(rhs.my_fields)
[468] Fix | Delete
{
[469] Fix | Delete
}
[470] Fix | Delete
[471] Fix | Delete
virtual ~NCursesForm();
[472] Fix | Delete
[473] Fix | Delete
// Set the default attributes for the form
[474] Fix | Delete
virtual void setDefaultAttributes();
[475] Fix | Delete
[476] Fix | Delete
// Retrieve current field of the form.
[477] Fix | Delete
inline NCursesFormField* current_field() const {
[478] Fix | Delete
return my_fields[::field_index(::current_field(form))];
[479] Fix | Delete
}
[480] Fix | Delete
[481] Fix | Delete
// Set the forms subwindow
[482] Fix | Delete
void setSubWindow(NCursesWindow& sub);
[483] Fix | Delete
[484] Fix | Delete
// Set these fields for the form
[485] Fix | Delete
inline void setFields(NCursesFormField* Fields[]) {
[486] Fix | Delete
OnError(::set_form_fields(form,mapFields(Fields)));
[487] Fix | Delete
}
[488] Fix | Delete
[489] Fix | Delete
// Remove the form from the screen
[490] Fix | Delete
inline void unpost (void) {
[491] Fix | Delete
OnError (::unpost_form (form));
[492] Fix | Delete
}
[493] Fix | Delete
[494] Fix | Delete
// Post the form to the screen if flag is true, unpost it otherwise
[495] Fix | Delete
inline void post(bool flag = TRUE) {
[496] Fix | Delete
OnError (flag ? ::post_form(form) : ::unpost_form (form));
[497] Fix | Delete
}
[498] Fix | Delete
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function