]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/tipwin.h
fixed bug with the caret positioning after SetValue() introduced by the last commit
[wxWidgets.git] / include / wx / tipwin.h
index feaddc11b6a47125804ee95305e30d6dd612cedb..3a82a5c064e2b97d673bd58f93cc93e68fbff4f8 100644 (file)
     #pragma interface "tipwin.h"
 #endif
 
+#if wxUSE_TIPWINDOW
+
+#if wxUSE_POPUPWIN
+#include "wx/popupwin.h"
+#else
 #include "wx/frame.h"
+#endif
 
 // ----------------------------------------------------------------------------
 // wxTipWindow
 // ----------------------------------------------------------------------------
 
+#if wxUSE_POPUPWIN
+class WXDLLEXPORT wxTipWindow : public wxPopupTransientWindow
+#else
 class WXDLLEXPORT wxTipWindow : public wxFrame
+#endif
 {
+    friend class wxTipWindowView;
 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();
+
+    void SetTipWindowPtr(wxTipWindow** windowPtr) { m_windowPtr = windowPtr; }
+
+    void Close();
 
 protected:
     // event handlers
-    void OnPaint(wxPaintEvent& event);
     void OnMouseClick(wxMouseEvent& event);
-
-    // calculate the client rect we need to display the text
-    void Adjust(const wxString& text, wxCoord maxLength);
+#if !wxUSE_POPUPWIN
+    void OnActivate(wxActivateEvent& event);
+    void OnKillFocus(wxFocusEvent& event);
+#endif
 
 private:
     wxArrayString m_textLines;
     wxCoord m_heightLine;
+    wxTipWindow** m_windowPtr;
 
     DECLARE_EVENT_TABLE()
 };
 
+#endif // wxUSE_TIPWINDOW
 #endif // _WX_TIPWIN_H_