00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __UILISTBOXES_H__
00012 #define __UILISTBOXES_H__
00013
00014 #include "CUIListBox.h"
00015 #include "CUIWidgetGroup.h"
00016 #include "CUIRadioButton.h"
00017
00020 class CUIStringListBox: public CUIListBox
00021 {
00022 public:
00024 CUIStringListBox( const CUIRect& aRectangle,
00025 const char* aTitle = NULL,
00026 MUIWidgetEvents* aObserver = NULL );
00027 virtual ~CUIStringListBox();
00028
00029 virtual unsigned int GetItemsNumber();
00030 virtual unsigned int GetItemHeight( unsigned int aItemIndex );
00031 virtual void DrawItem( unsigned int aItemIndex, CUIRect& aRect );
00032
00033 enum { KMaxStrings = 50 };
00039 bool AddString( const char* aString );
00040
00042 const char* GetString( unsigned int aIndex );
00043
00048 void Clear();
00049
00050 private:
00051 CUIStringListBox();
00052 CUIStringListBox( const CUIStringListBox& );
00053 CUIStringListBox& operator=( const CUIStringListBox& );
00054
00055 private:
00056 char* m_Strings[ KMaxStrings ];
00057 unsigned int m_StringsNumber;
00058
00059 bool DeleteString( unsigned int aIndex );
00060 };
00061
00062
00068 class CUIRadioButtonListBox: public CUIListBox
00069 {
00070 public:
00072 CUIRadioButtonListBox( const CUIRect& aRectangle,
00073 const char* aTitle = NULL,
00074 MUIWidgetEvents* aObserver = NULL );
00075
00076 virtual unsigned int GetItemsNumber();
00077 virtual unsigned int GetItemHeight( unsigned int aItemIndex );
00078 virtual void DrawItem( unsigned int aItemIndex, CUIRect& aRect );
00079
00080
00087 bool AddRadioButton( const char* aTitle, bool aNewGroup = false );
00088
00090 bool IsChecked( unsigned int aRadioButtonIndex );
00091
00097 void SetChecked( unsigned int aRadioButtonIndex, bool aChecked );
00098
00100 const char* GetItemTitle( unsigned int aRadioButtonIndex );
00101
00103 void SetItemTitle( unsigned int aRadioButtonIndex, const char* aTitle );
00104
00105
00106 private:
00107 CUIRadioButtonListBox();
00108 CUIRadioButtonListBox( const CUIRadioButtonListBox& );
00109 CUIRadioButtonListBox& operator=( const CUIRadioButtonListBox& );
00110
00111 private:
00112 CUIRadioButton* m_pPrevButton;
00113 };
00114
00118 class CUICheckListBox: public CUIListBox
00119 {
00120 public:
00122 CUICheckListBox( const CUIRect& aRectangle,
00123 const char* aTitle = NULL,
00124 MUIWidgetEvents* aObserver = NULL );
00125
00126 virtual unsigned int GetItemsNumber();
00127 virtual unsigned int GetItemHeight( unsigned int aItemIndex );
00128 virtual void DrawItem( unsigned int aItemIndex, CUIRect& aRect );
00129
00134 bool AddCheckBox( const char* aTitle );
00135
00137 bool IsChecked( unsigned int aIndex );
00138
00140 void SetChecked( unsigned int aIndex, bool aChecked );
00141
00143 const char* GetItemTitle( unsigned int aIndex );
00144
00146 void SetItemTitle( unsigned int aIndex, const char* aTitle );
00147
00148 private:
00149 CUICheckListBox();
00150 CUICheckListBox( const CUICheckListBox& );
00151 CUICheckListBox& operator=( const CUICheckListBox& );
00152 };
00153
00154
00155 #endif // __UILISTBOXES_H__
00156