00001
00045 #ifndef INC_MGUI_STATUSBAR_H
00046 #define INC_MGUI_STATUSBAR_H
00047
00048 #ifndef INC_MGUI_CTRL_H
00049 #include <mgui/ctrl.h>
00050 #endif
00051
00052 #ifndef INC_MI32_MISTATUS_H
00053 #include <mi32/mistatus.h>
00054 #endif
00055
00056 #ifndef GENERATING_DOXYGEN_OUTPUT
00057 struct MTIMER;
00058 #endif
00059
00060
00061 namespace MGUI {
00062
00063
00071 class CTRL_STATUSBAR : public MGUI::CTRL, public MISTATUSLOGGER {
00072 public:
00073
00075 enum STYLE {
00076 STYLE_Default = 0,
00077 STYLE_HasCancelButton = 0x01,
00078 STYLE_NoProgressBar = 0x02,
00079 STYLE_NoElapsedTime = 0x04,
00080 STYLE_EnableToolTips = 0x08,
00081 STYLE_EnableThreading = 0x10,
00082 };
00083
00084 enum PANEUSAGE {
00085 PANEUSAGE_Main,
00086 PANEUSAGE_ElapsedTime,
00087 PANEUSAGE_ProgressBar,
00088 PANEUSAGE_Icon,
00089 PANEUSAGE_Text,
00090 PANEUSAGE_Mixed,
00091 };
00092
00094 enum PANESTYLE {
00095 PANESTYLE_Normal = 0x00,
00096 PANESTYLE_NoSeparator = 0x01,
00097 PANESTYLE_Stretch = 0x02,
00098 };
00099
00101 CTRL_STATUSBAR ();
00102
00104 virtual ~CTRL_STATUSBAR ();
00105
00113 int AddPane (
00114 PANEUSAGE usage,
00115 PANESTYLE style,
00116 int cxWidth,
00117 ID id = 0
00118 );
00119
00123 void AttachCancelButton (
00124 CTRL_PUSHBUTTON& button
00125 );
00126
00130 void AttachCancelButton (
00131 CTRL_TOOLBAR& toolbar,
00132 ID id
00133 );
00134
00135 #ifdef X_NATIVE
00136 DEPRECATED void AttachCancelButtonWidget (
00137 Widget widget
00138 );
00139 #endif
00140
00142 void ClearBar (
00143 );
00144
00146 void ClearPane (
00147 int PaneIndex
00148 );
00149
00151 void ClearPaneElapsedTime (
00152 );
00153
00155 void ClearText (
00156 );
00157
00161 void Create (
00162 MGUI::LAYOUT_PANE_BASE& ParentPane,
00163 STYLE style = STYLE_Default
00164 );
00165
00167 void SetPaneDelegateOnToolTipRequest (
00168 int PaneIndex,
00169 DELEGATE_ONTOOLTIPREQUEST delegate
00170 );
00171
00173 void SetPaneEnabled (
00174 int PaneIndex,
00175 bool enabled
00176 );
00177
00179 void SetPaneIcon (
00180 int PaneIndex,
00181 ICONID iconid
00182 );
00183
00185 void SetPaneText (
00186 int PaneIndex,
00187 const MISTRING& string
00188 );
00189
00191 void SetPaneToolTipString (
00192 int PaneIndex,
00193 const MISTRING& string
00194 );
00195
00197 void SetPaneVisible (
00198 int PaneIndex,
00199 bool visible
00200 );
00201
00204 void SetText (
00205 const MISTRING& string
00206 );
00207
00209 void SetTextError (
00210 ERRVALUE err
00211 );
00212
00213 private:
00214 #ifndef GENERATING_DOXYGEN_OUTPUT
00215
00216 typedef CTRL BASECLASS;
00217 typedef CTRL_STATUSBAR THISCLASS;
00218
00219 class PRIV;
00220 PRIV *m_pPriv;
00221
00222 void OnToolBarCancel (MGUI::ID, bool);
00223
00224
00225 virtual void v_OnDestroyWidget ();
00226
00227
00228 virtual CONTEXT_PRIV* v_ContextPrivCreate (MISTATUSCONTEXT& Context);
00229 virtual bool v_IsCancelled ();
00230 virtual void v_ReportMessage (MISTATUSCONTEXT& context, const MISTRING& msgstr);
00231 virtual void v_ReportProgress (MISTATUSCONTEXT& context, double pctdone);
00232 virtual void v_ReportTimerValue (const MTIMER& timer);
00233 virtual void v_SetCancelEnabled (bool enabled);
00234 virtual void v_UpdateUI ();
00235
00236 CTRL_STATUSBAR (const CTRL_STATUSBAR&);
00237 CTRL_STATUSBAR& operator= (const CTRL_STATUSBAR&);
00238 #endif // GENERATING_DOXYGEN_OUTPUT
00239
00240 };
00241
00242 #ifndef GENERATING_DOXYGEN_OUTPUT
00243 DEFINE_ENUM_OP_BITWISE(CTRL_STATUSBAR::STYLE)
00244 DEFINE_ENUM_OP_BITWISE(CTRL_STATUSBAR::PANESTYLE)
00245 #endif
00246
00247
00248 }
00249
00250
00251 #endif // INC_MGUI_STATUSBAR_H