]>
Commit | Line | Data |
---|---|---|
7cb74906 JS |
1 | \section{\class{wxHelpProvider}}\label{wxhelpprovider} |
2 | ||
3 | wxHelpProvider is an abstract class used by a program implementing context-sensitive help to | |
4 | show the help text for the given window. | |
5 | ||
6 | The current help provider must be explicitly set by the application using | |
7 | wxHelpProvider::Set(). | |
8 | ||
9 | \wxheading{Derived from} | |
10 | ||
11 | No base class | |
12 | ||
e3c10211 JS |
13 | \wxheading{Include files} |
14 | ||
15 | <wx/cshelp.h> | |
16 | ||
7cb74906 JS |
17 | \wxheading{See also} |
18 | ||
4e28924c | 19 | \helpref{wxContextHelp}{wxcontexthelp}, \helpref{wxContextHelpButton}{wxcontexthelpbutton}, |
7cb74906 | 20 | \helpref{wxSimpleHelpProvider}{wxsimplehelpprovider}, \helpref{wxHelpControllerHelpProvider}{wxhelpcontrollerhelpprovider}, |
dc6588e7 | 21 | \helpref{wxWindow::SetHelpText}{wxwindowsethelptext}, \helpref{wxWindow::GetHelpTextAtPoint}{wxwindowgethelptextatpoint} |
7cb74906 JS |
22 | |
23 | \latexignore{\rtfignore{\wxheading{Members}}} | |
24 | ||
dc6588e7 | 25 | |
7cb74906 JS |
26 | \membersection{wxHelpProvider::\destruct{wxHelpProvider}}\label{wxhelpproviderdtor} |
27 | ||
28 | \func{}{\destruct{wxHelpProvider}}{\void} | |
29 | ||
30 | Virtual destructor for any base class. | |
31 | ||
dc6588e7 | 32 | |
03ca23b6 | 33 | \membersection{wxHelpProvider::AddHelp}\label{wxhelpprovideraddhelp} |
7cb74906 | 34 | |
03ca23b6 | 35 | \func{void}{AddHelp}{\param{wxWindowBase* }{window}, \param{const wxString\& }{text}} |
7cb74906 | 36 | |
03ca23b6 JS |
37 | Associates the text with the given window or id. Although all help |
38 | providers have these functions to allow making \helpref{wxWindow::SetHelpText}{wxwindowsethelptext} | |
39 | work, not all of them implement the functions. | |
7cb74906 | 40 | |
dc6588e7 | 41 | |
7cb74906 JS |
42 | \membersection{wxHelpProvider::Get}\label{wxhelpproviderget} |
43 | ||
44 | \func{wxHelpProvider*}{Get}{\void} | |
45 | ||
46 | Unlike some other classes, the help provider is not created on demand. | |
47 | This must be explicitly done by the application. | |
48 | ||
dc6588e7 | 49 | |
7cb74906 JS |
50 | \membersection{wxHelpProvider::GetHelp}\label{wxhelpprovidergethelp} |
51 | ||
52 | \func{wxString}{GetHelp}{\param{const wxWindowBase* }{window}} | |
53 | ||
54 | Gets the help string for this window. Its interpretation is dependent on the help provider | |
55 | except that empty string always means that no help is associated with | |
56 | the window. | |
57 | ||
7cb74906 JS |
58 | \func{void}{AddHelp}{\param{wxWindowID }{id}, \param{const wxString\& }{text}} |
59 | ||
60 | This version associates the given text with all windows with this id. | |
61 | May be used to set the same help string for all Cancel buttons in | |
62 | the application, for example. | |
63 | ||
dc6588e7 | 64 | |
57fc4c1a JS |
65 | \membersection{wxHelpProvider::RemoveHelp}\label{wxhelpproviderremovehelp} |
66 | ||
67 | \func{void}{RemoveHelp}{\param{wxWindowBase* }{window}} | |
68 | ||
69 | Removes the association between the window pointer and the help text. This is | |
70 | called by the wxWindow destructor. Without this, the table of help strings will fill up | |
71 | and when window pointers are reused, the wrong help string will be found. | |
72 | ||
dc6588e7 | 73 | |
03ca23b6 JS |
74 | \membersection{wxHelpProvider::Set}\label{wxhelpproviderset} |
75 | ||
76 | \func{wxHelpProvider*}{Set}{\param{wxHelpProvider* }{helpProvider}} | |
77 | ||
78 | Get/set the current, application-wide help provider. Returns | |
79 | the previous one. | |
80 | ||
dc6588e7 VZ |
81 | |
82 | \membersection{wxHelpProvider::ShowHelpAtPoint}\label{wxhelpprovidershowhelpatpoint} | |
83 | ||
84 | \func{bool}{ShowHelpAtPoint}{\param{wxWindowBase* }{window}, \param{const wxPoint & }{point}, \param{wxHelpEvent::Origin }{origin}} | |
85 | ||
86 | This function may be overridden to show help for the window when it should | |
87 | depend on the position inside the window, By default this method forwards to | |
88 | \helpref{ShowHelp}{wxhelpprovidershowhelp}, so it is enough to only implement | |
89 | the latter if the help doesn't depend on the position. | |
90 | ||
91 | Returns \true if help was shown, or \false if no help was available for this | |
92 | window. | |
93 | ||
94 | \wxheading{Parameters} | |
95 | ||
96 | \docparam{window}{Window to show help text for.} | |
97 | ||
98 | \docparam{point}{Coordinates of the mouse at the moment of help event emission.} | |
99 | ||
100 | \docparam{origin}{Help event origin, see also \helpref{wxHelpEvent::Origin}{wxhelpeventorigin}.} | |
101 | ||
102 | \newsince{2.7.0} | |
103 | ||
104 | ||
03ca23b6 JS |
105 | \membersection{wxHelpProvider::ShowHelp}\label{wxhelpprovidershowhelp} |
106 | ||
107 | \func{bool}{ShowHelp}{\param{wxWindowBase* }{window}} | |
108 | ||
dc6588e7 VZ |
109 | Shows help for the given window. Override this function if the help doesn't |
110 | depend on the exact position inside the window, otherwise you need to override | |
111 | \helpref{ShowHelpAtPoint}{wxhelpprovidershowhelpatpoint}. | |
03ca23b6 | 112 | |
dc6588e7 VZ |
113 | Returns \true if help was shown, or \false if no help was available for this |
114 | window. | |
03ca23b6 | 115 |