]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/tipwin.h
added wxUSE_TIPWINDOW
[wxWidgets.git] / include / wx / tipwin.h
index 766f45e7dbdeab420cfd9a35c5fe9a78d2a25553..8a274e5794662df48dec8b00f118382fbbb9f158 100644 (file)
     #pragma interface "tipwin.h"
 #endif
 
-#include "wx/frame.h"
+#include "wx/popupwin.h"
+
+#if wxUSE_POPUPWIN
 
 // ----------------------------------------------------------------------------
 // wxTipWindow
 // ----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxTipWindow : public wxFrame
+class WXDLLEXPORT wxTipWindow : public wxPopupTransientWindow
 {
 public:
+    // Supply windowPtr for it to null the given address
+    // when the window has closed.
     wxTipWindow(wxWindow *parent,
                 const wxString& text,
-                wxCoord maxLength = 100);
+                wxCoord maxLength = 100, wxTipWindow** windowPtr = NULL);
+    ~wxTipWindow();
 
-protected:
-    // event handlers
-    void OnPaint(wxPaintEvent& event);
-    void OnMouseClick(wxMouseEvent& event);
-    void OnActivate(wxActivateEvent& event);
-    void OnKillFocus(wxFocusEvent& event);
+    void SetTipWindowPtr(wxTipWindow** windowPtr) { m_windowPtr = windowPtr; }
 
     // calculate the client rect we need to display the text
     void Adjust(const wxString& text, wxCoord maxLength);
 
+    void Close();
+
+protected:
+    // event handlers
+    void OnMouseClick(wxMouseEvent& event);
+    void OnPaint(wxPaintEvent& event);
+
 private:
     wxArrayString m_textLines;
     wxCoord m_heightLine;
+    wxTipWindow** m_windowPtr;
 
     DECLARE_EVENT_TABLE()
 };
 
+#endif // wxUSE_POPUPWIN
+
 #endif // _WX_TIPWIN_H_
+