uMenuItemSelection< T > Class Template Reference

#include <uMenu.h>

Inheritance diagram for uMenuItemSelection< T >:

Inheritance graph
[legend]
Collaboration diagram for uMenuItemSelection< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 uMenuItemSelection (uMenu *m, const tOutput &tit, const tOutput &help, T &targ)
 ~uMenuItemSelection ()
void Clear ()
void NewChoice (uSelectItem< T > *c)
void NewChoice (const tOutput &desc, const tOutput &help, T val)
virtual void LeftRight (int lr)
virtual void Render (REAL x, REAL y, REAL alpha=1, bool selected=0)
virtual tString Help ()

Protected Attributes

tList< uSelectItem< T > > choices
tOutput title
int select
T * target


Detailed Description

template<class T>
class uMenuItemSelection< T >

Definition at line 242 of file uMenu.h.


Constructor & Destructor Documentation

template<class T>
uMenuItemSelection< T >::uMenuItemSelection ( uMenu m,
const tOutput tit,
const tOutput help,
T &  targ 
) [inline]

Definition at line 256 of file uMenu.h.

00259             :uMenuItem(m,help),title(tit),select(0),target(&targ){}

template<class T>
uMenuItemSelection< T >::~uMenuItemSelection (  )  [inline]

Definition at line 261 of file uMenu.h.

00261                          {
00262         Clear();
00263     }


Member Function Documentation

template<class T>
void uMenuItemSelection< T >::Clear ( void   )  [inline]

Definition at line 265 of file uMenu.h.

Referenced by uMenuItemSelection< bool >::~uMenuItemSelection().

00265                 {
00266         for(int i=choices.Len()-1;i>=0;i--){
00267             uSelectItem<T> *x=choices(i);
00268             choices.Remove(x,x->idnum);
00269             delete x;
00270         }
00271         select=0;
00272     }

Here is the caller graph for this function:

template<class T>
void uMenuItemSelection< T >::NewChoice ( uSelectItem< T > *  c  )  [inline]

Reimplemented in uMenuItemToggle.

Definition at line 274 of file uMenu.h.

Referenced by ArmageTron_feature_menuitem::ArmageTron_feature_menuitem(), ArmageTron_texmode_menuitem::ArmageTron_texmode_menuitem(), gResMenEntry::gResMenEntry(), gGameSettings::Menu(), uMenuItemSelection< bool >::NewChoice(), PasswordCallback(), sg_LanguageMenu(), sg_PlayerMenu(), uMenuItemToggle::uMenuItemToggle(), and uSelectEntry< Vote >::uSelectEntry().

00274                                      {
00275         choices.Add(c,c->idnum);
00276     }

Here is the caller graph for this function:

template<class T>
void uMenuItemSelection< T >::NewChoice ( const tOutput desc,
const tOutput help,
val 
) [inline]

Definition at line 278 of file uMenu.h.

00278                                                                  {
00279         uSelectItem<T> *x=new uSelectItem<T>(desc,help,val);
00280         NewChoice(x);
00281     }

template<class T>
virtual void uMenuItemSelection< T >::LeftRight ( int  lr  )  [inline, virtual]

Reimplemented from uMenuItem.

Reimplemented in uMenuItemToggle.

Definition at line 283 of file uMenu.h.

00283                                   {
00284         select+=lr;
00285         if(select>=choices.Len())
00286             select=choices.Len()-1;
00287         if(select<0)
00288             select=0;
00289         if (choices.Len())
00290             *target=choices(select)->value;
00291     }

template<class T>
virtual void uMenuItemSelection< T >::Render ( REAL  x,
REAL  y,
REAL  alpha = 1,
bool  selected = 0 
) [inline, virtual]

Reimplemented from uMenuItem.

Definition at line 293 of file uMenu.h.

00293                                                                    {
00294         for(int i=choices.Len()-1;i>=0;i--)
00295             if (choices(i)->value==*target)
00296                 select=i;
00297 
00298         DisplayText(REAL(x-.02),y,title,selected,alpha,1);
00299         if (choices.Len()>0)
00300             DisplayText(REAL(x+.02),y,choices(select)->description,selected,alpha,-1);
00301     }

template<class T>
virtual tString uMenuItemSelection< T >::Help (  )  [inline, virtual]

Reimplemented from uMenuItem.

Definition at line 303 of file uMenu.h.

00303                           {
00304         tString ret;
00305         ret << helpText;
00306         ret << "\n";
00307         ret << choices(select)->helpText;
00308         return ret;
00309     }


Member Data Documentation

template<class T>
tList<uSelectItem<T> > uMenuItemSelection< T >::choices [protected]

Definition at line 244 of file uMenu.h.

Referenced by uMenuItemSelection< bool >::Clear(), uMenuItemSelection< bool >::Help(), uMenuItemSelection< bool >::LeftRight(), uMenuItemSelection< bool >::NewChoice(), and uMenuItemSelection< bool >::Render().

template<class T>
tOutput uMenuItemSelection< T >::title [protected]

Definition at line 245 of file uMenu.h.

Referenced by uMenuItemSelection< bool >::Render(), eVoteItem::UpdateMenuItem(), and eVoteItem::~eVoteItem().

template<class T>
int uMenuItemSelection< T >::select [protected]

Definition at line 246 of file uMenu.h.

Referenced by uMenuItemSelection< bool >::Clear(), uMenuItemSelection< bool >::Help(), uMenuItemSelection< bool >::LeftRight(), and uMenuItemSelection< bool >::Render().

template<class T>
T* uMenuItemSelection< T >::target [protected]

Definition at line 247 of file uMenu.h.

Referenced by uMenuItemSelection< bool >::LeftRight(), and uMenuItemSelection< bool >::Render().


The documentation for this class was generated from the following file:
Generated on Sun Mar 16 00:01:14 2008 for Armagetron Advanced by  doxygen 1.5.4