#include <ndk++.h>
Inheritance diagram for NDK_XX::ListItem:
Public Methods | |
ListItem (Control *parent, int id, const string &title,int lines, int cols, int y, int x, int style=tabstop|notify) | |
void | set_text (const string &txt) |
Usualy, a control in a dialog has some kind of text on it... | |
void | set_check (bool new_state=true) |
set/unset check mark | |
bool | is_checked () const |
is this item selected? | |
void | set_user_data (void *data) |
void * | get_user_data () const |
ListItem & | operator= (const ListItemData &lha) |
Protected Methods | |
int | driver (int key) |
virtual void | show_state (bool ref=false) |
specialized on children | |
void | refresh_text () |
Update the text we present on the viewport. | |
virtual int | state_size () const |
specialized on children | |
int | action () |
Hidden from public use. | |
Protected Attributes | |
void * | user_data |
Friends | |
class | ListBox |
|
ListItem Constructor See parameters for class Control Definition at line 495 of file ndk++.cc.
|
|
Hidden from public use.
Implements NDK_XX::Button. Definition at line 914 of file ndk++.h.
00918 : public ListItem |
|
get a chance at processing the key, before parent does Reimplemented from NDK_XX::Button. Reimplemented in NDK_XX::MenuItem. Definition at line 505 of file ndk++.cc. References is_checked(), and set_check(). Referenced by NDK_XX::ListBox::driver().
00506 { 00507 int result= FALSE; 00508 switch(key) { 00509 case ' ': 00510 set_check(!is_checked()); 00511 result=TRUE; 00512 break; 00513 #ifdef NCURSES_MOUSE_VERSION 00514 case KEY_MOUSE: 00515 { 00516 MEVENT event; 00517 getmouse(&event); 00518 if ((event.bstate & (BUTTON1_CLICKED|BUTTON1_DOUBLE_CLICKED|BUTTON1_TRIPLE_CLICKED)) 00519 && wenclose(w,event.y, event.x)) 00520 { // we react only if the click was in the userwin, that means 00521 // inside the menu display area or at the decoration window. 00522 set_check(!is_checked()); 00523 result=TRUE; 00524 } 00525 } 00526 #endif /* NCURSES_MOUSE_VERSION */ 00527 default: 00528 break; 00529 } 00530 return result; 00531 } |
|
Definition at line 885 of file ndk++.h.
00885 {return 3;};
|
|
is this item selected?
Definition at line 882 of file ndk++.h. Referenced by driver().
00885 {return 3;};
|
|
Definition at line 546 of file ndk++.cc. References NDK_XX::ListItemData::get_ctrl_id(), NDK_XX::ListItemData::get_state(), NDK_XX::ListItemData::get_style(), NDK_XX::ListItemData::get_text(), NDK_XX::ListItemData::get_user_data(), NDK_XX::ListItemData::is_default(), NDK_XX::Control::set_ctrl_id(), NDK_XX::Button::set_default(), NDK_XX::Control::set_states(), NDK_XX::Control::set_styles(), set_text(), set_user_data(), NDK_XX::Control::states, and NDK_XX::Control::styles.
00547 { 00548 set_text(rha.get_text()); 00549 set_ctrl_id(rha.get_ctrl_id()); 00550 set_styles(styles(rha.get_style())); 00551 set_states(states(rha.get_state())); 00552 set_default(rha.is_default()); 00553 set_user_data(rha.get_user_data()); 00554 return *this; 00555 } |
|
Update the text we present on the viewport.
Reimplemented from NDK_XX::Label. Definition at line 904 of file ndk++.h. Referenced by set_text().
00904 { 00905 } 00906 00907 protected: 00908 friend class MenuItem; |
|
set/unset check mark
Definition at line 873 of file ndk++.h. References NDK_XX::Label::text. Referenced by driver(), NDK_XX::ListBox::move_down(), NDK_XX::ListBox::move_up(), and NDK_XX::ListBox::set_cur_sel().
00875 : 00876 00877 void show_state(bool ref=false){ 00878 if(!text.empty()){ 00879 if(is_checked()) addstr(0,0, "[x]"); else addstr(0,0, "[ ]"); |
|
Usualy, a control in a dialog has some kind of text on it...
Reimplemented from NDK_XX::Label. Definition at line 535 of file ndk++.cc. References refresh_text(), and NDK_XX::Label::text. Referenced by NDK_XX::CheckButton::CheckButton(), NDK_XX::MenuItem::MenuItem(), operator=(), and NDK_XX::RadioButton::RadioButton().
00536 { 00537 string new_text= v; //.substr(0,width()); 00538 text = new_text; 00539 refresh_text(); 00540 move(0,0); 00541 refresh(); 00542 } |
|
Definition at line 884 of file ndk++.h. Referenced by operator=().
00885 {return 3;};
|
|
specialized on children
Reimplemented in NDK_XX::RadioButton, and NDK_XX::CheckButton. Definition at line 895 of file ndk++.h. References NDK_XX::MenuItemData::pMenuItem.
00895 : 00896 /** 00897 MenuItemData Constructor 00898 See parameters for class ListItemData 00899 */ 00900 MenuItemData(const string &txt,int id=-1 00901 ,int style=Control::tabstop|Control::notify 00902 ,int state=0,void *data=0) :ListItemData(txt,id,style,state,data),pMenuItem(0) |
|
specialized on children
Reimplemented in NDK_XX::RadioButton, and NDK_XX::CheckButton. Definition at line 911 of file ndk++.h. References NDK_XX::MenuItemData::pMenuItem.
00918 : public ListItem |
|
|
|
|