X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/129caaddf1062e108e2018acc1d2205dc24cfc7e..af01f1ba0d697c07173f436ab661b4c833258a91:/include/wx/tipwin.h diff --git a/include/wx/tipwin.h b/include/wx/tipwin.h index 766f45e7db..3a82a5c064 100644 --- a/include/wx/tipwin.h +++ b/include/wx/tipwin.h @@ -17,34 +17,52 @@ #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); +#if !wxUSE_POPUPWIN void OnActivate(wxActivateEvent& event); void OnKillFocus(wxFocusEvent& event); - - // calculate the client rect we need to display the text - void Adjust(const wxString& text, wxCoord maxLength); +#endif private: wxArrayString m_textLines; wxCoord m_heightLine; + wxTipWindow** m_windowPtr; DECLARE_EVENT_TABLE() }; +#endif // wxUSE_TIPWINDOW #endif // _WX_TIPWIN_H_