]> git.saurik.com Git - wxWidgets.git/blame - include/wx/tipwin.h
Fix assert when destroying wxDataViewCtrl being edited in wxGTK.
[wxWidgets.git] / include / wx / tipwin.h
CommitLineData
01fa3fe7
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/tipwin.h
3// Purpose: wxTipWindow is a window like the one typically used for
4// showing the tooltips
5// Author: Vadim Zeitlin
6// Modified by:
7// Created: 10.09.00
8// RCS-ID: $Id$
9// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
65571936 10// Licence: wxWindows licence
01fa3fe7
VZ
11///////////////////////////////////////////////////////////////////////////////
12
13#ifndef _WX_TIPWIN_H_
14#define _WX_TIPWIN_H_
15
961c54c3 16#if wxUSE_TIPWINDOW
01fa3fe7 17
8962e1d9 18#if wxUSE_POPUPWIN
dafbe8c0
VZ
19 #include "wx/popupwin.h"
20
21 #define wxTipWindowBase wxPopupTransientWindow
961c54c3 22#else
dafbe8c0
VZ
23 #include "wx/frame.h"
24
25 #define wxTipWindowBase wxFrame
961c54c3 26#endif
69b9f4cc 27#include "wx/arrstr.h"
f38bcae5 28
b5dbe15d 29class WXDLLIMPEXP_FWD_CORE wxTipWindowView;
dafbe8c0 30
01fa3fe7
VZ
31// ----------------------------------------------------------------------------
32// wxTipWindow
33// ----------------------------------------------------------------------------
34
53a2db12 35class WXDLLIMPEXP_CORE wxTipWindow : public wxTipWindowBase
01fa3fe7
VZ
36{
37public:
dafbe8c0
VZ
38 // the mandatory ctor parameters are: the parent window and the text to
39 // show
40 //
41 // optionally you may also specify the length at which the lines are going
42 // to be broken in rows (100 pixels by default)
43 //
44 // windowPtr and rectBound are just passed to SetTipWindowPtr() and
45 // SetBoundingRect() - see below
01fa3fe7
VZ
46 wxTipWindow(wxWindow *parent,
47 const wxString& text,
dafbe8c0
VZ
48 wxCoord maxLength = 100,
49 wxTipWindow** windowPtr = NULL,
50 wxRect *rectBound = NULL);
173e8bbf 51
dafbe8c0
VZ
52 virtual ~wxTipWindow();
53
54 // If windowPtr is not NULL the given address will be NULLed when the
55 // window has closed
173e8bbf 56 void SetTipWindowPtr(wxTipWindow** windowPtr) { m_windowPtr = windowPtr; }
01fa3fe7 57
dafbe8c0
VZ
58 // If rectBound is not NULL, the window will disappear automatically when
59 // the mouse leave the specified rect: note that rectBound should be in the
60 // screen coordinates!
61 void SetBoundingRect(const wxRect& rectBound);
62
63 // Hide and destroy the window
8962e1d9
RD
64 void Close();
65
01fa3fe7 66protected:
dafbe8c0
VZ
67 // called by wxTipWindowView only
68 bool CheckMouseInBounds(const wxPoint& pos);
69
01fa3fe7 70 // event handlers
01fa3fe7 71 void OnMouseClick(wxMouseEvent& event);
dafbe8c0 72
961c54c3
RD
73#if !wxUSE_POPUPWIN
74 void OnActivate(wxActivateEvent& event);
75 void OnKillFocus(wxFocusEvent& event);
dafbe8c0
VZ
76#else // wxUSE_POPUPWIN
77 virtual void OnDismiss();
78#endif // wxUSE_POPUPWIN/!wxUSE_POPUPWIN
01fa3fe7 79
01fa3fe7
VZ
80private:
81 wxArrayString m_textLines;
82 wxCoord m_heightLine;
dafbe8c0
VZ
83
84 wxTipWindowView *m_view;
85
173e8bbf 86 wxTipWindow** m_windowPtr;
dafbe8c0 87 wxRect m_rectBound;
01fa3fe7
VZ
88
89 DECLARE_EVENT_TABLE()
dafbe8c0
VZ
90
91 friend class wxTipWindowView;
22f3361e 92
c0c133e1 93 wxDECLARE_NO_COPY_CLASS(wxTipWindow);
01fa3fe7
VZ
94};
95
961c54c3 96#endif // wxUSE_TIPWINDOW
dafbe8c0 97
01fa3fe7 98#endif // _WX_TIPWIN_H_