]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/modules/html/helpsys.h
1 /* htmlsys.h : wxHtmlHelpSystem is an extension of the wxHtmlHelpController.
2 * mainly does two things:
3 * - extend the interface somewhat so the programmer can dictate most of the
4 * look and feel of the htmlhelp frame.
5 * - make some protected functions public (adding _ to the function name) so
6 * that SWIG can wrap them.
8 * Harm van der Heijden 32aug1999
16 #error "wxHtml needed"
19 #include <wx/toolbar.h>
20 #include "wx/listbox.h"
21 #include <wx/html/htmlhelp.h>
23 class wxHtmlHelpSystem
: public wxHtmlHelpController
25 DECLARE_DYNAMIC_CLASS(wxHtmlHelpSystem
)
28 wxHtmlHelpSystem() {};
29 ~wxHtmlHelpSystem() {};
31 bool AddBookParam(const wxString
& title
, const wxString
& contfile
,
32 const wxString
& indexfile
=wxEmptyString
, const wxString
& deftopic
=wxEmptyString
,
33 const wxString
& path
=wxEmptyString
, bool show_wait_msg
=FALSE
);
34 // Alternative to AddBook(wxString& hhpfile)
35 wxToolBar
* CreateToolBar(wxFrame
* frame
);
36 // creates a dockable toolbar for the frame, containing hide/show, back and forward buttons
37 wxTreeCtrl
* CreateContentsTree(wxWindow
* parent
);
38 // creates a treecontrol with imagelist for books, folders etc and id wxID_HTML_TREECTRL
39 wxListBox
* CreateIndexList(wxWindow
* parent
);
40 // creates a listbox with the right id
41 virtual void CreateHelpWindow();
42 // Slightly different version than in wxHtmlHelpController; uses helpers above
43 // Do nothing if the window already exists
44 void SetControls(wxFrame
* frame
, wxHtmlWindow
* htmlwin
,
45 wxTreeCtrl
* contents
=NULL
, wxListBox
* index
=NULL
,
46 wxListBox
* searchlist
=NULL
);
47 // alternative for CreateHelpWindow(), sets frame, htmlwindow, contents tree, index
48 // listbox and searchlist listbox. If null, their functionality won't be used
50 // Some extra accessor functions
51 wxFrame
* GetFrame() { return m_Frame
; }
52 wxHtmlWindow
* GetHtmlWindow() { return m_HtmlWin
; }
53 wxTreeCtrl
* GetContentsTree() { return m_ContentsBox
; }
54 wxListBox
* GetIndexList() { return m_IndexBox
; }
55 wxListBox
* GetSearchList() { return m_SearchList
; }
56 wxImageList
* GetContentsImageList() { return m_ContentsImageList
; }
57 // public interface for wxHtmlHelpControllers handlers, so wxPython can call them
58 void OnToolbar(wxCommandEvent
& event
);
59 void OnContentsSel(wxTreeEvent
& event
) {wxHtmlHelpController::OnContentsSel(event
);}
60 void OnIndexSel(wxCommandEvent
& event
) {wxHtmlHelpController::OnIndexSel(event
);}
61 void OnSearchSel(wxCommandEvent
& event
) {wxHtmlHelpController::OnSearchSel(event
);}
62 void OnSearch(wxCommandEvent
& event
) {wxHtmlHelpController::OnSearch(event
);}
63 void OnCloseWindow(wxCloseEvent
& event
);
65 // some more protected functions that should be accessible from wxPython
67 void CreateContents() { if (!m_ContentsBox
) return; wxHtmlHelpController::CreateContents(); }
68 // Adds items to m_Contents tree control
69 void CreateIndex() { if (! m_IndexBox
) return; wxHtmlHelpController::CreateIndex(); }
70 // Adds items to m_IndexList