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,
44 %pragma(python) code = "
46 def EVT_HELP(win, id, func):
47 win.Connect(id, -1, wxEVT_HELP, func)
49 def EVT_HELP_RANGE(win, id, id2, func):
50 win.Connect(id, id2, wxEVT_HELP, func)
52 def EVT_DETAILED_HELP(win, id, func):
53 win.Connect(id, -1, wxEVT_DETAILED_HELP, func)
55 def EVT_DETAILED_HELP_RANGE(win, id, id2, func):
56 win.Connect(id, id2, wxEVT_DETAILED_HELP, func)
58 def EVT_CONTEXT_MENU(win, func):
59 win.Connect(-1, -1, wxEVT_CONTEXT_MENU, func)
62 //----------------------------------------------------------------------
64 class wxHelpEvent : public wxCommandEvent
67 wxHelpEvent(wxEventType type = wxEVT_NULL,
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);
78 //---------------------------------------------------------------------------
81 class wxContextMenuEvent : public wxCommandEvent
84 wxContextMenuEvent(wxEventType type = wxEVT_NULL,
86 const wxPoint& pt = wxDefaultPosition);
87 const wxPoint& GetPosition();
88 void SetPosition(const wxPoint& pos);
93 //----------------------------------------------------------------------
95 class wxContextHelp : public wxObject {
97 wxContextHelp(wxWindow* window = NULL, bool doNow = TRUE);
100 bool BeginContextHelp(wxWindow* window = NULL);
101 bool EndContextHelp();
105 //----------------------------------------------------------------------
107 class wxContextHelpButton : public wxBitmapButton {
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)"
117 //----------------------------------------------------------------------
122 static wxHelpProvider *Set(wxHelpProvider *helpProvider);
123 static wxHelpProvider *Get();
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);
131 %addmethods { void Destroy() { delete self; } }
136 //----------------------------------------------------------------------
138 class wxSimpleHelpProvider : public wxHelpProvider
141 wxSimpleHelpProvider();
145 //----------------------------------------------------------------------
147 // TODO: Add this once the wxHelpController is in wxPython...
149 // class WXDLLEXPORT wxHelpControllerHelpProvider : public wxSimpleHelpProvider
152 // wxHelpControllerHelpProvider(wxHelpController* hc = NULL);
153 // void SetHelpController(wxHelpController* hc);
154 // wxHelpController* GetHelpController();
160 //----------------------------------------------------------------------
161 //----------------------------------------------------------------------
162 // This file gets appended to the shadow class file.
163 //----------------------------------------------------------------------
165 %pragma(python) include="_helpextras.py";
167 //---------------------------------------------------------------------------