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