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

NDK_XX::PropertyPage Class Reference

#include <ndk++.h>

Inheritance diagram for NDK_XX::PropertyPage:

NDK_XX::DialogBox NDK_XX::Control TabbedDlgPage1 TabbedDlgPage2 List of all members.

Public Methods

 PropertyPage (PropertyDialog *parent, int id, const string &title,int lines, int cols, int y=0, int x=0)
 ~PropertyPage ()
int refresh ()

Protected Methods

int process_key (int key)
 Non-modal equivalent of do_modal().

int driver (int key)
void do_initial_update ()
 Non-modal wrapper for calling on_dlg_init from the constructor.

void on_dlg_init ()
 We redefine here so we get called on construction.

void on_cmd (int dlg_req)
 Kind of catch-all for derived windows.

virtual void on_page_change ()
 Called when some control change.

virtual void on_apply ()
 called by parent when user pushes the "Apply" button

void create_buttons ()
 called on construction of dialog


Protected Attributes

PropertyDialogpDialog

Friends

class Tab
class PropertyDialog

Constructor & Destructor Documentation

NDK_XX::PropertyPage::PropertyPage PropertyDialog   parent,
int    id,
const string &    title,
int    lines,
int    cols,
int    y = 0,
int    x = 0
[inline]
 

DialogBox Constructor

Parameters:
parent  the property dialog that owns us
id  a user defined const int identifying this window
title  The title for 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 1864 of file ndk++.h.

References NDK_XX::Tab::pPage.

01868                {
01869 //      send_to_log("hide en Tab")<< pPage->get_text()<< endl;
01870         if(is_visible())

NDK_XX::PropertyPage::~PropertyPage   [inline]
 

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

References NDK_XX::Tab::pPage.

01876 { return pPage;}


Member Function Documentation

void NDK_XX::PropertyPage::create_buttons   [inline, protected, virtual]
 

called on construction of dialog

Reimplemented from NDK_XX::DialogBox.

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

References NDK_XX::PropertyDialog::pages.

Referenced by TabbedDlgPage2::on_dlg_init().

01922                                     {return (page < pages.size() && page > -1);}
01923     

void NDK_XX::PropertyPage::do_initial_update   [inline, protected]
 

Non-modal wrapper for calling on_dlg_init from the constructor.

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

Referenced by NDK_XX::DialogBox::end_dialog(), TabbedDlgPage1::TabbedDlgPage1(), and TabbedDlgPage2::TabbedDlgPage2().

01897       :
01898     /**
01899         PropertyDialog Constructor
01900         @param id
01901             a user defined const int identifying this window
        @param lines:

int NDK_XX::PropertyPage::driver int    key [inline, protected, virtual]
 

get a chance at processing the key, before parent does

Reimplemented from NDK_XX::DialogBox.

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

Referenced by process_key().

01895 : public DialogBox 

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

called by parent when user pushes the "Apply" button

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

References NDK_XX::PropertyDialog::curr_page.

01919                            { return curr_page;}

void NDK_XX::PropertyPage::on_cmd int    key [protected, virtual]
 

Kind of catch-all for derived windows.

Reimplemented from NDK_XX::DialogBox.

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

References NDK_XX::DialogBox::bContinueModal, and NDK_XX::Control::clicked_inside().

Referenced by process_key().

02538 {
02539     switch(key) {
02540 #ifdef NCURSES_MOUSE_VERSION
02541         case KEY_MOUSE:
02542         {
02543             MEVENT  event;
02544             getmouse(&event);
02545             int ry = event.y, rx = event.x; /* screen coordinates */
02546             if (mouse_trafo(&ry,&rx,FALSE)){
02547                 if((event.bstate & (    BUTTON1_CLICKED|
02548                                     BUTTON1_DOUBLE_CLICKED|
02549                                     BUTTON1_TRIPLE_CLICKED))
02550                     && !clicked_inside(ry, rx)){
02551                     // we react only if the click was in the userwin, that means
02552                     // inside the menu display area or at the decoration window.
02553                     bContinueModal=false;
02554                 }
02555             }
02556             break;
02557         }
02558 #endif
02559         default:    break;
02560     }
02561 }

void NDK_XX::PropertyPage::on_dlg_init   [inline, protected, virtual]
 

We redefine here so we get called on construction.

Reimplemented from NDK_XX::DialogBox.

Reimplemented in TabbedDlgPage1, and TabbedDlgPage2.

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

01919                            { return curr_page;}

virtual void NDK_XX::PropertyPage::on_page_change   [inline, protected, virtual]
 

Called when some control change.

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

References NDK_XX::Control::title.

Referenced by TabbedDlgPage2::on_clear_list(), TabbedDlgPage2::on_remove(), and TabbedDlgPage2::on_sel_change().

01919                            { return curr_page;}

int NDK_XX::PropertyPage::process_key int    key [protected]
 

Non-modal equivalent of do_modal().

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

References NDK_XX::DialogBox::bContinueModal, driver(), NDK_XX::DialogBox::next_control(), on_cmd(), NDK_XX::DialogBox::prev_control(), refresh(), NDK_XX::DialogBox::REQ_DLG_DOWN, NDK_XX::DialogBox::REQ_DLG_EXIT, NDK_XX::DialogBox::REQ_DLG_LEFT, NDK_XX::DialogBox::REQ_DLG_NEXT, NDK_XX::DialogBox::REQ_DLG_PREV, NDK_XX::DialogBox::REQ_DLG_RIGHT, and NDK_XX::DialogBox::REQ_DLG_UP.

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

02505 {
02506     refresh();
02507     bContinueModal=true;
02508     int req=REQ_DLG_EXIT;
02509     do{
02510 #ifdef NCURSES_MOUSE_VERSION
02511         if(key == KEY_MOUSE){
02512             req=driver(key);
02513             key=0;
02514         }
02515         else
02516 #endif /* NCURSES_MOUSE_VERSION */
02517     
02518         req=driver(getch());
02519         switch(req){
02520             case REQ_DLG_EXIT:
02521             case REQ_DLG_UP:
02522             case REQ_DLG_DOWN:
02523                                 bContinueModal=false;break;
02524             case REQ_DLG_RIGHT: 
02525             case REQ_DLG_NEXT:  next_control(); break;
02526 
02527             case REQ_DLG_LEFT: 
02528             case REQ_DLG_PREV:  prev_control(); break;
02529             default:            on_cmd(req);    break;
02530         }   
02531     } while( bContinueModal);
02532     return req;
02533 }

int NDK_XX::PropertyPage::refresh   [inline]
 

Since we have the dialogs stacked and they are not modal, we need to do this manually

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

References NDK_XX::Tab::pPage.

Referenced by NDK_XX::Tab::activate(), and process_key().

01876                              { return pPage;}
01877     ///Set the page associated with this tab
01878     void set_page(PropertyPage *page){pPage = page;}
01879 
01880     void set_text(const string &txt);
01881     
01882 protected:
01883     ///The stacked dialog we manage


Friends And Related Function Documentation

friend class PropertyDialog [friend]
 

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

friend class Tab [friend]
 

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


Member Data Documentation

PropertyDialog* NDK_XX::PropertyPage::pDialog [protected]
 

Do nothing, otherwise OK shows up...

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

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


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