1999-09-12 13:45:34 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: helpfrm.h
|
|
|
|
// Purpose: wxHtmlHelpFrame
|
1999-09-13 01:27:36 -04:00
|
|
|
// Notes: Based on htmlhelp.cpp, implementing a monolithic
|
1999-09-12 13:45:34 -04:00
|
|
|
// HTML Help controller class, by Vaclav Slavik
|
|
|
|
// Author: Harm van der Heijden and Vaclav Slavik
|
1999-10-02 14:19:46 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-09-12 13:45:34 -04:00
|
|
|
// Copyright: (c) Harm van der Heijden and Vaclav Slavik
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-09-12 13:45:34 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_HELPFRM_H_
|
|
|
|
#define _WX_HELPFRM_H_
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2001-07-03 15:38:19 -04:00
|
|
|
#if wxUSE_WXHTML_HELP
|
1999-09-12 13:45:34 -04:00
|
|
|
|
2003-09-09 13:29:11 -04:00
|
|
|
#include "wx/helpbase.h"
|
1999-10-25 16:03:39 -04:00
|
|
|
#include "wx/html/helpdata.h"
|
1999-09-12 13:45:34 -04:00
|
|
|
#include "wx/window.h"
|
|
|
|
#include "wx/frame.h"
|
|
|
|
#include "wx/config.h"
|
|
|
|
#include "wx/splitter.h"
|
|
|
|
#include "wx/notebook.h"
|
|
|
|
#include "wx/listbox.h"
|
|
|
|
#include "wx/choice.h"
|
1999-12-05 14:36:20 -05:00
|
|
|
#include "wx/combobox.h"
|
2000-01-16 10:53:25 -05:00
|
|
|
#include "wx/checkbox.h"
|
2000-01-15 19:32:13 -05:00
|
|
|
#include "wx/stattext.h"
|
1999-09-12 13:45:34 -04:00
|
|
|
#include "wx/html/htmlwin.h"
|
2006-01-11 04:00:33 -05:00
|
|
|
#include "wx/html/helpwnd.h"
|
2000-01-25 19:49:30 -05:00
|
|
|
#include "wx/html/htmprint.h"
|
2002-12-04 09:11:26 -05:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxButton;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxTreeEvent;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxTreeCtrl;
|
1999-09-12 13:45:34 -04:00
|
|
|
|
1999-10-27 19:26:24 -04:00
|
|
|
|
1999-09-12 13:45:34 -04:00
|
|
|
// style flags for the Help Frame
|
2001-05-05 14:05:57 -04:00
|
|
|
#define wxHF_TOOLBAR 0x0001
|
|
|
|
#define wxHF_CONTENTS 0x0002
|
|
|
|
#define wxHF_INDEX 0x0004
|
|
|
|
#define wxHF_SEARCH 0x0008
|
|
|
|
#define wxHF_BOOKMARKS 0x0010
|
|
|
|
#define wxHF_OPEN_FILES 0x0020
|
|
|
|
#define wxHF_PRINT 0x0040
|
|
|
|
#define wxHF_FLAT_TOOLBAR 0x0080
|
|
|
|
#define wxHF_MERGE_BOOKS 0x0100
|
|
|
|
#define wxHF_ICONS_BOOK 0x0200
|
|
|
|
#define wxHF_ICONS_BOOK_CHAPTER 0x0400
|
|
|
|
#define wxHF_ICONS_FOLDER 0x0000 // this is 0 since it is default
|
|
|
|
#define wxHF_DEFAULT_STYLE (wxHF_TOOLBAR | wxHF_CONTENTS | \
|
|
|
|
wxHF_INDEX | wxHF_SEARCH | \
|
|
|
|
wxHF_BOOKMARKS | wxHF_PRINT)
|
|
|
|
//compatibility:
|
|
|
|
#define wxHF_OPENFILES wxHF_OPEN_FILES
|
|
|
|
#define wxHF_FLATTOOLBAR wxHF_FLAT_TOOLBAR
|
|
|
|
#define wxHF_DEFAULTSTYLE wxHF_DEFAULT_STYLE
|
1999-09-12 13:45:34 -04:00
|
|
|
|
2004-06-30 11:35:14 -04:00
|
|
|
struct wxHtmlHelpMergedIndexItem;
|
2004-06-29 03:16:51 -04:00
|
|
|
class wxHtmlHelpMergedIndex;
|
1999-10-27 19:26:24 -04:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxHelpControllerBase;
|
|
|
|
class WXDLLIMPEXP_FWD_HTML wxHtmlHelpController;
|
2007-11-23 09:13:50 -05:00
|
|
|
class WXDLLIMPEXP_FWD_HTML wxHtmlHelpWindow;
|
1999-09-13 09:16:28 -04:00
|
|
|
|
2003-07-04 09:04:05 -04:00
|
|
|
class WXDLLIMPEXP_HTML wxHtmlHelpFrame : public wxFrame
|
1999-09-12 13:45:34 -04:00
|
|
|
{
|
2001-04-29 13:57:59 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxHtmlHelpFrame)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxHtmlHelpFrame(wxHtmlHelpData* data = NULL) { Init(data); }
|
|
|
|
wxHtmlHelpFrame(wxWindow* parent, wxWindowID wxWindowID,
|
|
|
|
const wxString& title = wxEmptyString,
|
2006-10-23 21:16:18 -04:00
|
|
|
int style = wxHF_DEFAULT_STYLE, wxHtmlHelpData* data = NULL,
|
|
|
|
wxConfigBase *config=NULL, const wxString& rootpath = wxEmptyString);
|
2001-04-29 13:57:59 -04:00
|
|
|
bool Create(wxWindow* parent, wxWindowID id, const wxString& title = wxEmptyString,
|
2006-10-23 21:16:18 -04:00
|
|
|
int style = wxHF_DEFAULT_STYLE,
|
|
|
|
wxConfigBase *config=NULL, const wxString& rootpath = wxEmptyString);
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxHtmlHelpFrame();
|
2001-04-29 13:57:59 -04:00
|
|
|
|
2006-01-09 08:42:57 -05:00
|
|
|
/// Returns the data associated with the window.
|
2001-04-29 13:57:59 -04:00
|
|
|
wxHtmlHelpData* GetData() { return m_Data; }
|
|
|
|
|
2006-01-09 08:42:57 -05:00
|
|
|
/// Returns the help controller associated with the window.
|
|
|
|
wxHtmlHelpController* GetController() const { return m_helpController; }
|
2001-04-29 13:57:59 -04:00
|
|
|
|
2006-01-09 08:42:57 -05:00
|
|
|
/// Sets the help controller associated with the window.
|
2008-03-13 19:42:57 -04:00
|
|
|
void SetController(wxHtmlHelpController* controller);
|
2004-06-12 19:44:08 -04:00
|
|
|
|
2006-01-09 08:42:57 -05:00
|
|
|
/// Returns the help window.
|
|
|
|
wxHtmlHelpWindow* GetHelpWindow() const { return m_HtmlHelpWin; }
|
2001-04-29 13:57:59 -04:00
|
|
|
|
2006-01-09 08:42:57 -05:00
|
|
|
// Sets format of title of the frame. Must contain exactly one "%s"
|
|
|
|
// (for title of displayed HTML page)
|
|
|
|
void SetTitleFormat(const wxString& format);
|
2001-04-29 13:57:59 -04:00
|
|
|
|
2006-01-09 08:42:57 -05:00
|
|
|
// For compatibility
|
|
|
|
void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString);
|
2001-04-29 13:57:59 -04:00
|
|
|
|
2006-01-09 08:42:57 -05:00
|
|
|
// Make the help controller's frame 'modal' if
|
|
|
|
// needed
|
|
|
|
void AddGrabIfNeeded();
|
2004-06-29 03:16:51 -04:00
|
|
|
|
2006-01-09 08:42:57 -05:00
|
|
|
// Override to add custom buttons to the toolbar
|
2007-04-14 05:58:37 -04:00
|
|
|
virtual void AddToolbarButtons(wxToolBar* WXUNUSED(toolBar), int WXUNUSED(style)) {}
|
2001-04-29 13:57:59 -04:00
|
|
|
|
2006-04-06 20:38:49 -04:00
|
|
|
// we don't want to prevent the app from closing just because a help window
|
|
|
|
// remains opened
|
2008-03-13 19:58:32 -04:00
|
|
|
virtual bool ShouldPreventAppExit() const { return false; }
|
2006-04-06 20:38:49 -04:00
|
|
|
|
2006-04-11 20:47:36 -04:00
|
|
|
protected:
|
2006-01-09 08:42:57 -05:00
|
|
|
void Init(wxHtmlHelpData* data = NULL);
|
2001-04-29 13:57:59 -04:00
|
|
|
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
2002-05-25 05:40:17 -04:00
|
|
|
void OnActivate(wxActivateEvent& event);
|
2001-04-29 13:57:59 -04:00
|
|
|
|
2003-01-16 07:26:09 -05:00
|
|
|
#ifdef __WXMAC__
|
2003-01-17 19:03:59 -05:00
|
|
|
void OnClose(wxCommandEvent& event);
|
2003-01-16 07:26:09 -05:00
|
|
|
void OnAbout(wxCommandEvent& event);
|
|
|
|
#endif
|
|
|
|
|
2001-04-29 13:57:59 -04:00
|
|
|
// Images:
|
|
|
|
enum {
|
|
|
|
IMG_Book = 0,
|
|
|
|
IMG_Folder,
|
2002-03-21 18:40:28 -05:00
|
|
|
IMG_Page
|
2001-04-29 13:57:59 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
protected:
|
|
|
|
wxHtmlHelpData* m_Data;
|
|
|
|
bool m_DataCreated; // m_Data created by frame, or supplied?
|
|
|
|
wxString m_TitleFormat; // title of the help frame
|
2006-01-09 08:42:57 -05:00
|
|
|
wxHtmlHelpWindow *m_HtmlHelpWin;
|
|
|
|
wxHtmlHelpController* m_helpController;
|
1999-10-27 19:26:24 -04:00
|
|
|
|
2004-06-29 03:16:51 -04:00
|
|
|
private:
|
2004-09-27 15:06:39 -04:00
|
|
|
|
2001-04-29 13:57:59 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxHtmlHelpFrame);
|
1999-09-12 13:45:34 -04:00
|
|
|
};
|
|
|
|
|
2001-07-03 15:38:19 -04:00
|
|
|
#endif // wxUSE_WXHTML_HELP
|
1999-09-12 13:45:34 -04:00
|
|
|
|
|
|
|
#endif
|