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);
116 //----------------------------------------------------------------------
121 static wxHelpProvider *Set(wxHelpProvider *helpProvider);
122 static wxHelpProvider *Get();
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);
130 %addmethods { void Destroy() { delete self; } }
135 //----------------------------------------------------------------------
137 class wxSimpleHelpProvider : public wxHelpProvider
140 wxSimpleHelpProvider();
144 //----------------------------------------------------------------------
146 // TODO: Add this once the wxHelpController is in wxPython...
148 // class WXDLLEXPORT wxHelpControllerHelpProvider : public wxSimpleHelpProvider
151 // wxHelpControllerHelpProvider(wxHelpController* hc = NULL);
152 // void SetHelpController(wxHelpController* hc);
153 // wxHelpController* GetHelpController();
159 //----------------------------------------------------------------------
160 //----------------------------------------------------------------------
161 // This file gets appended to the shadow class file.
162 //----------------------------------------------------------------------
164 %pragma(python) include="_helpextras.py";
166 //---------------------------------------------------------------------------