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 /////////////////////////////////////////////////////////////////////////////
15 //---------------------------------------------------------------------------
21 //----------------------------------------------------------------------
24 wxFRAME_EX_CONTEXTHELP,
25 wxDIALOG_EX_CONTEXTHELP,
27 %constant wxEventType wxEVT_HELP;
28 %constant wxEventType wxEVT_DETAILED_HELP;
32 EVT_HELP = wx.PyEventBinder( wxEVT_HELP, 1)
33 EVT_HELP_RANGE = wx.PyEventBinder( wxEVT_HELP, 2)
34 EVT_DETAILED_HELP = wx.PyEventBinder( wxEVT_DETAILED_HELP, 1)
35 EVT_DETAILED_HELP_RANGE = wx.PyEventBinder( wxEVT_DETAILED_HELP, 2)
38 //----------------------------------------------------------------------
40 // A help event is sent when the user clicks on a window in context-help mode.
42 class wxHelpEvent : public wxCommandEvent
45 wxHelpEvent(wxEventType type = wxEVT_NULL,
47 const wxPoint& pt = wxDefaultPosition);
49 // Position of event (in screen coordinates)
50 const wxPoint& GetPosition() const;
51 void SetPosition(const wxPoint& pos);
53 // Optional link to further help
54 const wxString& GetLink() const;
55 void SetLink(const wxString& link);
57 // Optional target to display help in. E.g. a window specification
58 const wxString& GetTarget() const;
59 void SetTarget(const wxString& target);
62 //---------------------------------------------------------------------------
64 class wxContextHelp : public wxObject {
66 wxContextHelp(wxWindow* window = NULL, bool doNow = True);
69 bool BeginContextHelp(wxWindow* window = NULL);
70 bool EndContextHelp();
74 //----------------------------------------------------------------------
76 class wxContextHelpButton : public wxBitmapButton {
78 %addtofunc wxContextHelpButton "self._setOORInfo(self)"
80 wxContextHelpButton(wxWindow* parent, wxWindowID id = wxID_CONTEXT_HELP,
81 const wxPoint& pos = wxDefaultPosition,
82 const wxSize& size = wxDefaultSize,
83 long style = wxBU_AUTODRAW);
87 //----------------------------------------------------------------------
92 static wxHelpProvider *Set(wxHelpProvider *helpProvider);
93 static wxHelpProvider *Get();
96 wxString GetHelp(const wxWindow *window);
97 bool ShowHelp(wxWindow *window);
98 void AddHelp(wxWindow *window, const wxString& text);
99 %name(AddHelpById)void AddHelp(wxWindowID id, const wxString& text);
101 %extend { void Destroy() { delete self; } }
106 //----------------------------------------------------------------------
108 class wxSimpleHelpProvider : public wxHelpProvider
111 wxSimpleHelpProvider();
115 //----------------------------------------------------------------------
117 // TODO: Add this once the wxHelpController is in wxPython...
119 // class WXDLLEXPORT wxHelpControllerHelpProvider : public wxSimpleHelpProvider
122 // wxHelpControllerHelpProvider(wxHelpController* hc = NULL);
123 // void SetHelpController(wxHelpController* hc);
124 // wxHelpController* GetHelpController();
130 //----------------------------------------------------------------------
131 //---------------------------------------------------------------------------