]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/tooltip.h
Added wxMSW wxBitmapComboBox::DoGetBestSize(), which takes bitmap size into account.
[wxWidgets.git] / include / wx / msw / tooltip.h
CommitLineData
3a19e16d 1///////////////////////////////////////////////////////////////////////////////
623d5f80 2// Name: wx/msw/tooltip.h
3a19e16d
VZ
3// Purpose: wxToolTip class - tooltip control
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 31.01.99
7// RCS-ID: $Id$
8// Copyright: (c) 1999 Robert Roebling, Vadim Zeitlin
65571936 9// Licence: wxWindows licence
3a19e16d
VZ
10///////////////////////////////////////////////////////////////////////////////
11
20ceebaa
MW
12#ifndef _WX_MSW_TOOLTIP_H_
13#define _WX_MSW_TOOLTIP_H_
14
4a6b1d28 15#include "wx/object.h"
e1bdb16a 16#include "wx/gdicmn.h"
4a6b1d28 17
b5dbe15d 18class WXDLLIMPEXP_FWD_CORE wxWindow;
623d5f80 19
53a2db12 20class WXDLLIMPEXP_CORE wxToolTip : public wxObject
3a19e16d
VZ
21{
22public:
23 // ctor & dtor
24 wxToolTip(const wxString &tip);
25 virtual ~wxToolTip();
6418ad5e
FM
26
27 // ctor used by wxStatusBar to associate a tooltip to a portion of
28 // the status bar window:
29 wxToolTip(wxWindow* win, unsigned int id,
30 const wxString &tip, const wxRect& rc);
3a19e16d
VZ
31
32 // accessors
33 // tip text
34 void SetTip(const wxString& tip);
35 const wxString& GetTip() const { return m_text; }
36
37 // the window we're associated with
38 void SetWindow(wxWindow *win);
39 wxWindow *GetWindow() const { return m_window; }
40
16f6dfd8 41 // controlling tooltip behaviour: globally change tooltip parameters
3a19e16d 42 // enable or disable the tooltips globally
16f6dfd8 43 static void Enable(bool flag);
3a19e16d 44 // set the delay after which the tooltip appears
16f6dfd8 45 static void SetDelay(long milliseconds);
be8b4385
VZ
46 // set the delay after which the tooltip disappears or how long the
47 // tooltip remains visible
becac1ef
VZ
48 static void SetAutoPop(long milliseconds);
49 // set the delay between subsequent tooltips to appear
50 static void SetReshow(long milliseconds);
be8b4385
VZ
51 // set maximum width for the new tooltips: -1 disables wrapping
52 // entirely, 0 restores the default behaviour
53 static void SetMaxWidth(int width);
3a19e16d 54
8614c467
VZ
55 // implementation only from now on
56 // -------------------------------
57
6418ad5e 58 // should be called in response to WM_MOUSEMOVE
4453b38d 59 static void RelayEvent(WXMSG *msg);
3a19e16d 60
1306e7d6
VZ
61 // add a window to the tooltip control
62 void Add(WXHWND hwnd);
63
0c5405b7 64 // remove any tooltip from the window
6418ad5e
FM
65 static void Remove(WXHWND hwnd, unsigned int id, const wxRect& rc);
66
67 // the rect we're associated with
68 void SetRect(const wxRect& rc);
69 const wxRect& GetRect() const { return m_rect; }
0c5405b7 70
3a19e16d 71private:
8614c467
VZ
72 // the one and only one tooltip control we use - never access it directly
73 // but use GetToolTipCtrl() which will create it when needed
f048e32f
VZ
74 static WXHWND ms_hwndTT;
75
76 // create the tooltip ctrl if it doesn't exist yet and return its HWND
8614c467 77 static WXHWND GetToolTipCtrl();
3a19e16d 78
be8b4385
VZ
79 // new tooltip maximum width, defaults to min(display width, 400)
80 static int ms_maxWidth;
81
3a19e16d
VZ
82 // remove this tooltip from the tooltip control
83 void Remove();
84
85 wxString m_text; // tooltip text
6418ad5e
FM
86 wxWindow* m_window; // window we're associated with
87 wxRect m_rect; // the rect of the window for which this tooltip is shown
88 // (or a rect with width/height == 0 to show it for the entire window)
89 unsigned int m_id; // the id of this tooltip (ignored when m_rect width/height is 0)
b342f8f0
RD
90
91 DECLARE_ABSTRACT_CLASS(wxToolTip)
c0c133e1 92 wxDECLARE_NO_COPY_CLASS(wxToolTip);
3a19e16d 93};
d098a357 94
20ceebaa 95#endif // _WX_MSW_TOOLTIP_H_