]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/help.i
A little different fix for how to delay the call to __wxCleanup
[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 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
114 };
115
116
117 //----------------------------------------------------------------------
118
119 class wxHelpProvider
120 {
121 public:
122 static wxHelpProvider *Set(wxHelpProvider *helpProvider);
123 static wxHelpProvider *Get();
124
125 // Virtuals...
126 wxString GetHelp(const wxWindow *window);
127 bool ShowHelp(wxWindowBase *window);
128 void AddHelp(wxWindowBase *window, const wxString& text);
129 %name(AddHelpById)void AddHelp(wxWindowID id, const wxString& text);
130
131 %addmethods { void Destroy() { delete self; } }
132
133 };
134
135
136 //----------------------------------------------------------------------
137
138 class wxSimpleHelpProvider : public wxHelpProvider
139 {
140 public:
141 wxSimpleHelpProvider();
142 };
143
144
145 //----------------------------------------------------------------------
146
147 // TODO: Add this once the wxHelpController is in wxPython...
148
149 // class WXDLLEXPORT wxHelpControllerHelpProvider : public wxSimpleHelpProvider
150 // {
151 // public:
152 // wxHelpControllerHelpProvider(wxHelpController* hc = NULL);
153 // void SetHelpController(wxHelpController* hc);
154 // wxHelpController* GetHelpController();
155 // };
156
157
158
159
160 //----------------------------------------------------------------------
161 //----------------------------------------------------------------------
162 // This file gets appended to the shadow class file.
163 //----------------------------------------------------------------------
164
165 %pragma(python) include="_helpextras.py";
166
167 //---------------------------------------------------------------------------