GLMenuEntry Class Reference

#include <GLMenuEntry.h>

Inheritance diagram for GLMenuEntry:

GLWSelectorI ToolTipI

List of all members.

Public Member Functions

 GLMenuEntry (const LangString &menuName, char *menuNameInternal, const LangString &menuDescription, float width, unsigned int state, GLMenuI *callback, Image *icon, unsigned int flags)
virtual ~GLMenuEntry ()
bool click (float currentTop, int x, int y)
bool inMenu (float currentTop, int x, int y)
unsigned int getState ()
void draw (float currentTop, float currentLeft)
void addMenuItem (GLMenuItem &item)
float getX ()
float getY ()
float getW ()
float getH ()
bool getSelected ()
LangStringgetName ()
const char * getNameInternal ()
GLMenuIgetCallback ()
ToolTipgetToolTip ()
unsigned int getFlags ()
virtual void itemSelected (GLWSelectorEntry *entry, int position)
virtual void noItemSelected ()
virtual void populateCalled (unsigned int id)

Protected Member Functions

void drawText ()
void drawIcon ()

Protected Attributes

bool selected_
float left_
float top_
float width_
float height_
unsigned int state_
unsigned int flags_
GLMenuIcallback_
GLTexturetexture_
ToolTip toolTip_
Imageicon_
std::list< GLMenuItemmenuItems_
LangString menuName_
LangString menuDescription_
std::string menuNameInternal_


Detailed Description

Definition at line 29 of file GLMenuEntry.h.


Constructor & Destructor Documentation

GLMenuEntry::GLMenuEntry ( const LangString menuName,
char *  menuNameInternal,
const LangString menuDescription,
float  width,
unsigned int  state,
GLMenuI callback,
Image icon,
unsigned int  flags 
)

Definition at line 34 of file GLMenuEntry.cpp.

References ToolTip::setHandler(), and toolTip_.

GLMenuEntry::~GLMenuEntry (  )  [virtual]

Definition at line 54 of file GLMenuEntry.cpp.

References icon_, and texture_.


Member Function Documentation

bool GLMenuEntry::click ( float  currentTop,
int  x,
int  y 
)

Definition at line 151 of file GLMenuEntry.cpp.

References callback_, GLMenuI::getMenuItems(), GLMenuItem::getSelected(), GLMenuItem::getSeperator(), GLMenuItem::getText(), GLMenuItem::getTexture(), GLMenuItem::getToolTip(), GLMenuItem::getUserData(), icon_, GLWSelector::instance(), left_, menuItemHeight, menuItems_, menuNameInternal_, GLMenuI::menuOpened(), selected_, GLWSelector::showSelector(), state_, and width_.

Referenced by GLMenu::mouseDown().

bool GLMenuEntry::inMenu ( float  currentTop,
int  x,
int  y 
)

Definition at line 139 of file GLMenuEntry.cpp.

References icon_, left_, menuItemHeight, and width_.

Referenced by GLMenu::draw().

unsigned int GLMenuEntry::getState (  )  [inline]

Definition at line 45 of file GLMenuEntry.h.

References state_.

Referenced by GLMenu::draw(), and GLMenu::mouseDown().

void GLMenuEntry::draw ( float  currentTop,
float  currentLeft 
)

Definition at line 60 of file GLMenuEntry.cpp.

References drawIcon(), drawText(), height_, icon_, left_, and top_.

Referenced by GLMenu::draw(), and drawText().

void GLMenuEntry::addMenuItem ( GLMenuItem item  ) 

Definition at line 201 of file GLMenuEntry.cpp.

References menuItems_.

Referenced by GLMenu::addMenuItem().

float GLMenuEntry::getX (  )  [inline]

Definition at line 49 of file GLMenuEntry.h.

References left_.

Referenced by GLMenu::draw(), and TutorialDialog::processMenu().

float GLMenuEntry::getY (  )  [inline]

Definition at line 50 of file GLMenuEntry.h.

References top_.

Referenced by GLMenu::draw(), and TutorialDialog::processMenu().

float GLMenuEntry::getW (  )  [inline]

Definition at line 51 of file GLMenuEntry.h.

References width_.

Referenced by GLMenu::draw(), and TutorialDialog::processMenu().

float GLMenuEntry::getH (  )  [inline]

Definition at line 52 of file GLMenuEntry.h.

References height_.

Referenced by TutorialDialog::processMenu().

bool GLMenuEntry::getSelected (  )  [inline]

Definition at line 53 of file GLMenuEntry.h.

References selected_.

Referenced by GLMenu::draw().

LangString& GLMenuEntry::getName (  )  [inline]

Definition at line 54 of file GLMenuEntry.h.

References menuName_.

const char* GLMenuEntry::getNameInternal (  )  [inline]

Definition at line 55 of file GLMenuEntry.h.

References menuNameInternal_.

Referenced by GLMenu::draw().

GLMenuI* GLMenuEntry::getCallback (  )  [inline]

Definition at line 56 of file GLMenuEntry.h.

References callback_.

Referenced by GLMenu::draw().

ToolTip& GLMenuEntry::getToolTip (  )  [inline]

Definition at line 57 of file GLMenuEntry.h.

References toolTip_.

Referenced by GLMenu::draw().

unsigned int GLMenuEntry::getFlags (  )  [inline]

Definition at line 58 of file GLMenuEntry.h.

References flags_.

Referenced by GLMenu::draw().

void GLMenuEntry::itemSelected ( GLWSelectorEntry entry,
int  position 
) [virtual]

Implements GLWSelectorI.

Definition at line 211 of file GLMenuEntry.cpp.

References callback_, LANG_RESOURCE, menuItems_, menuNameInternal_, GLMenuI::menuSelection(), and selected_.

void GLMenuEntry::noItemSelected (  )  [virtual]

Reimplemented from GLWSelectorI.

Definition at line 206 of file GLMenuEntry.cpp.

References selected_.

void GLMenuEntry::populateCalled ( unsigned int  id  )  [virtual]

Implements ToolTipI.

Definition at line 231 of file GLMenuEntry.cpp.

References callback_, GLMenuI::getMenuToolTip(), menuName_, menuNameInternal_, ToolTip::setText(), toolTip_, and ToolTip::ToolTipHelp.

void GLMenuEntry::drawText (  )  [protected]

Definition at line 101 of file GLMenuEntry.cpp.

References GLState::BLEND_ON, callback_, draw(), GLWidget::drawRoundBox(), GLWFont::getGameFont(), GLMenuI::getMenuText(), GL_LINE_LOOP, GL_TRIANGLE_FAN, glBegin(), glColor4f(), glEnd(), glLineWidth(), glVertex2f(), height_, GLWFont::instance(), itemcolor, left_, menuItemHeight, menuName_, menuNameInternal_, selected_, top_, and width_.

Referenced by draw().

void GLMenuEntry::drawIcon (  )  [protected]

Definition at line 76 of file GLMenuEntry.cpp.

References GLState::BLEND_ON, GLTexture::create(), GLState::DEPTH_OFF, GLTexture::draw(), GL_QUADS, glBegin(), glColor4f(), glEnd(), glTexCoord2f(), glVertex2f(), height_, icon_, left_, selected_, texture_, GLState::TEXTURE_ON, and top_.

Referenced by draw().


Member Data Documentation

bool GLMenuEntry::selected_ [protected]

Definition at line 66 of file GLMenuEntry.h.

Referenced by click(), drawIcon(), drawText(), getSelected(), itemSelected(), and noItemSelected().

float GLMenuEntry::left_ [protected]

Definition at line 67 of file GLMenuEntry.h.

Referenced by click(), draw(), drawIcon(), drawText(), getX(), and inMenu().

float GLMenuEntry::top_ [protected]

Definition at line 67 of file GLMenuEntry.h.

Referenced by draw(), drawIcon(), drawText(), and getY().

float GLMenuEntry::width_ [protected]

Definition at line 68 of file GLMenuEntry.h.

Referenced by click(), drawText(), getW(), and inMenu().

float GLMenuEntry::height_ [protected]

Definition at line 68 of file GLMenuEntry.h.

Referenced by draw(), drawIcon(), drawText(), and getH().

unsigned int GLMenuEntry::state_ [protected]

Definition at line 69 of file GLMenuEntry.h.

Referenced by click(), and getState().

unsigned int GLMenuEntry::flags_ [protected]

Definition at line 70 of file GLMenuEntry.h.

Referenced by getFlags().

GLMenuI* GLMenuEntry::callback_ [protected]

Definition at line 71 of file GLMenuEntry.h.

Referenced by click(), drawText(), getCallback(), itemSelected(), and populateCalled().

GLTexture* GLMenuEntry::texture_ [protected]

Definition at line 72 of file GLMenuEntry.h.

Referenced by drawIcon(), and ~GLMenuEntry().

ToolTip GLMenuEntry::toolTip_ [protected]

Definition at line 73 of file GLMenuEntry.h.

Referenced by getToolTip(), GLMenuEntry(), and populateCalled().

Image* GLMenuEntry::icon_ [protected]

Definition at line 74 of file GLMenuEntry.h.

Referenced by click(), draw(), drawIcon(), inMenu(), and ~GLMenuEntry().

std::list<GLMenuItem> GLMenuEntry::menuItems_ [protected]

Definition at line 75 of file GLMenuEntry.h.

Referenced by addMenuItem(), click(), and itemSelected().

LangString GLMenuEntry::menuName_ [protected]

Definition at line 76 of file GLMenuEntry.h.

Referenced by drawText(), getName(), and populateCalled().

LangString GLMenuEntry::menuDescription_ [protected]

Definition at line 76 of file GLMenuEntry.h.

std::string GLMenuEntry::menuNameInternal_ [protected]

Definition at line 77 of file GLMenuEntry.h.

Referenced by click(), drawText(), getNameInternal(), itemSelected(), and populateCalled().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:02 2009 for Scorched3D by  doxygen 1.5.3