00001
00057 #ifndef INC_MGUI_TOOLTIP_H
00058 #define INC_MGUI_TOOLTIP_H
00059
00060 #ifndef INC_MGUI_BASE_H
00061 #include <mgui/base.h>
00062 #endif
00063
00064 #ifndef INC_MI32_COLOR_H
00065 #include <mi32/color.h>
00066 #endif
00067
00068 #ifndef INC_MI32_XBASE_H
00069 #include <mi32/xbase.h>
00070 #endif
00071
00072
00073 #ifndef GENERATING_DOXYGEN_OUTPUT
00074
00075 struct LPOINT2D;
00076 class MISTRING;
00077 namespace MGD {
00078 class DEVICE;
00079 class DEVICE_BINARY;
00080 }
00081 namespace SPATMOD {
00082 namespace IMAGE {
00083 class STAGE;
00084 class STAGE_ARRAY;
00085 }
00086 }
00087 #endif
00088
00089
00090 namespace MGUI {
00091
00092 class CTRL_TOOLTIP {
00093 public:
00094
00096 struct STYLE {
00097 COLOR m_BackgroundColor;
00098 COLOR m_BorderColor;
00099 COLOR m_TextColor;
00100 INT16 m_MarginWidth;
00101 INT16 m_MarginHeight;
00102
00103 STYLE ();
00104 };
00105
00106 #ifdef X_NATIVE
00109 static CTRL_TOOLTIP* FindAttached (
00110 Widget widget
00111 );
00112 #endif
00113
00115 static void HideAll ();
00116
00118 CTRL_TOOLTIP ();
00119
00121 virtual ~CTRL_TOOLTIP ();
00122
00124 void AppendImage (
00125 const MGD::DEVICE& device,
00126 bool bTakeOwnership = false
00127 );
00128
00130 void AppendImage (
00131 SPATMOD::IMAGE::STAGE& image
00132 );
00133
00135 void AppendText (
00136 const MISTRING& text
00137 );
00138
00148 void AppendText (
00149 const MISTRING& text,
00150 const SPATMOD::IMAGE::STAGE_ARRAY* Images
00151 );
00152
00154 void Attach (
00155 MGUI::CTRL& ctrl,
00156 bool DeleteOnCtrlDestroy = false
00157 );
00158
00159 #ifdef X_NATIVE
00161 void Attach (
00162 Widget widget,
00163 bool DeleteOnCtrlDestroy = false
00164 );
00165 #endif
00166
00167 bool CheckMotion (
00168 int x,
00169 int y,
00170 bool AutoHide = true
00171 );
00172
00173 #ifdef X_NATIVE
00174 bool CheckMotion (
00175 const XEvent& event,
00176 bool AutoHide = true
00177 );
00178 #endif
00179
00182 void Clear ();
00183
00185 void Detach ();
00186
00190 void Disable ();
00191
00193 void Enable ();
00194
00197 INT32 GetDelay ();
00198
00205 ERRVALUE GetImages (
00206 SPATMOD::IMAGE::STAGE_ARRAY& Images,
00207 bool bTransferOwnership
00208 );
00209
00212 const MISTRING& GetText () const;
00213
00216 int GetPixelDelta () const;
00217
00219 int GetPriority () const;
00220
00222 const STYLE& GetStyle () const;
00223
00226 void Hide ();
00227
00230 bool IsDisabled () const;
00231
00233 bool IsVisible () const;
00234
00239 void SetAlpha (
00240 int alpha
00241 );
00242
00244 void SetDelay (
00245 INT32 delay
00246 );
00247
00250 void SetDelegateOnShowRequest (
00251 DELEGATE_ONTOOLTIPREQUEST delegate
00252 );
00253
00256 void SetImage (
00257 const MGD::DEVICE& imgdev,
00258 const MGD::DEVICE_BINARY* maskdev = 0,
00259 const LPOINT2D* pos = 0
00260 );
00261
00265 void SetPixelDelta (
00266 int PixelDelta
00267 );
00268
00271 void SetPriority (
00272 int priority
00273 );
00274
00276 void SetStyle (
00277 const STYLE& style
00278 );
00279
00282 void SetText (
00283 const MISTRING& text
00284 );
00285
00291 void SetText (
00292 const MISTRING& text,
00293 const SPATMOD::IMAGE::STAGE_ARRAY* Images
00294 );
00295
00298 void Show ();
00299
00300 private:
00301
00302
00306 virtual bool v_HasDatatip ();
00307
00311 virtual void v_OnHide ();
00312
00316 virtual void v_OnShow ();
00317
00322 virtual bool v_OnShowRequest (
00323 int x,
00324 int y
00325 );
00326
00327 #ifndef GENERATING_DOXYGEN_OUTPUT
00328
00329 class PRIV;
00330 PRIV *m_pPriv;
00331 friend class PRIV;
00332
00333 CTRL_TOOLTIP (const CTRL_TOOLTIP&);
00334 CTRL_TOOLTIP& operator= (const CTRL_TOOLTIP&);
00335 #endif // GENERATING_DOXYGEN_OUTPUT
00336 };
00337
00338 }
00339
00340 #endif // INC_MGUI_TOOLTIP_H