#include <ndk++.h>
Inheritance diagram for NDK_XX::Button:
Public Methods | |
Button (Control *parent, int id, const string &title,int lines, int cols, int y, int x,int style=tabstop|notify) | |
void | activate () |
Draw as active (i.e.,with bold frame). | |
void | deactivate () |
Draw as inactive (i.e.,with normal frame). | |
virtual int | action ()=0 |
action fired when user presses Enter | |
void | set_default (bool t_or_f=true) |
Set this button as the default choice. | |
bool | is_default () const |
Protected Methods | |
int | driver (int key) |
Protected Attributes | |
bool | default_choice |
|
Button Constructor See parameters for class Control Definition at line 337 of file ndk++.cc.
|
|
action fired when user presses Enter
Implemented in NDK_XX::PushButton, NDK_XX::ListItem, and NDK_XX::Tab. Referenced by driver(). |
|
Draw as active (i.e.,with bold frame).
Reimplemented from NDK_XX::Label. Reimplemented in NDK_XX::Tab. Definition at line 378 of file ndk++.cc. References NDK_XX::Label::set_text(), and NDK_XX::Label::text. Referenced by NDK_XX::ListBox::activate_item().
|
|
Draw as inactive (i.e.,with normal frame).
Reimplemented from NDK_XX::Label. Reimplemented in NDK_XX::Tab. Definition at line 389 of file ndk++.cc. References NDK_XX::Label::set_text(), and NDK_XX::Label::text. Referenced by NDK_XX::ListBox::deactivate_item().
|
|
get a chance at processing the key, before parent does Reimplemented from NDK_XX::Control. Reimplemented in NDK_XX::PropDlgPushButton, NDK_XX::ListItem, NDK_XX::MenuItem, and NDK_XX::Tab. Definition at line 347 of file ndk++.cc. References action(), NDK_XX::Control::clicked_inside(), and KEY_ENTER.
00348 { 00349 int result= FALSE; 00350 switch(key) { 00351 case KEY_ENTER: result = action(); break; 00352 #ifdef NCURSES_MOUSE_VERSION 00353 case KEY_MOUSE: 00354 { 00355 MEVENT event; 00356 getmouse(&event); 00357 int ry = event.y, rx = event.x; /* screen coordinates */ 00358 if (mouse_trafo(&ry,&rx,FALSE)){ 00359 if((event.bstate & ( BUTTON1_CLICKED| 00360 BUTTON1_DOUBLE_CLICKED| 00361 BUTTON1_TRIPLE_CLICKED)) 00362 && clicked_inside(ry, rx)){ 00363 // we react only if the click was in the userwin, that means 00364 // inside the menu display area or at the decoration window. 00365 result=action(); 00366 } 00367 } 00368 break; 00369 } 00370 #endif 00371 default: result = Label::driver(key); break; 00372 } 00373 return result; 00374 } |
|
Definition at line 694 of file ndk++.h. References NDK_XX::ListItemData::ctrl_id, NDK_XX::ListItemData::field_state, NDK_XX::ListItemData::field_style, NDK_XX::ListItemData::text, and NDK_XX::ListItemData::user_data. Referenced by NDK_XX::ListItemData::operator=().
00696 :text(txt),ctrl_id(id),field_style(style) |
|
Set this button as the default choice.
Definition at line 693 of file ndk++.h. Referenced by NDK_XX::ListItem::operator=(). |
|
Definition at line 698 of file ndk++.h. Referenced by NDK_XX::Edit::refresh_text(). |