00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(AFX_GLMENUENTRY_H__5AE3319D_D83E_4392_BABB_7E34B2D69BD8__INCLUDED_)
00022 #define AFX_GLMENUENTRY_H__5AE3319D_D83E_4392_BABB_7E34B2D69BD8__INCLUDED_
00023
00024 #include <GLEXT/GLMenu.h>
00025 #include <GLW/GLWSelector.h>
00026
00027 class GLTexture;
00028 class Image;
00029 class GLMenuEntry : public GLWSelectorI, public ToolTipI
00030 {
00031 public:
00032 GLMenuEntry(
00033 const LangString &menuName,
00034 char *menuNameInternal,
00035 const LangString &menuDescription,
00036 float width,
00037 unsigned int state,
00038 GLMenuI *callback,
00039 Image *icon,
00040 unsigned int flags);
00041 virtual ~GLMenuEntry();
00042
00043 bool click(float currentTop, int x, int y);
00044 bool inMenu(float currentTop, int x, int y);
00045 unsigned int getState() { return state_; }
00046 void draw(float currentTop, float currentLeft);
00047
00048 void addMenuItem(GLMenuItem &item);
00049 float getX() { return left_; }
00050 float getY() { return top_; }
00051 float getW() { return width_; }
00052 float getH() { return height_; }
00053 bool getSelected() { return selected_; }
00054 LangString &getName() { return menuName_; }
00055 const char *getNameInternal() { return menuNameInternal_.c_str(); }
00056 GLMenuI *getCallback() { return callback_; }
00057 ToolTip &getToolTip() { return toolTip_; }
00058 unsigned int getFlags() { return flags_; }
00059
00060 virtual void itemSelected(GLWSelectorEntry *entry, int position);
00061 virtual void noItemSelected();
00062
00063 virtual void populateCalled(unsigned int id);
00064
00065 protected:
00066 bool selected_;
00067 float left_, top_;
00068 float width_, height_;
00069 unsigned int state_;
00070 unsigned int flags_;
00071 GLMenuI *callback_;
00072 GLTexture *texture_;
00073 ToolTip toolTip_;
00074 Image *icon_;
00075 std::list<GLMenuItem> menuItems_;
00076 LangString menuName_, menuDescription_;
00077 std::string menuNameInternal_;
00078
00079 void drawText();
00080 void drawIcon();
00081
00082 };
00083
00084 #endif // !defined(AFX_GLMENUENTRY_H__5AE3319D_D83E_4392_BABB_7E34B2D69BD8__INCLUDED_)