Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

NDK_XX::Control Class Reference

#include <ndk++.h>

Inheritance diagram for NDK_XX::Control:

NDK_XX::DialogBox NDK_XX::Label NDK_XX::ListBox NDK_XX::MessageBox NDK_XX::PropertyDialog NDK_XX::PropertyPage TestBox NDK_XX::Button NDK_XX::Edit NDK_XX::StatusBar NDK_XX::CheckListBox NDK_XX::ChoiceBox NDK_XX::MenuBar NDK_XX::SelectionBox List of all members.

Public Types

enum  styles {
  framed = 0x0001, moveable = 0x0002, editable = 0x0004, tabstop = 0x0008,
  notify = 0x0010, hscroll = 0x0020, multisel = 0x0040, hscrollbar = 0x0100,
  vscrollbar = 0x0200, title = 0x0400, hidden = 0x0800
}
 The styles a control can have. More...

enum  states {
  unknown = 0x0000, active = 0x0001, ovrwrt = 0x0002, checked = 0x0004,
  visible = 0x0008
}
 The states a control can take. More...


Public Methods

 Control (Control *parent, int id,int lines, int cols, int y, int x, int style=0)
 Control (int id,int lines, int cols, int y, int x, int style=0)
styles get_style () const
 tell me what styles this window has...

styles set_styles (styles s)
 set all styles at once...

styles set_style (styles s, bool on=true)
 set/unset a style bit

states get_state () const
 tell me what status this window is on...

states set_states (states s)
 set all states at once...

states set_state (states s, bool on=true)
 set/unset a state bit

bool has_frame () const
 if this style has been set...

bool is_moveable () const
 the user can move this control?...

bool is_editable () const
 the user can edit this control's text?

bool is_visible () const
 are we visible on the list viewport?

int mvwin (int y, int x)
virtual void set_text (const string &txt)=0
 Usualy, a control in a dialog has some kind of text on it...

virtual string get_text () const=0
int get_ctrl_id () const
 The control identifier.

void set_ctrl_id (int id)
virtual void activate ()
 Draw as active (i.e.,with bold frame).

virtual void deactivate ()
 Draw as inactive (i.e.,with normal frame).

void set_visible (bool new_state=true)
 show or hide

void enable (bool t_or_f=true)
 Ignore /Stop ignoring us when user press tab.

bool is_enabled () const
 can make this control the active control?

void set_hscroll (bool t_or_f=true)
 Ignore /Stop ignoring us when user press tab.

bool is_hscroll_set () const
 can make this control the active control?

void set_multisel (bool t_or_f=true)
 Allow multiple selections.

bool is_multisel () const
 can make this control the active control?

void enable_notify (bool t_or_f=true)
 notify parent of changes

bool notify_enabled () const
 should we notify our parent upon firing of action()?

void set_overwrite (bool t_or_f=true)
 Set edit mode to overwrite or insert.

bool overwrite () const
 the user current pos is overwritten or char is inserted?

bool has_hscrollbar () const
 if this style has been set...

void set_hscrollbar (bool t_or_f=true)
bool has_vscrollbar () const
void set_vscrollbar (bool t_or_f=true)
bool has_show_title () const
 Should we write the title of this control?

void set_show_title (bool t_or_f=true)
void use_arrow_as_tab (bool t_or_f=true)
 if set, when user presses key left or right, move to next/previous control

bool arrow_is_tab ()
bool is_hidden () const
void set_hidden (bool t_or_f=true)
virtual void show ()
 call panel's show and set our state accordingly

virtual void hide ()
 call panel's hide and set our state accordingly

string get_param (const string &section_name,const string &key_name,const string &val)
 Delegation function to get the params from almost anywhere in NDK++.

long get_param (const string &section_name,const string &key_name,long val)
 Delegation function to get the params from almost anywhere in NDK++.

string save_param (const string &section_name,const string &key_name,const string &val)
 Delegation function to set the params from almost anywhere in NDK++.

long save_param (const string &section_name,const string &key_name,long val)
 Delegation function to set the params from almost anywhere in NDK++.

virtual bool clicked_inside (int y, int x) const

Static Public Methods

ofstream & send_to_log (const string &what)

Protected Methods

virtual int driver (int key)
virtual int move_left ()
virtual int move_right ()
virtual const BINDING_MAPget_binding_map () const

Static Protected Methods

bool process_message (Control *pTarget, int what, int ctrl_id, void *pExtra)
const BINDINGget_binding (const BINDING *pEntry,int what, int ctrl_id)
 Helper to find a binding for what corresponding to ctrl_id.


Protected Attributes

Control * pParent
int ctrl_id
int field_style
int field_state
bool arrow_as_tab

Static Protected Attributes

const BINDING_MAP bindingMap

Static Private Attributes

const BINDING _bindingEntries []

Friends

class DialogBox

Member Enumeration Documentation

enum NDK_XX::Control::states
 

The states a control can take.

Enumeration values:
unknown 
active 
ovrwrt  aka Focused
checked  if editable==true, insert or overwrite?
visible  If a selectable control, are we checked?

Definition at line 82 of file ndk++.h.

Referenced by get_state(), NDK_XX::ListItem::operator=(), set_state(), and set_states().

00082                {
00083         unknown =   0x0000,
00084         active  =   0x0001, ///aka Focused
00085         ovrwrt  =   0x0002, ///if editable==true, insert or overwrite?
00086         checked=    0x0004, ///If a selectable control, are we checked?
00087         visible =   0x0008  ///dito
00088     };

enum NDK_XX::Control::styles
 

The styles a control can have.

Enumeration values:
framed 
moveable  Do we have a frame?
editable  We can be moved around?
tabstop  Is our text editable?
notify  Can be looped thru?
hscroll  Do we notify our parent of events?
multisel  Can we scroll horizontally?
hscrollbar  Can select multiple items?
vscrollbar  Draw horizontal scrollbar?
title  Draw vertical scrollbar?
hidden  Show title of this control?

Definition at line 67 of file ndk++.h.

Referenced by get_style(), NDK_XX::MessageBox::on_dlg_init(), NDK_XX::ListItem::operator=(), set_style(), and set_styles().

00067                {
00068         framed  =   0x0001, ///Do we have a frame?
00069         moveable=   0x0002, ///We can be moved around?
00070         editable=   0x0004, ///Is our text editable?
00071         tabstop =   0x0008, ///Can be looped thru?
00072         notify  =   0x0010, ///Do we notify our parent of events?
00073         hscroll =   0x0020, ///Can we scroll horizontally?
00074         multisel=   0x0040, ///Can select multiple items?
00075         hscrollbar= 0x0100, ///Draw horizontal scrollbar?
00076         vscrollbar= 0x0200, ///Draw vertical scrollbar?
00077         title   =   0x0400, ///Show title of this control?
00078         hidden  =   0x0800  ///Should we be seen in a window?
00079     };


Constructor & Destructor Documentation

NDK_XX::Control::Control Control *    parent,
int    id,
int    lines,
int    cols,
int    y,
int    x,
int    style = 0
[inline]
 

Control Constructor

Parameters:
parent:  the parent window containing this control
id  a user defined const int identifying this control
lines:  height of the control
cols  width of the control
y  line where we are placed, relative to parent's top left
x  column where we are placed, relative to parent's top left
style  style indications for enabling/disabling control's capabilities

Definition at line 107 of file ndk++.h.

References arrow_as_tab, ctrl_id, field_state, field_style, has_frame(), pParent, set_visible(), and unknown.

00109         : NCursesPanel(lines,cols,parent->begy()+y,parent->begx()+x)
00110             ,pParent(parent),ctrl_id(id)
00111             ,field_style(style),field_state(unknown)
00112             ,arrow_as_tab(true)
00113     {
00114         if(has_frame()){
00115             box();
00116         }
00117         set_visible();
00118     }

NDK_XX::Control::Control int    id,
int    lines,
int    cols,
int    y,
int    x,
int    style = 0
[inline]
 

Control Constructor

Parameters:
id  a user defined const int identifying this control
lines:  height of the control
cols  width of the control
y  line where we are placed, absolute coord.
x  column where we are placed, absolute coord.
style  style indications for enabling/disabling control's capabilities

Definition at line 135 of file ndk++.h.

References arrow_as_tab, ctrl_id, field_state, field_style, has_frame(), pParent, set_visible(), and unknown.

00137         : NCursesPanel(lines,cols,y,x)
00138             ,pParent(0),ctrl_id(id)
00139             ,field_style(style),field_state(unknown)
00140             ,arrow_as_tab(true)
00141     {
00142         if(has_frame()){
00143             box();
00144         }
00145         set_visible();
00146     }


Member Function Documentation

void NDK_XX::Control::activate   [virtual]
 

Draw as active (i.e.,with bold frame).

Reimplemented in NDK_XX::Label, NDK_XX::Button, NDK_XX::ListBox, and NDK_XX::Tab.

Definition at line 203 of file ndk++.cc.

References active, has_frame(), is_hidden(), and set_state().

Referenced by NDK_XX::Tab::activate().

00204 {
00205     if(is_hidden())
00206         return;
00207     top();
00208     set_state(active);
00209     if(has_frame()){
00210         attron(A_BOLD);
00211         box();
00212         attroff(A_BOLD);
00213         refresh();
00214     }
00215 }

bool NDK_XX::Control::arrow_is_tab   [inline]
 

Definition at line 246 of file ndk++.h.

References arrow_as_tab.

Referenced by move_left(), and move_right().

00246 {return arrow_as_tab;}

virtual bool NDK_XX::Control::clicked_inside int    y,
int    x
const [inline, virtual]
 

No descriptions

Definition at line 301 of file ndk++.h.

Referenced by NDK_XX::Tab::driver(), NDK_XX::Button::driver(), NDK_XX::DialogBox::find_clicked(), NDK_XX::MenuBar::find_clicked(), and NDK_XX::PropertyPage::on_cmd().

00301                                                    {
00302         return ( begy() <= y &&
00303                  begx() <= x &&
00304                  (begx() + maxx()) >= x &&
00305                  (begy() + maxy()) >= y
00306                 );
00307     }

void NDK_XX::Control::deactivate   [virtual]
 

Draw as inactive (i.e.,with normal frame).

Reimplemented in NDK_XX::Label, NDK_XX::Button, NDK_XX::ListBox, and NDK_XX::Tab.

Definition at line 219 of file ndk++.cc.

References active, has_frame(), is_hidden(), and set_state().

Referenced by NDK_XX::Tab::deactivate().

00220 {
00221     if(is_hidden())
00222         return;
00223     top();
00224     set_state(active,false);
00225     if(has_frame()){
00226         attroff(A_BOLD);
00227         box();
00228         refresh();
00229     }
00230 }

int NDK_XX::Control::driver int    key [protected, virtual]
 

get a chance at processing the key, before parent does

Reimplemented in NDK_XX::Edit, NDK_XX::Button, NDK_XX::PropDlgPushButton, NDK_XX::ListItem, NDK_XX::MenuItem, NDK_XX::ListBox, NDK_XX::MenuBar, NDK_XX::DialogBox, NDK_XX::PropertyPage, and NDK_XX::Tab.

Definition at line 296 of file ndk++.cc.

References move_left(), and move_right().

00297 {
00298     switch(key) {
00299         case KEY_RIGHT: 
00300             return move_right();
00301         case KEY_LEFT: 
00302             return move_left();
00303         default:                    break;
00304     }
00305     return FALSE;
00306 }

void NDK_XX::Control::enable bool    t_or_f = true [inline]
 

Ignore /Stop ignoring us when user press tab.

Definition at line 202 of file ndk++.h.

References set_style(), and tabstop.

Referenced by NDK_XX::DialogBox::add_ok_cancel(), NDK_XX::PropertyDialog::cancel_to_close(), NDK_XX::PropertyDialog::create_buttons(), hide(), and show().

00202 { set_style(tabstop,t_or_f);}

void NDK_XX::Control::enable_notify bool    t_or_f = true [inline]
 

notify parent of changes

Definition at line 220 of file ndk++.h.

References notify, and set_style().

Referenced by NDK_XX::CheckButton::CheckButton(), NDK_XX::EditDate::EditDate(), NDK_XX::Label::Label(), NDK_XX::ListBox::ListBox(), NDK_XX::MenuItem::MenuItem(), NDK_XX::PushButton::PushButton(), NDK_XX::RadioButton::RadioButton(), and NDK_XX::Tab::Tab().

00220 { set_style(notify,t_or_f);}

const BINDING * NDK_XX::Control::get_binding const BINDING   pEntry,
int    what,
int    ctrl_id
[static, protected]
 

Helper to find a binding for what corresponding to ctrl_id.

Definition at line 96 of file ndk++.cc.

References NDK_XX::BINDING::ctrl_id, ctrl_id, NDK_XX::BINDING::last_ctrl_id, NDK_XX::BINDING::pfn(), and NDK_XX::BINDING::what.

Referenced by process_message().

00097 {
00098     // C version of search routine
00099     while (pEntry->pfn())
00100     {
00101         if (pEntry->what == what &&
00102             ctrl_id >= pEntry->ctrl_id && ctrl_id <= pEntry->last_ctrl_id){
00103             return pEntry;
00104         }
00105         pEntry++;
00106     }
00107     return 0;    // not found
00108 }

virtual const BINDING_MAP* NDK_XX::Control::get_binding_map   const [protected, virtual]
 

Referenced by process_message().

int NDK_XX::Control::get_ctrl_id   const [inline]
 

The control identifier.

Definition at line 189 of file ndk++.h.

References ctrl_id.

Referenced by NDK_XX::Tab::activate(), NDK_XX::Edit::add_or_insert_char(), NDK_XX::PropertyDialog::add_page(), NDK_XX::Edit::edit(), NDK_XX::ListBox::move_down(), NDK_XX::ListBox::move_up(), NDK_XX::OkCancelBox::OkCancelBox(), NDK_XX::ListBox::on_sel_change(), and NDK_XX::Label::set_text().

00189 {return ctrl_id;};

long NDK_XX::Control::get_param const string &    section_name,
const string &    key_name,
long    val
[inline]
 

Delegation function to get the params from almost anywhere in NDK++.

Definition at line 2161 of file ndk++.h.

string NDK_XX::Control::get_param const string &    section_name,
const string &    key_name,
const string &    val
[inline]
 

Delegation function to get the params from almost anywhere in NDK++.

Definition at line 2170 of file ndk++.h.

Referenced by NDK_XX::MenuBar::driver(), TabbedDlgPage2::on_dlg_init(), and TestBox::on_dlg_init().

states NDK_XX::Control::get_state   const [inline]
 

tell me what status this window is on...

Definition at line 158 of file ndk++.h.

References field_state, and states.

Referenced by NDK_XX::ListItemData::operator=().

00158 { return states(field_state); }

styles NDK_XX::Control::get_style   const [inline]
 

tell me what styles this window has...

Definition at line 148 of file ndk++.h.

References field_style, and styles.

Referenced by NDK_XX::ListItemData::operator=().

00148 { return styles(field_style); }

virtual string NDK_XX::Control::get_text   const [pure virtual]
 

Implemented in NDK_XX::Label, NDK_XX::ListBox, and NDK_XX::DialogBox.

bool NDK_XX::Control::has_frame   const [inline]
 

if this style has been set...

Definition at line 167 of file ndk++.h.

References field_style, and framed.

Referenced by NDK_XX::Label::activate(), activate(), Control(), NDK_XX::Label::deactivate(), deactivate(), NDK_XX::DialogBox::DialogBox(), NDK_XX::MenuBar::get_next_item_y(), NDK_XX::ChoiceBox::initialize_items(), NDK_XX::CheckListBox::initialize_items(), NDK_XX::SelectionBox::initialize_items(), NDK_XX::Label::Label(), NDK_XX::ListBox::ListBox(), NDK_XX::Tab::set_text(), NDK_XX::PushButton::set_text(), and NDK_XX::Edit::~Edit().

00167 {return ( (field_style & framed)== framed);}

bool NDK_XX::Control::has_hscrollbar   const [inline]
 

if this style has been set...

Definition at line 234 of file ndk++.h.

References field_style, and hscrollbar.

00234 {return ( (field_style & hscrollbar)== hscrollbar);}

bool NDK_XX::Control::has_show_title   const [inline]
 

Should we write the title of this control?

Definition at line 241 of file ndk++.h.

References field_style, and title.

Referenced by NDK_XX::DialogBox::DialogBox().

00241 {return ( (field_style & title)== title);}

bool NDK_XX::Control::has_vscrollbar   const [inline]
 

Definition at line 237 of file ndk++.h.

References field_style, and vscrollbar.

Referenced by NDK_XX::ListBox::draw_scrollbar().

00237 {return ( (field_style & vscrollbar)== vscrollbar);}

virtual void NDK_XX::Control::hide   [inline, virtual]
 

call panel's hide and set our state accordingly

Reimplemented in NDK_XX::ListBox, NDK_XX::DialogBox, and NDK_XX::Tab.

Definition at line 272 of file ndk++.h.

References enable(), is_visible(), and set_visible().

Referenced by set_hidden().

00272                        {
00273         if(!is_visible()) return;
00274         NCursesPanel::hide();
00275         set_visible(false);
00276         enable(false);
00277     }

bool NDK_XX::Control::is_editable   const [inline]
 

the user can edit this control's text?

Definition at line 174 of file ndk++.h.

References editable, and field_style.

Referenced by overwrite().

00174 { return ( (field_style & editable)==editable);}

bool NDK_XX::Control::is_enabled   const [inline]
 

can make this control the active control?

Definition at line 205 of file ndk++.h.

References field_style, and tabstop.

00205 { return ( (field_style & tabstop)==tabstop);}

bool NDK_XX::Control::is_hidden   const [inline]
 

Should this control be shown at all? NOT same as visible/invisible, which is used to post/unpost a control under user actions. i.e.: we have two controls going to the same place, but we will show one and hide the other under some circumstances.

Definition at line 253 of file ndk++.h.

References field_style, and hidden.

Referenced by NDK_XX::Tab::activate(), NDK_XX::Label::activate(), activate(), NDK_XX::Tab::deactivate(), NDK_XX::Label::deactivate(), deactivate(), and show().

00253 {return ( (field_style & hidden)== hidden);}

bool NDK_XX::Control::is_hscroll_set   const [inline]
 

can make this control the active control?

Definition at line 211 of file ndk++.h.

References field_style, and hscroll.

00211 { return ( (field_style & hscroll)==hscroll);}

bool NDK_XX::Control::is_moveable   const [inline]
 

the user can move this control?...

Definition at line 171 of file ndk++.h.

References field_style, and moveable.

Referenced by mvwin().

00171 { return ( (field_style & moveable)==moveable);}

bool NDK_XX::Control::is_multisel   const [inline]
 

can make this control the active control?

Definition at line 217 of file ndk++.h.

References field_style, and multisel.

Referenced by NDK_XX::ListBox::check_multisel(), NDK_XX::ListBox::get_cur_sel(), NDK_XX::ListBox::get_sel_items(), NDK_XX::ListBox::move_down(), NDK_XX::ListBox::move_up(), NDK_XX::ListBox::remove_item(), and NDK_XX::ListBox::set_sel_items().

00217 { return ( (field_style & multisel)==multisel);}

bool NDK_XX::Control::is_visible   const [inline]
 

are we visible on the list viewport?

Definition at line 177 of file ndk++.h.

References field_state, and visible.

Referenced by hide(), and show().

00177 { return ( (field_state & visible)==visible);}

int NDK_XX::Control::move_left   [protected, virtual]
 

move_left and move_right:

if arrow_is_tab == true, they return false, so the owner can process KEY_LEFT and KEY_RIGHT, and properly move to previous or next control.

Reimplemented in NDK_XX::Edit, NDK_XX::MenuBar, and NDK_XX::SubMenu.

Definition at line 181 of file ndk++.cc.

References arrow_is_tab().

Referenced by NDK_XX::ListBox::driver(), and driver().

00182 {
00183     int result = false;
00184     if(!arrow_is_tab())
00185         result =  true;
00186     beep();
00187     return result;
00188 }

int NDK_XX::Control::move_right   [protected, virtual]
 

Reimplemented in NDK_XX::Edit, NDK_XX::MenuBar, and NDK_XX::SubMenu.

Definition at line 192 of file ndk++.cc.

References arrow_is_tab().

Referenced by NDK_XX::ListBox::driver(), and driver().

00193 {
00194     int result=false;
00195     if(!arrow_is_tab())
00196         result = true;
00197     beep();
00198     return result;
00199 }

int NDK_XX::Control::mvwin int    y,
int    x
 

a control always moves inside its parent boundaries, so make this function use only relative values...

Definition at line 154 of file ndk++.cc.

References is_moveable(), and pParent.

Referenced by NDK_XX::PropertyDialog::reorder_pages().

00155 {
00156     if(!is_moveable())
00157         return E_REQUEST_DENIED;
00158         
00159     int result=0;
00160     int new_x=begx()+x;
00161     int new_y=begy()+y;
00162     
00163     if( new_x > pParent->begx() 
00164         && new_x+ width() <= pParent->begx()+pParent->maxx() 
00165         && new_y > pParent->begy() 
00166         && new_y+ height() <= pParent->begy()+pParent->maxy()
00167     ){
00168         result = NCursesPanel::mvwin(new_y,new_x);
00169         if(result==OK){
00170             w->_begx = new_x;
00171             w->_begy = new_y;
00172             refresh();
00173         }
00174     }
00175     return result;
00176 }

bool NDK_XX::Control::notify_enabled   const [inline]
 

should we notify our parent upon firing of action()?

Definition at line 223 of file ndk++.h.

References field_style, and notify.

Referenced by NDK_XX::Tab::activate(), NDK_XX::Edit::add_or_insert_char(), NDK_XX::Edit::edit(), NDK_XX::ListBox::move_down(), NDK_XX::ListBox::move_up(), NDK_XX::OkCancelBox::OkCancelBox(), NDK_XX::ListBox::on_sel_change(), and NDK_XX::Label::set_text().

00223 { return ( (field_style & notify)==notify);}

bool NDK_XX::Control::overwrite   const [inline]
 

the user current pos is overwritten or char is inserted?

Definition at line 229 of file ndk++.h.

References field_state, is_editable(), and ovrwrt.

Referenced by NDK_XX::Edit::add_or_insert_char().

00230         { return (is_editable() &&( (field_state & ovrwrt)==ovrwrt));}

bool NDK_XX::Control::process_message Control *    pTarget,
int    what,
int    ctrl_id,
void *    pExtra
[static, protected]
 

this method starts with pTarget and clibs it way thru the inheritance tree searching for a handler for what corresponding to ctrl_id

Definition at line 68 of file ndk++.cc.

References NDK_XX::BINDING_MAP::base_map, ctrl_id, get_binding(), get_binding_map(), NDK_XX::BINDING::p_cmd_fn, NDK_XX::BINDING::p_notif_fn, and NDK_XX::BINDING_MAP::pEntries.

Referenced by NDK_XX::Tab::activate(), NDK_XX::Edit::add_or_insert_char(), NDK_XX::Tab::driver(), NDK_XX::Edit::edit(), NDK_XX::ListBox::move_down(), NDK_XX::ListBox::move_up(), NDK_XX::OkCancelBox::OkCancelBox(), NDK_XX::ListBox::on_sel_change(), and NDK_XX::Label::set_text().

00070 {
00071     if(!pTarget)
00072         return false;
00073     const BINDING_MAP* binding_map;
00074     const BINDING* pEntry;
00075 
00076     for (binding_map = pTarget->get_binding_map(); binding_map != 0;
00077       binding_map = binding_map->base_map)
00078     {
00079         assert(bindings_map != binding_map->base_map);
00080 
00081         pEntry = get_binding(binding_map->pEntries, what, ctrl_id);
00082         if (pEntry)
00083         {   
00084             if(what==0)
00085             (pTarget->*pEntry->p_cmd_fn)(); 
00086             else// found it
00087             (pTarget->*pEntry->p_notif_fn)(ctrl_id); 
00088             return true;
00089         }
00090     }
00091     return false;   // not handled
00092 }

long NDK_XX::Control::save_param const string &    section_name,
const string &    key_name,
long    val
[inline]
 

Delegation function to set the params from almost anywhere in NDK++.

Definition at line 2179 of file ndk++.h.

string NDK_XX::Control::save_param const string &    section_name,
const string &    key_name,
const string &    val
[inline]
 

Delegation function to set the params from almost anywhere in NDK++.

Definition at line 2188 of file ndk++.h.

ofstream & NDK_XX::Control::send_to_log const string &    what [static]
 

Definition at line 60 of file ndk++.cc.

References NDK_XX::logfile().

00061 {
00062     logfile << what;
00063     return logfile;
00064 }

void NDK_XX::Control::set_ctrl_id int    id [inline]
 

Definition at line 190 of file ndk++.h.

References ctrl_id.

Referenced by NDK_XX::ListItem::operator=().

00190 {ctrl_id=id;};

void NDK_XX::Control::set_hidden bool    t_or_f = true [inline]
 

Definition at line 254 of file ndk++.h.

References hidden, hide(), and set_style().

00254                                      {
00255         if(t_or_f==true){
00256             hide();
00257         }
00258         set_style(hidden,t_or_f);
00259     }

void NDK_XX::Control::set_hscroll bool    t_or_f = true [inline]
 

Ignore /Stop ignoring us when user press tab.

Definition at line 208 of file ndk++.h.

References hscroll, and set_style().

00208 { set_style(hscroll,t_or_f);}

void NDK_XX::Control::set_hscrollbar bool    t_or_f = true [inline]
 

Definition at line 235 of file ndk++.h.

References hscrollbar, and set_style().

00235 { set_style(hscrollbar,t_or_f);}

void NDK_XX::Control::set_multisel bool    t_or_f = true [inline]
 

Allow multiple selections.

Definition at line 214 of file ndk++.h.

References multisel, and set_style().

00214 { set_style(multisel,t_or_f);}

void NDK_XX::Control::set_overwrite bool    t_or_f = true [inline]
 

Set edit mode to overwrite or insert.

Definition at line 226 of file ndk++.h.

References ovrwrt, and set_state().

Referenced by NDK_XX::EditDate::EditDate().

00226 { set_state(ovrwrt,t_or_f);}

void NDK_XX::Control::set_show_title bool    t_or_f = true [inline]
 

Definition at line 242 of file ndk++.h.

References set_style(), and title.

00242 { set_style(title,t_or_f);}

Control::states NDK_XX::Control::set_state states    s,
bool    on = true
 

set/unset a state bit

Definition at line 144 of file ndk++.cc.

References field_state, and states.

Referenced by activate(), deactivate(), set_overwrite(), and set_visible().

00145 { 
00146     int old_state=field_state;
00147     if (on) field_state|=s;
00148     else    field_state&=~s;
00149     return states(old_state);
00150 }  

Control::states NDK_XX::Control::set_states states    s
 

set all states at once...

Definition at line 134 of file ndk++.cc.

References field_state, and states.

Referenced by NDK_XX::ListItem::operator=().

00135 { 
00136     int old_state=field_state;
00137     field_state=s;
00138     return states(old_state);
00139 }

Control::styles NDK_XX::Control::set_style styles    s,
bool    on = true
 

set/unset a style bit

Definition at line 123 of file ndk++.cc.

References field_style, and styles.

Referenced by enable(), enable_notify(), NDK_XX::MessageBox::on_dlg_init(), NDK_XX::PushButton::PushButton(), set_hidden(), set_hscroll(), set_hscrollbar(), set_multisel(), set_show_title(), and set_vscrollbar().

00124 { 
00125     int old_style=field_style;
00126     if (on) field_style|=s;
00127     else    field_style&=~s;
00128     return styles(old_style);
00129 }  

Control::styles NDK_XX::Control::set_styles styles    s
 

set all styles at once...

Definition at line 113 of file ndk++.cc.

References field_style, and styles.

Referenced by NDK_XX::ListItem::operator=().

00114 { 
00115     int old_style=field_style;
00116     field_style=s;
00117     return styles(old_style);
00118 }

virtual void NDK_XX::Control::set_text const string &    txt [pure virtual]
 

Usualy, a control in a dialog has some kind of text on it...

Implemented in NDK_XX::Label, NDK_XX::PushButton, NDK_XX::ListItem, NDK_XX::ListBox, NDK_XX::DialogBox, and NDK_XX::Tab.

void NDK_XX::Control::set_visible bool    new_state = true [inline]
 

show or hide

Definition at line 199 of file ndk++.h.

References set_state(), and visible.

Referenced by Control(), hide(), and show().

00199 {set_state(visible,new_state);}

void NDK_XX::Control::set_vscrollbar bool    t_or_f = true [inline]
 

Definition at line 238 of file ndk++.h.

References set_style(), and vscrollbar.

00238 { set_style(vscrollbar,t_or_f);}

virtual void NDK_XX::Control::show   [inline, virtual]
 

call panel's show and set our state accordingly

Reimplemented in NDK_XX::ListBox, NDK_XX::DialogBox, and NDK_XX::Tab.

Definition at line 263 of file ndk++.h.

References enable(), is_hidden(), is_visible(), and set_visible().

00263                        {
00264         if(is_hidden()) return;
00265         if(is_visible()) return;
00266         NCursesPanel::show();
00267         set_visible();
00268         enable();
00269     }

void NDK_XX::Control::use_arrow_as_tab bool    t_or_f = true [inline]
 

if set, when user presses key left or right, move to next/previous control

Definition at line 245 of file ndk++.h.

References arrow_as_tab.

00245 {arrow_as_tab=t_or_f;}


Friends And Related Function Documentation

friend class DialogBox [friend]
 

Definition at line 64 of file ndk++.h.


Member Data Documentation

const BINDING NDK_XX::Control::_bindingEntries[] [static, private]
 

Definition at line 336 of file ndk++.h.

bool NDK_XX::Control::arrow_as_tab [protected]
 

User can choose if using the arrows at left or right edges yields the same effect as pressing TAB/SHIFT-TAB default: TRUE;

Definition at line 319 of file ndk++.h.

Referenced by arrow_is_tab(), Control(), and use_arrow_as_tab().

const BINDING_MAP NDK_XX::Control::bindingMap [static, protected]
 

Definition at line 338 of file ndk++.h.

int NDK_XX::Control::ctrl_id [protected]
 

Definition at line 311 of file ndk++.h.

Referenced by Control(), get_binding(), get_ctrl_id(), process_message(), and set_ctrl_id().

int NDK_XX::Control::field_state [protected]
 

Definition at line 313 of file ndk++.h.

Referenced by Control(), get_state(), is_visible(), overwrite(), set_state(), and set_states().

int NDK_XX::Control::field_style [protected]
 

Definition at line 312 of file ndk++.h.

Referenced by Control(), get_style(), has_frame(), has_hscrollbar(), has_show_title(), has_vscrollbar(), is_editable(), is_enabled(), is_hidden(), is_hscroll_set(), is_moveable(), is_multisel(), notify_enabled(), set_style(), and set_styles().

Control* NDK_XX::Control::pParent [protected]
 

Definition at line 310 of file ndk++.h.

Referenced by NDK_XX::Tab::activate(), NDK_XX::Edit::add_or_insert_char(), Control(), NDK_XX::PropDlgPushButton::driver(), NDK_XX::Tab::driver(), NDK_XX::Edit::edit(), NDK_XX::EditDouble::EditDouble(), NDK_XX::ListBox::move_down(), NDK_XX::ListBox::move_up(), mvwin(), NDK_XX::OkCancelBox::OkCancelBox(), NDK_XX::ListBox::on_sel_change(), and NDK_XX::Label::set_text().


The documentation for this class was generated from the following files:
Generated on Thu Oct 10 16:02:13 2002 by doxygen1.2.17