#include <ndk++.h>
Inheritance diagram for NDK_XX::Tab:

Public Methods | |
| Tab (Control *parent, int id, const string &title,int lines, int cols, int y, int x,int style=tabstop|notify|framed) | |
| Tab (Control *parent, int id, const string &title,int y, int x) | |
| ~Tab () | |
| int | driver (int key) |
| int | action () |
| action fired when user presses Enter | |
| void | activate () |
| Draw as active (i.e.,with bold frame). | |
| void | deactivate () |
| Draw as inactive (i.e.,with normal frame). | |
| void | show () |
| call panel's show and set our state accordingly | |
| void | hide () |
| call panel's hide and set our state accordingly | |
| PropertyPage * | get_page () |
| Get the page associated with this tab. | |
| void | set_page (PropertyPage *page) |
| Set the page associated with this tab. | |
| void | set_text (const string &txt) |
| Usualy, a control in a dialog has some kind of text on it... | |
Protected Attributes | |
| PropertyPage * | pPage |
| The stacked dialog we manage. | |
|
||||||||||||||||||||||||||||||||||||
|
Tab Constructor See parameters for class Control Definition at line 2376 of file ndk++.cc. References NDK_XX::Control::enable_notify(), set_text(), and NDK_XX::Label::text.
02380 :Button(parent,id, title,lines,cols,y,x,style|=framed) 02381 ,pPage(0) 02382 { 02383 enable_notify(false); 02384 set_text(text); 02385 enable_notify(); 02386 } |
|
||||||||||||||||||||||||
|
Tab Constructor See parameters for class Control Definition at line 2390 of file ndk++.cc. References NDK_XX::Control::enable_notify(), set_text(), and NDK_XX::Label::text.
|
|
|
Definition at line 2403 of file ndk++.cc. References pPage.
02404 {
02405 delete pPage;
02406 }
|
|
|
action fired when user presses Enter
Implements NDK_XX::Button. Definition at line 1957 of file ndk++.h. References NDK_XX::PropertyDialog::curr_page, and NDK_XX::PropertyDialog::pages.
01973 : public Label |
|
|
Draw as active (i.e.,with bold frame).
Reimplemented from NDK_XX::Button. Definition at line 2410 of file ndk++.cc. References NDK_XX::Control::activate(), NDK_XX::Control::get_ctrl_id(), NDK_XX::Control::is_hidden(), NDK_XX::Control::notify_enabled(), PAGE_SELECTED, pPage, NDK_XX::Control::pParent, NDK_XX::Control::process_message(), NDK_XX::PropertyPage::refresh(), set_text(), and NDK_XX::Label::text. Referenced by driver().
02411 {
02412 if(is_hidden())
02413 return;
02414
02415 if(pPage){
02416 pPage->activate();
02417 pPage->refresh();
02418 }
02419 Control::activate();
02420 attron(A_BOLD);
02421 set_text(text);
02422 if(notify_enabled())
02423 process_message(pParent,PAGE_SELECTED,get_ctrl_id(),this);
02424 }
|
|
|
Draw as inactive (i.e.,with normal frame).
Reimplemented from NDK_XX::Button. Definition at line 2428 of file ndk++.cc. References NDK_XX::Control::deactivate(), NDK_XX::Control::is_hidden(), pPage, set_text(), and NDK_XX::Label::text.
|
|
|
get a chance at processing the key, before parent does Reimplemented from NDK_XX::Button. Definition at line 2458 of file ndk++.cc. References activate(), NDK_XX::Control::clicked_inside(), FOCUS_TO_BUTTONS, KEY_ENTER, KEY_ESC, pPage, NDK_XX::Control::pParent, NDK_XX::PropertyPage::process_key(), and NDK_XX::Control::process_message().
02459 { int val=0;
02460 switch(key) {
02461 #ifdef NCURSES_MOUSE_VERSION
02462 case KEY_MOUSE:
02463 {
02464 MEVENT event;
02465 getmouse(&event);
02466 int ry = event.y, rx = event.x; /* screen coordinates */
02467 if (!mouse_trafo(&ry,&rx,FALSE))
02468 return false;
02469 if(!(event.bstate & ( BUTTON1_CLICKED|
02470 BUTTON1_DOUBLE_CLICKED|
02471 BUTTON1_TRIPLE_CLICKED))
02472 ||!pPage->clicked_inside(ry, rx)){
02473 return false;
02474 }
02475 }
02476 #endif /// if we got here, passthru
02477 case KEY_TAB:
02478 case KEY_DOWN:
02479 case KEY_ENTER:
02480 val = pPage->process_key(key);
02481 if(val == DialogBox::REQ_DLG_DOWN){
02482 process_message(pParent,0,(int)FOCUS_TO_BUTTONS,0);
02483 return TRUE;
02484 }
02485 else if(val== DialogBox::REQ_DLG_EXIT) //user pressed ESC key inside the page
02486 return KEY_ESC;
02487 else if(key==KEY_MOUSE)
02488 return key;
02489 else
02490 activate();
02491 break;
02492 default:
02493 return Button::driver(key);
02494 break;
02495 }
02496 return FALSE;
02497 }
|
|
|
Get the page associated with this tab.
Definition at line 1979 of file ndk++.h.
01979 {
|
|
|
call panel's hide and set our state accordingly
Reimplemented from NDK_XX::Control. Definition at line 1971 of file ndk++.h. References NDK_XX::Label::Label(), NDK_XX::StatusBar::StatusBar(), NDK_XX::Label::text, and NDK_XX::Control::visible.
01973 : public Label 01974 { 01975 public: 01976 |
|
|
Set the page associated with this tab.
Definition at line 1981 of file ndk++.h. Referenced by NDK_XX::PropertyDialog::add_page().
01989 : public NCursesApplication
|
|
|
Usualy, a control in a dialog has some kind of text on it...
Reimplemented from NDK_XX::Label. Definition at line 2442 of file ndk++.cc. References NDK_XX::Control::has_frame(), NDK_XX::Label::max_len(), NDK_XX::Label::pos_x, and NDK_XX::Label::text. Referenced by activate(), deactivate(), and Tab().
|
|
|
call panel's show and set our state accordingly
Reimplemented from NDK_XX::Control. Definition at line 1963 of file ndk++.h.
01973 : public Label |
|
|
The stacked dialog we manage.
Definition at line 1987 of file ndk++.h. Referenced by activate(), deactivate(), driver(), NDK_XX::PropertyPage::PropertyPage(), NDK_XX::PropertyPage::refresh(), NDK_XX::PropertyPage::~PropertyPage(), and ~Tab(). |
1.2.17