1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Context sensitive help classes, and etc.
7 // Created: 28-July-2001
9 // Copyright: (c) 2001 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
17 #include <wx/cshelp.h>
20 //----------------------------------------------------------------------
23 %include my_typemaps.i
25 // Import some definitions of other classes, etc.
32 //----------------------------------------------------------------------
35 wxFRAME_EX_CONTEXTHELP,
36 wxDIALOG_EX_CONTEXTHELP,
43 %pragma(python) code = "
45 def EVT_HELP(win, id, func):
46 win.Connect(id, -1, wxEVT_HELP, func)
48 def EVT_HELP_RANGE(win, id, id2, func):
49 win.Connect(id, id2, wxEVT_HELP, func)
51 def EVT_DETAILED_HELP(win, id, func):
52 win.Connect(id, -1, wxEVT_DETAILED_HELP, func)
54 def EVT_DETAILED_HELP_RANGE(win, id, id2, func):
55 win.Connect(id, id2, wxEVT_DETAILED_HELP, func)
58 //----------------------------------------------------------------------
60 class wxHelpEvent : public wxCommandEvent
63 wxHelpEvent(wxEventType type = wxEVT_NULL,
65 const wxPoint& pt = wxDefaultPosition);
66 const wxPoint& GetPosition();
67 void SetPosition(const wxPoint& pos);
68 const wxString& GetLink();
69 void SetLink(const wxString& link);
70 const wxString& GetTarget();
71 void SetTarget(const wxString& target);
74 //---------------------------------------------------------------------------
77 class wxContextMenuEvent : public wxCommandEvent
80 wxContextMenuEvent(wxEventType type = wxEVT_NULL,
82 const wxPoint& pt = wxDefaultPosition);
83 const wxPoint& GetPosition();
84 void SetPosition(const wxPoint& pos);
89 //----------------------------------------------------------------------
91 class wxContextHelp : public wxObject {
93 wxContextHelp(wxWindow* window = NULL, bool doNow = TRUE);
96 bool BeginContextHelp(wxWindow* window = NULL);
97 bool EndContextHelp();
101 //----------------------------------------------------------------------
103 class wxContextHelpButton : public wxBitmapButton {
105 wxContextHelpButton(wxWindow* parent, wxWindowID id = wxID_CONTEXT_HELP,
106 const wxPoint& pos = wxDefaultPosition,
107 const wxSize& size = wxDefaultSize,
108 long style = wxBU_AUTODRAW);
109 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
113 //----------------------------------------------------------------------
118 static wxHelpProvider *Set(wxHelpProvider *helpProvider);
119 static wxHelpProvider *Get();
122 wxString GetHelp(const wxWindow *window);
123 bool ShowHelp(wxWindowBase *window);
124 void AddHelp(wxWindowBase *window, const wxString& text);
125 %name(AddHelpById)void AddHelp(wxWindowID id, const wxString& text);
127 %addmethods { void Destroy() { delete self; } }
132 //----------------------------------------------------------------------
134 class wxSimpleHelpProvider : public wxHelpProvider
137 wxSimpleHelpProvider();
141 //----------------------------------------------------------------------
143 // TODO: Add this once the wxHelpController is in wxPython...
145 // class WXDLLEXPORT wxHelpControllerHelpProvider : public wxSimpleHelpProvider
148 // wxHelpControllerHelpProvider(wxHelpController* hc = NULL);
149 // void SetHelpController(wxHelpController* hc);
150 // wxHelpController* GetHelpController();
156 //----------------------------------------------------------------------
157 //----------------------------------------------------------------------
158 // This file gets appended to the shadow class file.
159 //----------------------------------------------------------------------
161 %pragma(python) include="_helpextras.py";
163 //---------------------------------------------------------------------------