Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

NDK_XX::NDKMenuBar Class Reference

#include <ndk++.h>

Inheritance diagram for NDK_XX::NDKMenuBar:

NDK_XX::NDKMenu NDK_XX::NDKFramedMenuBar NDK_XX::NDKSubMenu List of all members.

Public Methods

 NDKMenuBar (int rows, int cols, int y, int x,ListOfItems &items,const char *ttitle="", const char *btitle="",const char *title_pos="cc",char orient='h', bool framed=false)
 ~NDKMenuBar ()
void setTitle ()
char get_orientation () const
 we are wide-oriented or tall-oriented?


Protected Methods

void show_text (const string &t, char where)
 A simple helper.


Protected Attributes

char orientation
string title
string bTitle
string titlePos
ListOfItemsitemList

Constructor & Destructor Documentation

NDK_XX::NDKMenuBar::NDKMenuBar int    rows,
int    cols,
int    y,
int    x,
ListOfItems   items,
const char *    ttitle = "",
const char *    btitle = "",
const char *    title_pos = "cc",
char    orient = 'h',
bool    framed = false
 

Definition at line 125 of file ndk++.cc.

References NDK_XX::NDKMenu::InitMenu(), NDK_XX::NDKMenu::link_items(), NDK_XX::ListOfItems, orientation, setTitle(), and titlePos.

00130     :   NDKMenu(rows, cols, y, x,framed)
00131         ,orientation(orient)
00132         ,title(ttitle),bTitle(btitle),titlePos(title_pos)
00133         ,itemList(items)
00134 {
00135     
00136     short count = items.size()-1;
00137     
00138     if(orientation=='v')  set_format(count,1);
00139     else set_format(1,count);
00140 
00141     InitMenu(items);
00142     
00143     link_items(items);
00144     
00145     if(framed)
00146         frame();
00147 
00148     //by default it's 2, but user may be clever enough to pass in "" ...
00149     while(titlePos.size()< 2)
00150         titlePos+='c';
00151 
00152     setTitle();
00153 }

NDK_XX::NDKMenuBar::~NDKMenuBar   [inline]
 

Definition at line 178 of file ndk++.h.

00178 { } 


Member Function Documentation

char NDK_XX::NDKMenuBar::get_orientation   const [inline]
 

we are wide-oriented or tall-oriented?

Definition at line 187 of file ndk++.h.

References orientation.

Referenced by NDK_XX::NDKPopUpMenu::submenux(), and NDK_XX::NDKPopUpMenu::submenuy().

00187 {return orientation;}

void NDK_XX::NDKMenuBar::setTitle   [inline]
 

Definition at line 181 of file ndk++.h.

References bTitle, show_text(), title, and titlePos.

Referenced by NDKMenuBar().

00181                    {
00182         show_text(title,titlePos[0]);
00183         show_text(bTitle,titlePos[1]);
00184     }

void NDK_XX::NDKMenuBar::show_text const string &    t,
char    where
[protected]
 

A simple helper.

Definition at line 112 of file ndk++.cc.

References NDK_XX::NDKMenu::lefttext(), and NDK_XX::NDKMenu::righttext().

Referenced by setTitle().

00112                                                     {
00113     if (!t.empty()){
00114         switch(where){
00115             case 'l': lefttext(0,t.c_str()); break;
00116             case 'c': centertext(0,t.c_str()); break;
00117             case 'r': righttext(0,t.c_str()); break;
00118             default: centertext(0,t.c_str()); break;
00119         }
00120     }
00121 }


Member Data Documentation

string NDK_XX::NDKMenuBar::bTitle [protected]
 

Definition at line 164 of file ndk++.h.

Referenced by setTitle().

ListOfItems& NDK_XX::NDKMenuBar::itemList [protected]
 

Definition at line 166 of file ndk++.h.

char NDK_XX::NDKMenuBar::orientation [protected]
 

Definition at line 162 of file ndk++.h.

Referenced by get_orientation(), and NDKMenuBar().

string NDK_XX::NDKMenuBar::title [protected]
 

Definition at line 163 of file ndk++.h.

Referenced by setTitle().

string NDK_XX::NDKMenuBar::titlePos [protected]
 

Definition at line 165 of file ndk++.h.

Referenced by NDKMenuBar(), and setTitle().


The documentation for this class was generated from the following files:
Generated on Tue Aug 27 10:49:47 2002 by doxygen1.2.17