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

NDK_XX::PropertyDialog Class Reference

#include <ndk++.h>

Inheritance diagram for NDK_XX::PropertyDialog:

NDK_XX::DialogBox NDK_XX::Control TabbedDlgBox List of all members.

Public Methods

 PropertyDialog (int id, const string &title, int lines, int cols, int y=0, int x=0)
 ~PropertyDialog ()
void add_page (PropertyPage *new_page)
 Insert a new page on this stack.

void set_selected_page (int page)
 Show the selected page.

int get_selected_page ()
bool valid_page_number (int page)
 Check if page number is valid.

PropertyPageget_page (int page)

Protected Methods

void on_dlg_init ()
 called at the beggining of the modal loop

void reorder_pages ()
void create_buttons ()
 called on construction of dialog

int get_next_tab_pos ()
virtual void on_page_modified (int page)
virtual void on_page_selected (int page)
virtual void on_apply ()
void on_focus_to_buttons ()
void on_return_to_page ()
virtual void cancel_to_close ()
 Once the user Apply, we can't cancel...

 DECLARE_BINDINGS ()

Protected Attributes

PushButton *& pBtnApply
int curr_page
ListOfPages pages

Constructor & Destructor Documentation

NDK_XX::PropertyDialog::PropertyDialog int    id,
const string &    title,
int    lines,
int    cols,
int    y = 0,
int    x = 0
 

PropertyDialog Constructor

Parameters:
id  a user defined const int identifying this window
lines:  height of the window
cols  width of the window
y  line where we are placed, absolute coord.
x  column where we are placed, absolute coord.

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

02253     : DialogBox(id,title,lines,cols,y,x,0,Control::title),pBtnApply(pBtnNo)
02254 {
02255 }

NDK_XX::PropertyDialog::~PropertyDialog  
 

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

02271 { 
02272 }


Member Function Documentation

void NDK_XX::PropertyDialog::add_page PropertyPage   new_page
 

Insert a new page on this stack.

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

References NDK_XX::DialogBox::add_child(), NDK_XX::Control::get_ctrl_id(), get_next_tab_pos(), NDK_XX::DialogBox::get_text(), pages, and NDK_XX::Tab::set_page().

Referenced by TabbedDlgBox::on_dlg_init().

02341 { 
02342     Tab *pTab =     new Tab(this,new_page->get_ctrl_id(),new_page->get_text(),0,get_next_tab_pos());
02343     pages.push_back(pTab);  
02344     pTab->set_page(new_page);
02345     add_child(pTab);
02346 }

void NDK_XX::PropertyDialog::cancel_to_close   [protected, virtual]
 

Once the user Apply, we can't cancel...

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

References NDK_XX::DialogBox::changed, NDK_XX::Control::enable(), pBtnApply, NDK_XX::DialogBox::pBtnCancel, NDK_XX::DialogBox::pBtnOk, and NDK_XX::PushButton::set_text().

02364 {
02365     changed = false;
02366     pBtnOk->enable(false);
02367     pBtnApply->enable(false);
02368     pBtnCancel->set_text(" Close ");
02369 }

void NDK_XX::PropertyDialog::create_buttons   [protected, virtual]
 

called on construction of dialog

Reimplemented from NDK_XX::DialogBox.

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

References NDK_XX::DialogBox::add_child(), NDK_XX::DialogBox::btn_w, NDK_XX::DialogBox::btns, NDK_XX::Control::enable(), NDK_XX::Control::framed, IDAPPLY, IDCANCEL, IDOK, NDK_XX::DialogBox::lblApply, NDK_XX::DialogBox::lblCancel, NDK_XX::DialogBox::lblOk, NDK_XX::DialogBox::my_w, pBtnApply, NDK_XX::DialogBox::pBtnCancel, NDK_XX::DialogBox::pBtnOk, NDK_XX::DialogBox::spc, NDK_XX::DialogBox::used_width, and NDK_XX::DialogBox::X_POS().

Referenced by on_dlg_init().

02285 {
02286     Label *pFrame = new Label(this,-1,"",3,width(),maxy()-2,0,framed);
02287     pFrame->enable(false);
02288     add_child(pFrame);
02289     my_w = width()-2;   ///useable width
02290     btn_w= 9;           ///each button width
02291     btns=3;             ///number of buttons
02292     used_width=btn_w*btns;  ///total buttons width          
02293     spc=2;              ///space between buttons
02294     pBtnOk=new PropDlgPushButton(this,IDOK,lblOk,maxy()-1,X_POS(0));
02295     pBtnOk->enable(false);
02296     add_child(pBtnOk);
02297     pBtnApply=new PropDlgPushButton(this,IDAPPLY,lblApply,maxy()-1,X_POS(1));
02298     pBtnApply->enable(false);
02299     add_child(pBtnApply);
02300     pBtnCancel=new PropDlgPushButton(this,IDCANCEL,lblCancel,maxy()-1,X_POS(2));
02301     add_child(pBtnCancel);
02302 }

NDK_XX::PropertyDialog::DECLARE_BINDINGS   [protected]
 

Reimplemented from NDK_XX::DialogBox.

int NDK_XX::PropertyDialog::get_next_tab_pos   [protected]
 

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

References pages.

Referenced by add_page().

02307 {
02308     int result = 0;
02309     ListOfPages::iterator it;
02310     for(it=pages.begin();it!=pages.end();it++){
02311         result += (*it)->width()-1;
02312     }
02313     if(result)
02314         result--;
02315         
02316     return result;
02317 
02318 }

PropertyPage * NDK_XX::PropertyDialog::get_page int    page
 

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

References pages, and valid_page_number().

02331 {
02332     if(valid_page_number(page))
02333         return pages[page]->get_page();
02334         
02335     throw Exception<PropertyDialog>(this,"Invalid page number!",-1);
02336 }

int NDK_XX::PropertyDialog::get_selected_page   [inline]
 

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

02035 {};

virtual void NDK_XX::PropertyDialog::on_apply   [inline, protected, virtual]
 

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

void NDK_XX::PropertyDialog::on_dlg_init   [protected, virtual]
 

called at the beggining of the modal loop

Reimplemented from NDK_XX::DialogBox.

Reimplemented in TabbedDlgBox.

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

References create_buttons(), NDK_XX::DialogBox::pBtnCancel, and NDK_XX::DialogBox::set_focus_to().

02277 {   
02278     create_buttons(); 
02279     set_focus_to(pBtnCancel);
02280 }

void NDK_XX::PropertyDialog::on_focus_to_buttons   [inline, protected]
 

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

virtual void NDK_XX::PropertyDialog::on_page_modified int    page [inline, protected, virtual]
 

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

02040                                   {};
02041 
02042 protected:

virtual void NDK_XX::PropertyDialog::on_page_selected int    page [inline, protected, virtual]
 

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

References NDK_XX::Application::param_file_name, and NDK_XX::Application::pStatusBar.

void NDK_XX::PropertyDialog::on_return_to_page   [inline, protected]
 

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

02061 {
02062     return  Application::get_application()->get_param(section_name,key_name,val);

void NDK_XX::PropertyDialog::reorder_pages   [protected]
 

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

References NDK_XX::Control::mvwin(), and pages.

02351 {
02352     int pos=0;
02353     ListOfPages::iterator it;
02354     for(it = pages.begin();it!=pages.end();it++){
02355         Tab *pTab = *it;
02356         pTab->mvwin(begy(),begx()+pos);
02357         pos += pTab->width()-1;
02358     }
02359 }

void NDK_XX::PropertyDialog::set_selected_page int    page
 

Show the selected page.

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

References pages, NDK_XX::DialogBox::set_focus_to(), and valid_page_number().

02323 {
02324     if(valid_page_number(page))
02325         set_focus_to(pages[page]);
02326 }

bool NDK_XX::PropertyDialog::valid_page_number int    page [inline]
 

Check if page number is valid.

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

Referenced by get_page(), and set_selected_page().

02035 {};


Member Data Documentation

int NDK_XX::PropertyDialog::curr_page [protected]
 

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

Referenced by NDK_XX::Tab::action(), and NDK_XX::PropertyPage::on_apply().

ListOfPages NDK_XX::PropertyDialog::pages [protected]
 

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

Referenced by NDK_XX::Tab::action(), add_page(), NDK_XX::PropertyPage::create_buttons(), get_next_tab_pos(), get_page(), TabbedDlgBox::on_dlg_init(), reorder_pages(), and set_selected_page().

PushButton*& NDK_XX::PropertyDialog::pBtnApply [protected]
 

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

Referenced by cancel_to_close(), and create_buttons().


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