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

Public Methods | |
| MenuItem (Control *parent, int id, const string &title,int lines, int cols, int y, int x,int style=tabstop|notify) | |
| MenuItem (Control *parent, int id, const string &title,int y, int x) | |
| int | driver (int key) |
Public Attributes | |
| MenuItemData * | pData |
|
||||||||||||||||||||||||||||||||||||
|
MenuItem Constructor See parameters for class Control Definition at line 1576 of file ndk++.cc. References NDK_XX::Control::enable_notify(), NDK_XX::ListItem::set_text(), and NDK_XX::Label::text.
01580 :ListItem(parent,id,title,lines,cols,y,x,style) 01581 { 01582 enable_notify(false); 01583 set_text(text); 01584 enable_notify(); 01585 } |
|
||||||||||||||||||||||||
|
MenuItem Constructor See parameters for class Control Definition at line 1589 of file ndk++.cc. References NDK_XX::Control::enable_notify(), NDK_XX::ListItem::set_text(), and NDK_XX::Label::text.
01592 :ListItem(parent,id,title,1,title.size()+4,y,x,tabstop|notify) 01593 { 01594 enable_notify(false); 01595 set_text(text); 01596 enable_notify(); 01597 } |
|
|
get a chance at processing the key, before parent does Reimplemented from NDK_XX::ListItem. Definition at line 1601 of file ndk++.cc. References NDK_XX::MenuItemData::action(), KEY_ENTER, and pData. Referenced by NDK_XX::MenuBar::execute_current_item().
01602 {
01603 int result =false;
01604 switch(key){
01605 case KEY_ENTER:
01606 result = pData->action();
01607 break;
01608 #ifdef NCURSES_MOUSE_VERSION
01609 case KEY_MOUSE:
01610 {
01611 MEVENT event;
01612 getmouse(&event);
01613 if ((event.bstate & (BUTTON1_CLICKED|BUTTON1_DOUBLE_CLICKED|BUTTON1_TRIPLE_CLICKED))
01614 && wenclose(w,event.y, event.x))
01615 { // we react only if the click was in the userwin, that means
01616 // inside the menu display area or at the decoration window.
01617 result = pData->action();
01618 }
01619 break;
01620 }
01621 #endif /* NCURSES_MOUSE_VERSION */
01622 default:
01623 result = false;
01624 break;
01625 }
01626 return result;
01627 }
|
|
|
Definition at line 1040 of file ndk++.h. Referenced by driver(). |
1.2.17