#include <ndk++.h>
Inheritance diagram for NDK_XX::NDKPopUpMenu:
Public Methods | |
NDKPopUpMenu (const char *text=0) | |
~NDKPopUpMenu () | |
bool | action () |
short | submenux () const |
Autocalculated starting column for the submenu. | |
short | submenuy () const |
Autocalculated starting row for the submenu. | |
int | largest_name_len () const |
So we can know the right width for the submenu. | |
Protected Attributes | |
ListOfItems | items |
These are passed to the submenu... | |
string | sub_menu_label |
|
Definition at line 242 of file ndk++.h.
00242 : NDKMenuItem(text){ } |
|
Definition at line 176 of file ndk++.cc. References items.
|
|
Definition at line 187 of file ndk++.cc. References items, largest_name_len(), sub_menu_label, submenux(), and submenuy().
00187 { 00188 NDKSubMenu S(items.size()-1,largest_name_len() 00189 ,submenuy(),submenux(),items,sub_menu_label.c_str()); 00190 S(); 00191 return FALSE; 00192 } |
|
So we can know the right width for the submenu.
Definition at line 225 of file ndk++.cc. References NDK_XX::NDKMenuItem::get_curses_item(). Referenced by action().
00225 { 00226 unsigned MaximumNameLength = 0; 00227 ListOfItems::const_iterator it; 00228 for(it = items.begin(); it !=items.end();it++){ 00229 NDKMenuItem *pItem = dynamic_cast<NDKMenuItem *>(*it); 00230 ITEM *item = pItem->get_curses_item(); 00231 if (item && item->name.length > MaximumNameLength ){ 00232 MaximumNameLength = item->name.length; 00233 } 00234 } 00235 if(sub_menu_label.size() > MaximumNameLength) 00236 MaximumNameLength = sub_menu_label.size(); 00237 return MaximumNameLength; 00238 } |
|
Autocalculated starting column for the submenu.
Definition at line 196 of file ndk++.cc. References NDK_XX::NDKMenu::get_itemmarklen(), NDK_XX::NDKMenu::get_itemwidth(), NDK_XX::NDKMenuBar::get_orientation(), NDK_XX::NDKMenu::is_framed(), and NDK_XX::NDKMenuItem::pMenu. Referenced by action().
00196 { 00197 // default x position: right where the itemīs label is shown 00198 // (this works wether we have a normal curses menu 00199 // or a menu bar with h layout 00200 short x = pMenu->begx() 00201 + pMenu->get_itemmarklen() 00202 + pMenu->is_framed(); 00203 00204 NDKMenuBar *pParent = dynamic_cast<NDKMenuBar *>(pMenu); 00205 if(pParent && pParent->get_orientation() == 'h') 00206 x += (index() * pMenu->get_itemwidth()); 00207 00208 return x; 00209 } |
|
Autocalculated starting row for the submenu.
Definition at line 213 of file ndk++.cc. References NDK_XX::NDKMenuBar::get_orientation(). Referenced by action().
|
|
These are passed to the submenu...
Definition at line 258 of file ndk++.h. Referenced by action(), AnotherPopUpCmd::AnotherPopUpCmd(), APopUpCmd::APopUpCmd(), and ~NDKPopUpMenu(). |
|
Since submenu is autosized, we can pass longer (i.e. meaningful) labels to it... Definition at line 262 of file ndk++.h. Referenced by action(), AnotherPopUpCmd::AnotherPopUpCmd(), and APopUpCmd::APopUpCmd(). |