00001
00037 #ifndef INC_MGUI_FORMEDITCOLORS_H
00038 #define INC_MGUI_FORMEDITCOLORS_H
00039
00040 #ifndef INC_MGUI_FORM_H
00041 #include <mgui/form.h>
00042 #endif
00043
00044 #ifndef INC_MI32_COLOR_H
00045 #include <mi32/color.h>
00046 #endif
00047
00048 namespace MGUI {
00049
00053 class FORM_EDIT_COLORS : public MGUI::FORM_COMPOSITE {
00054 public:
00055
00056 typedef FastDelegate<void(int,const COLOR&)> DELEGATE_ONCHANGEITEMCOLOR;
00057
00059 enum STYLE {
00060 STYLE_ListTop = 0x00,
00061 STYLE_ListBottom = 0x01,
00062 STYLE_ListLeft = 0x02,
00063 STYLE_ListRight = 0x04,
00064
00065 STYLE_ScrollAuto = 0x00,
00066 STYLE_ScrollNoH = 0x10,
00067 STYLE_ScrollNoV = 0x20,
00068 STYLE_ScrollNone = 0x30,
00069
00070 STYLE_WidthInPixels = 0x40,
00071
00072 STYLE_Default = STYLE_ListTop | STYLE_ScrollAuto
00073 };
00074
00076 FORM_EDIT_COLORS ();
00077
00079 virtual ~FORM_EDIT_COLORS ();
00080
00083 int AddItem (
00084 const MISTRING& name,
00085 const COLOR& color,
00086 COLOR::CAPABILITY capability = COLOR::CAPABILITY_AsPrevious
00087 );
00088
00091 int AddItem (
00092 const MISTRING& name,
00093 UINT32 ColorRef,
00094 COLOR::CAPABILITY capability = COLOR::CAPABILITY_AsPrevious
00095 );
00096
00100 void Create (
00101 MGUI::LAYOUT_PANE_BASE& ParentPane,
00102 COLOR::CAPABILITY capability,
00103 int listrows,
00104 int listwidth = -1,
00105 STYLE style = STYLE_Default,
00106 LAYOUT_SIZEALIGN sizealign = LAYOUT_SIZEALIGN_Expand
00107 );
00108
00110 void DeleteAllItems ();
00111
00114 const COLOR& GetItemColor (
00115 int itemidx
00116 ) const;
00117
00120 UINT32 GetItemColorRef (
00121 int itemidx
00122 ) const;
00123
00125 MGUI::ID GetItemID (
00126 int itemidx
00127 ) const;
00128
00130 void RedrawDisable ();
00131
00133 void RedrawEnable ();
00134
00136 void SetDelegateOnChangeItemColor (
00137 DELEGATE_ONCHANGEITEMCOLOR delegate
00138 );
00139
00141 void SetItemColor (
00142 int itemidx,
00143 const COLOR& color,
00144 bool notify = true
00145 );
00146
00148 void SetItemID (
00149 int itemidx,
00150 MGUI::ID id
00151 );
00152
00153 private:
00154 #ifndef GENERATING_DOXYGEN_OUTPUT
00155 class PRIV;
00156 PRIV *m_pPriv;
00157 #endif // GENERATING_DOXYGEN_OUTPUT
00158 };
00159
00160 #ifndef GENERATING_DOXYGEN_OUTPUT
00161 DEFINE_ENUM_OP_BITWISE(FORM_EDIT_COLORS::STYLE)
00162 #endif
00163
00164
00165 }
00166
00167 #endif // INC_MGUI_FORMEDITCOLORS_H