00001 #ifndef __CMenu__ 00002 #define __CMenu__ 00003 00004 #include "CMenuItem.hpp" 00005 #include <Collections/TCountedPointerArray.hpp> 00006 00007 // =========================================================================== 00008 00009 using Exponent::GUI::Controls::CMenuItem; 00010 using Exponent::Collections::TCountedPointerArray; 00011 00012 // =========================================================================== 00013 00014 namespace Exponent 00015 { 00016 namespace GUI 00017 { 00018 namespace Controls 00019 { 00037 class CMenu : public CCountedObject 00038 { 00040 EXPONENT_CLASS_DECLARATION; 00043 // =========================================================================== 00044 00045 public: 00046 00047 // =========================================================================== 00048 00052 CMenu(); 00053 00057 virtual ~CMenu(); 00058 00059 // =========================================================================== 00060 00065 void addMenuItem(CMenuItem *menuItem); 00066 00072 CMenuItem *getMenuItem(const long index); 00073 00078 void removeMenuItem(const long index); 00079 00084 void removeMenuItemNoOrdering(const long index); 00085 00089 void clearAllMenuItems(); 00090 00095 void setMenuTitle(const CString &title); 00096 00101 const CString &getMenuTitle() const; 00102 00107 long getNumberOfMenuItems() const; 00108 00109 // =========================================================================== 00110 00115 static void getADivisionMenu(CMenu *addToThisMenu); 00116 00117 // =========================================================================== 00118 00119 protected: 00120 00121 // =========================================================================== 00122 00123 TCountedPointerArray<CMenuItem> *m_subMenus; 00124 CString m_menuTitle; 00126 }; 00127 } 00128 } 00129 } 00130 #endif // End of CMenu.hpp