]>
Commit | Line | Data |
---|---|---|
fb6261e9 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: cshelp.h | |
3 | // Purpose: Context-sensitive help classes | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 08/09/2000 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_CSHELPH__ | |
13 | #define _WX_CSHELPH__ | |
14 | ||
15 | #ifdef __GNUG__ | |
16 | #pragma interface "cshelp.h" | |
17 | #endif | |
18 | ||
19 | #include "wx/defs.h" | |
20 | ||
21 | #if wxUSE_HELP | |
22 | ||
23 | #include "wx/bmpbuttn.h" | |
24 | ||
25 | /* | |
26 | * wxContextHelp | |
27 | * Invokes context-sensitive help. When the user | |
28 | * clicks on a window, a wxEVT_HELP event will be sent to that | |
29 | * window for the application to display help for. | |
30 | */ | |
31 | ||
32 | class WXDLLEXPORT wxContextHelp: public wxObject | |
33 | { | |
34 | DECLARE_DYNAMIC_CLASS(wxContextHelp) | |
35 | public: | |
36 | wxContextHelp(wxWindow* win = NULL, bool beginHelp = TRUE); | |
37 | ~wxContextHelp(); | |
38 | ||
39 | bool BeginContextHelp(wxWindow* win); | |
40 | bool EndContextHelp(); | |
41 | ||
42 | bool EventLoop(); | |
43 | bool DispatchEvent(wxWindow* win, const wxPoint& pt); | |
44 | ||
45 | void SetStatus(bool status) { m_status = status; } | |
46 | ||
47 | protected: | |
48 | ||
49 | bool m_inHelp; | |
50 | bool m_status; // TRUE if the user left-clicked | |
51 | }; | |
52 | ||
53 | /* | |
54 | * wxContextHelpButton | |
55 | * You can add this to your dialogs (especially on non-Windows platforms) | |
56 | * to put the application into context help mode. | |
57 | */ | |
58 | ||
59 | class WXDLLEXPORT wxContextHelpButton: public wxBitmapButton | |
60 | { | |
61 | public: | |
62 | wxContextHelpButton(wxWindow* parent, wxWindowID id = wxID_CONTEXT_HELP, | |
63 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(20, -1), | |
64 | long style = wxBU_AUTODRAW); | |
65 | ||
66 | void OnContextHelp(wxCommandEvent& event); | |
67 | ||
68 | DECLARE_CLASS(wxContextHelpButton) | |
69 | DECLARE_EVENT_TABLE() | |
70 | }; | |
71 | ||
72 | #endif // wxUSE_HELP | |
73 | #endif | |
74 | // _WX_CSHELPH__ |