menuComponent.h

Go to the documentation of this file.
00001 #ifndef MENU_COMPONENT_H
00002 #define MENU_COMPONENT_H
00003 
00013 #include "buttonComponent.h"
00014 #include "labelComponent.h"
00015 #include "focusComponentInterface.h"
00016 
00017 
00021 class MenuComponent : public FocusComponentInterface {
00022   VXV::Rect button_offset;
00023   VXV::Rect icon_offset;
00024   //std::vector<ButtonComponent*> buttons;
00025   class item_t {
00026   public:
00027     item_t(void);
00028     ~item_t(void);
00029     ButtonComponent* button;
00030     bool select_enable;
00031   };
00032   std::vector<item_t*> items;
00033   LabelComponent* icon;
00034   bool activated;
00035   bool draw_hide;
00036   bool ctrl_disable;
00037   bool initialized;
00038   bool decided;
00039   bool no_default;
00040   int now_index;
00041 
00042   int code_down;
00043   int code_n;
00044   int code_up;
00045   int code_p;
00046   int code_first;
00047   int code_last;
00048 
00049 public:
00050   MenuComponent(void);
00051   ~MenuComponent(void);
00052   bool draw(unsigned long ticks, const UserInput& ui);
00053 
00059   void add(ButtonComponent* button);
00060 
00066   void addIcon(LabelComponent* label);
00067 
00073   void setOffset(const VXV::Rect& offset);
00074 
00080   void setIconOffset(const VXV::Rect& offset);
00081 
00089   void setSelectedIndex(int index);
00090 
00096   void activate(bool on);
00097 
00103   void hide(bool on);
00104 
00110   void disable(bool on);
00111 
00117   void defaultSelection(bool on);
00118 
00124   void changeKeySettings(bool set_default);
00125 
00131   bool isDecided(void);
00132 
00138   void setNowIndex(int index);
00139 
00145   int getNowIndex(void);
00146 
00147   void beginFocus(void);
00148   void endFocus(void);
00149 
00150   void setIndexActive(int index, bool on);
00151 };
00152 
00153 #endif /* !MENU_COMPONENT_H */
00154 

Generated on Mon Apr 13 22:52:02 2009 by  doxygen 1.5.7.1