00001
00036 #ifndef INC_MGUI_FORMCHECKLIST_H
00037 #define INC_MGUI_FORMCHECKLIST_H
00038
00039 #ifndef INC_MGUI_FORM_H
00040 #include <mgui/form.h>
00041 #endif
00042
00043 #ifndef INC_MI32_MISTRING_H
00044 #include <mi32/mistring.h>
00045 #endif
00046
00047
00048 #ifndef GENERATING_DOXYGEN_OUTPUT
00049 class BITSET;
00050 namespace MGUI {
00051 class LAYOUT_PANE_BASE;
00052 }
00053 #endif
00054
00055
00056 namespace MGUI {
00057
00058
00059
00061 class FORM_CHECKLIST : public MGUI::FORM_COMPOSITE {
00062 public:
00063
00064 enum STYLES {
00065 STYLE_Default = 0x00,
00066 STYLE_FirstIsExclusive = 0x01,
00067 STYLE_AtLeastOne = 0x02,
00068 STYLE_OnlyOne = 0x04,
00069 STYLE_ShowScrollbar = 0x08,
00070 STYLE_ShowFrame = 0x10,
00071 };
00072
00074 FORM_CHECKLIST ();
00075
00077 virtual ~FORM_CHECKLIST ();
00078
00083 UINT16 AddItem (
00084 ID id,
00085 const MISTRING& label,
00086 bool selected = false
00087 );
00088
00090 void Create (
00091 MGUI::LAYOUT_PANE_BASE& ParentPane,
00092 int rows,
00093 int columns = 1,
00094 STYLES Style = STYLE_Default,
00095 MGUI::LAYOUT_SIZEALIGN SizeAlign = MGUI::LAYOUT_SIZEALIGN_Expand
00096 );
00097
00099 void Create (
00100 MGUI::LAYOUT_PANE_BASE& ParentPane,
00101 const MISTRING& ColumnLabel,
00102 int rows,
00103 int columns = 1,
00104 STYLES Style = STYLE_Default,
00105 MGUI::LAYOUT_SIZEALIGN SizeAlign = MGUI::LAYOUT_SIZEALIGN_Expand
00106 );
00107
00109 void DeleteAllItems (
00110 );
00111
00113 void DeleteItem (
00114 UINT16 index
00115 );
00116
00118 void DeleteItemID (
00119 ID id
00120 );
00121
00123 UINT16 GetCount (
00124 ) const;
00125
00128 UINT16 GetIndexFromID (
00129 ID id
00130 ) const;
00131
00134 ID GetItemID (
00135 UINT16 index
00136 ) const;
00137
00140 MISTRING GetItemString (
00141 UINT16 index
00142 ) const;
00143
00146 UINT16 GetSelectedCount (
00147 ) const;
00148
00150 const BITSET& GetSelectedSet (
00151 ) const;
00152
00157 UINT16 InsertItem (
00158 UINT16 index,
00159 ID id,
00160 const MISTRING& string,
00161 bool selected = false
00162 );
00163
00165 bool IsItemSelected (
00166 UINT16 index
00167 ) const;
00168
00170 bool IsItemSelectedID (
00171 ID id
00172 ) const;
00173
00175 void SetAllSelected (
00176 bool selected,
00177 bool notify = true
00178 );
00179
00181 void SetDelegateOnChangeSelection (
00182 DELEGATE_VOID_NOPARMS delegate
00183 );
00184
00187 bool SetItemSelected (
00188 UINT16 index,
00189 bool selected,
00190 bool notify = true
00191 );
00192
00195 bool SetItemSelectedID (
00196 ID id,
00197 bool selected,
00198 bool notify = true
00199 );
00200
00202 void SizeToContentWidth (
00203 );
00204
00206 virtual void SetEnabled (bool enabled);
00207
00209 virtual void SetVisible (bool visible);
00210
00211 private:
00212 #ifndef GENERATING_DOXYGEN_OUTPUT
00213 class PRIV;
00214 PRIV *m_pPriv;
00215
00216
00217 FORM_CHECKLIST (const FORM_CHECKLIST&);
00218 FORM_CHECKLIST& operator= (const FORM_CHECKLIST&);
00219 #endif // GENERATING_DOXYGEN_OUTPUT
00220 };
00221
00222 #ifndef GENERATING_DOXYGEN_OUTPUT
00223 DEFINE_ENUM_OP_BITWISE(FORM_CHECKLIST::STYLES);
00224 #endif
00225
00226
00227
00228 }
00229
00230 #endif // INC_MGUI_FORMCHECKLIST_H