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