]> git.saurik.com Git - wxWidgets.git/blame - include/wx/html/helpfrm.h
fix the bug with the current path being restored if it was under the group being...
[wxWidgets.git] / include / wx / html / helpfrm.h
CommitLineData
8ec2b484
HH
1/////////////////////////////////////////////////////////////////////////////
2// Name: helpfrm.h
3// Purpose: wxHtmlHelpFrame
f42b1601 4// Notes: Based on htmlhelp.cpp, implementing a monolithic
8ec2b484
HH
5// HTML Help controller class, by Vaclav Slavik
6// Author: Harm van der Heijden and Vaclav Slavik
69941f05 7// RCS-ID: $Id$
8ec2b484 8// Copyright: (c) Harm van der Heijden and Vaclav Slavik
65571936 9// Licence: wxWindows licence
8ec2b484
HH
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_HELPFRM_H_
13#define _WX_HELPFRM_H_
14
8ec2b484
HH
15#include "wx/defs.h"
16
3379ed37 17#if wxUSE_WXHTML_HELP
8ec2b484 18
69b5cec2 19#include "wx/helpbase.h"
16a12a3d 20#include "wx/html/helpdata.h"
8ec2b484
HH
21#include "wx/window.h"
22#include "wx/frame.h"
23#include "wx/config.h"
24#include "wx/splitter.h"
25#include "wx/notebook.h"
26#include "wx/listbox.h"
27#include "wx/choice.h"
382e6efe 28#include "wx/combobox.h"
c4971147 29#include "wx/checkbox.h"
240c2873 30#include "wx/stattext.h"
8ec2b484 31#include "wx/html/htmlwin.h"
4e1ed07b 32#include "wx/html/helpwnd.h"
0646614d 33#include "wx/html/htmprint.h"
2b5f62a0 34
6acba9a7
VS
35class WXDLLIMPEXP_CORE wxButton;
36class WXDLLIMPEXP_CORE wxTextCtrl;
46674ada
VZ
37class WXDLLIMPEXP_CORE wxTreeEvent;
38class WXDLLIMPEXP_CORE wxTreeCtrl;
8ec2b484 39
d5bb85a0 40
8ec2b484 41// style flags for the Help Frame
576507e2
VS
42#define wxHF_TOOLBAR 0x0001
43#define wxHF_CONTENTS 0x0002
44#define wxHF_INDEX 0x0004
45#define wxHF_SEARCH 0x0008
46#define wxHF_BOOKMARKS 0x0010
47#define wxHF_OPEN_FILES 0x0020
48#define wxHF_PRINT 0x0040
49#define wxHF_FLAT_TOOLBAR 0x0080
50#define wxHF_MERGE_BOOKS 0x0100
51#define wxHF_ICONS_BOOK 0x0200
52#define wxHF_ICONS_BOOK_CHAPTER 0x0400
53#define wxHF_ICONS_FOLDER 0x0000 // this is 0 since it is default
54#define wxHF_DEFAULT_STYLE (wxHF_TOOLBAR | wxHF_CONTENTS | \
55 wxHF_INDEX | wxHF_SEARCH | \
56 wxHF_BOOKMARKS | wxHF_PRINT)
57//compatibility:
58#define wxHF_OPENFILES wxHF_OPEN_FILES
59#define wxHF_FLATTOOLBAR wxHF_FLAT_TOOLBAR
60#define wxHF_DEFAULTSTYLE wxHF_DEFAULT_STYLE
8ec2b484 61
9817a085 62struct wxHtmlHelpMergedIndexItem;
08300277 63class wxHtmlHelpMergedIndex;
d5bb85a0 64
6acba9a7 65class WXDLLIMPEXP_CORE wxHelpControllerBase;
3755cfa6
JS
66class WXDLLIMPEXP_HTML wxHtmlHelpController;
67class WXDLLIMPEXP_CORE wxHtmlHelpWindow;
b31ba288 68
6acba9a7 69class WXDLLIMPEXP_HTML wxHtmlHelpFrame : public wxFrame
8ec2b484 70{
97494971
VS
71 DECLARE_DYNAMIC_CLASS(wxHtmlHelpFrame)
72
73public:
74 wxHtmlHelpFrame(wxHtmlHelpData* data = NULL) { Init(data); }
75 wxHtmlHelpFrame(wxWindow* parent, wxWindowID wxWindowID,
76 const wxString& title = wxEmptyString,
576507e2 77 int style = wxHF_DEFAULT_STYLE, wxHtmlHelpData* data = NULL);
97494971 78 bool Create(wxWindow* parent, wxWindowID id, const wxString& title = wxEmptyString,
576507e2 79 int style = wxHF_DEFAULT_STYLE);
97494971
VS
80 ~wxHtmlHelpFrame();
81
3755cfa6 82 /// Returns the data associated with the window.
97494971 83 wxHtmlHelpData* GetData() { return m_Data; }
97494971 84
3755cfa6
JS
85 /// Returns the help controller associated with the window.
86 wxHtmlHelpController* GetController() const { return m_helpController; }
97494971 87
3755cfa6
JS
88 /// Sets the help controller associated with the window.
89 void SetController(wxHtmlHelpController* controller) { m_helpController = controller; }
dabbc6a5 90
3755cfa6
JS
91 /// Returns the help window.
92 wxHtmlHelpWindow* GetHelpWindow() const { return m_HtmlHelpWin; }
97494971 93
3755cfa6
JS
94 // Sets format of title of the frame. Must contain exactly one "%s"
95 // (for title of displayed HTML page)
96 void SetTitleFormat(const wxString& format);
97494971 97
3755cfa6
JS
98 // For compatibility
99 void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString);
97494971 100
3755cfa6
JS
101 // Make the help controller's frame 'modal' if
102 // needed
103 void AddGrabIfNeeded();
08300277 104
3755cfa6
JS
105 // Override to add custom buttons to the toolbar
106 virtual void AddToolbarButtons(wxToolBar* WXUNUSED(toolBar), int WXUNUSED(style)) {};
97494971 107
65afac3f
VZ
108 // we don't want to prevent the app from closing just because a help window
109 // remains opened
110 virtual bool ShouldPreventAppExit() const { return false; }
111
171a1afe 112protected:
3755cfa6 113 void Init(wxHtmlHelpData* data = NULL);
97494971 114
97494971 115 void OnCloseWindow(wxCloseEvent& event);
d45bc436 116 void OnActivate(wxActivateEvent& event);
97494971 117
d9b21c9f 118#ifdef __WXMAC__
4aa31786 119 void OnClose(wxCommandEvent& event);
d9b21c9f
JS
120 void OnAbout(wxCommandEvent& event);
121#endif
122
97494971
VS
123 // Images:
124 enum {
125 IMG_Book = 0,
126 IMG_Folder,
07e252a5 127 IMG_Page
97494971
VS
128 };
129
130protected:
131 wxHtmlHelpData* m_Data;
132 bool m_DataCreated; // m_Data created by frame, or supplied?
133 wxString m_TitleFormat; // title of the help frame
3755cfa6
JS
134 wxHtmlHelpWindow *m_HtmlHelpWin;
135 wxHtmlHelpController* m_helpController;
d5bb85a0 136
08300277 137private:
6953da00 138
97494971 139 DECLARE_EVENT_TABLE()
22f3361e 140 DECLARE_NO_COPY_CLASS(wxHtmlHelpFrame)
8ec2b484
HH
141};
142
3379ed37 143#endif // wxUSE_WXHTML_HELP
8ec2b484
HH
144
145#endif