]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/help.i
added support for polygons to wxRegion
[wxWidgets.git] / wxPython / src / help.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: help.i
3 // Purpose: Context sensitive help classes, and etc.
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 28-July-2001
8 // RCS-ID: $Id$
9 // Copyright: (c) 2001 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 %module help
14
15 %{
16 #include "export.h"
17 #include <wx/cshelp.h>
18 %}
19
20 //----------------------------------------------------------------------
21
22 %include typemaps.i
23 %include my_typemaps.i
24
25 // Import some definitions of other classes, etc.
26 %import _defs.i
27 %import windows.i
28 %import misc.i
29 %import controls.i
30
31
32 //----------------------------------------------------------------------
33
34 enum {
35 wxFRAME_EX_CONTEXTHELP,
36 wxDIALOG_EX_CONTEXTHELP,
37 wxID_CONTEXT_HELP,
38 wxEVT_HELP,
39 wxEVT_DETAILED_HELP,
40 wxEVT_CONTEXT_MENU,
41 };
42
43
44 %pragma(python) code = "
45 # Help events
46 def EVT_HELP(win, id, func):
47 win.Connect(id, -1, wxEVT_HELP, func)
48
49 def EVT_HELP_RANGE(win, id, id2, func):
50 win.Connect(id, id2, wxEVT_HELP, func)
51
52 def EVT_DETAILED_HELP(win, id, func):
53 win.Connect(id, -1, wxEVT_DETAILED_HELP, func)
54
55 def EVT_DETAILED_HELP_RANGE(win, id, id2, func):
56 win.Connect(id, id2, wxEVT_DETAILED_HELP, func)
57
58 def EVT_CONTEXT_MENU(win, func):
59 win.Connect(-1, -1, wxEVT_CONTEXT_MENU, func)
60 "
61
62 //----------------------------------------------------------------------
63
64 class wxHelpEvent : public wxCommandEvent
65 {
66 public:
67 wxHelpEvent(wxEventType type = wxEVT_NULL,
68 wxWindowID id = 0,
69 const wxPoint& pt = wxDefaultPosition);
70 const wxPoint& GetPosition();
71 void SetPosition(const wxPoint& pos);
72 const wxString& GetLink();
73 void SetLink(const wxString& link);
74 const wxString& GetTarget();
75 void SetTarget(const wxString& target);
76 };
77
78 //---------------------------------------------------------------------------
79
80
81 class wxContextMenuEvent : public wxCommandEvent
82 {
83 public:
84 wxContextMenuEvent(wxEventType type = wxEVT_NULL,
85 wxWindowID id = 0,
86 const wxPoint& pt = wxDefaultPosition);
87 const wxPoint& GetPosition();
88 void SetPosition(const wxPoint& pos);
89 };
90
91
92
93 //----------------------------------------------------------------------
94
95 class wxContextHelp : public wxObject {
96 public:
97 wxContextHelp(wxWindow* window = NULL, bool doNow = TRUE);
98 ~wxContextHelp();
99
100 bool BeginContextHelp(wxWindow* window = NULL);
101 bool EndContextHelp();
102 };
103
104
105 //----------------------------------------------------------------------
106
107 class wxContextHelpButton : public wxBitmapButton {
108 public:
109 wxContextHelpButton(wxWindow* parent, wxWindowID id = wxID_CONTEXT_HELP,
110 const wxPoint& pos = wxDefaultPosition,
111 const wxSize& size = wxDefaultSize,
112 long style = wxBU_AUTODRAW);
113 };
114
115
116 //----------------------------------------------------------------------
117
118 class wxHelpProvider
119 {
120 public:
121 static wxHelpProvider *Set(wxHelpProvider *helpProvider);
122 static wxHelpProvider *Get();
123
124 // Virtuals...
125 wxString GetHelp(const wxWindow *window);
126 bool ShowHelp(wxWindowBase *window);
127 void AddHelp(wxWindowBase *window, const wxString& text);
128 %name(AddHelpById)void AddHelp(wxWindowID id, const wxString& text);
129
130 %addmethods { void Destroy() { delete self; } }
131
132 };
133
134
135 //----------------------------------------------------------------------
136
137 class wxSimpleHelpProvider : public wxHelpProvider
138 {
139 public:
140 wxSimpleHelpProvider();
141 };
142
143
144 //----------------------------------------------------------------------
145
146 // TODO: Add this once the wxHelpController is in wxPython...
147
148 // class WXDLLEXPORT wxHelpControllerHelpProvider : public wxSimpleHelpProvider
149 // {
150 // public:
151 // wxHelpControllerHelpProvider(wxHelpController* hc = NULL);
152 // void SetHelpController(wxHelpController* hc);
153 // wxHelpController* GetHelpController();
154 // };
155
156
157
158
159 //----------------------------------------------------------------------
160 //----------------------------------------------------------------------
161 // This file gets appended to the shadow class file.
162 //----------------------------------------------------------------------
163
164 %pragma(python) include="_helpextras.py";
165
166 //---------------------------------------------------------------------------