1999-09-12 17:45:34 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: helpfrm.h
|
|
|
|
// Purpose: wxHtmlHelpFrame
|
1999-09-13 05:27:36 +00:00
|
|
|
// Notes: Based on htmlhelp.cpp, implementing a monolithic
|
1999-09-12 17:45:34 +00:00
|
|
|
// HTML Help controller class, by Vaclav Slavik
|
|
|
|
// Author: Harm van der Heijden and Vaclav Slavik
|
1999-10-02 18:19:46 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-09-12 17:45:34 +00:00
|
|
|
// Copyright: (c) Harm van der Heijden and Vaclav Slavik
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-09-12 17:45:34 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_HELPFRM_H_
|
|
|
|
#define _WX_HELPFRM_H_
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2001-07-03 19:38:19 +00:00
|
|
|
#if wxUSE_WXHTML_HELP
|
1999-09-12 17:45:34 +00:00
|
|
|
|
2003-09-09 17:29:11 +00:00
|
|
|
#include "wx/helpbase.h"
|
1999-10-25 20:03:39 +00:00
|
|
|
#include "wx/html/helpdata.h"
|
1999-09-12 17:45:34 +00: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 19:36:20 +00:00
|
|
|
#include "wx/combobox.h"
|
2000-01-16 15:53:25 +00:00
|
|
|
#include "wx/checkbox.h"
|
2000-01-16 00:32:13 +00:00
|
|
|
#include "wx/stattext.h"
|
1999-09-12 17:45:34 +00:00
|
|
|
#include "wx/html/htmlwin.h"
|
2006-01-11 09:00:33 +00:00
|
|
|
#include "wx/html/helpwnd.h"
|
2000-01-26 00:49:30 +00:00
|
|
|
#include "wx/html/htmprint.h"
|
2002-12-04 14:11:26 +00:00
|
|
|
|
2003-07-04 13:04:05 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxButton;
|
|
|
|
class WXDLLIMPEXP_CORE wxTextCtrl;
|
2003-07-19 21:01:58 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxTreeEvent;
|
|
|
|
class WXDLLIMPEXP_CORE wxTreeCtrl;
|
1999-09-12 17:45:34 +00:00
|
|
|
|
1999-10-27 23:26:24 +00:00
|
|
|
|
1999-09-12 17:45:34 +00:00
|
|
|
// style flags for the Help Frame
|
2001-05-05 18:05:57 +00: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 17:45:34 +00:00
|
|
|
|
2004-06-30 15:35:14 +00:00
|
|
|
struct wxHtmlHelpMergedIndexItem;
|
2004-06-29 07:16:51 +00:00
|
|
|
class wxHtmlHelpMergedIndex;
|
1999-10-27 23:26:24 +00:00
|
|
|
|
2003-07-04 13:04:05 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxHelpControllerBase;
|
2006-01-09 13:42:57 +00:00
|
|
|
class WXDLLIMPEXP_HTML wxHtmlHelpController;
|
|
|
|
class WXDLLIMPEXP_CORE wxHtmlHelpWindow;
|
1999-09-13 13:16:28 +00:00
|
|
|
|
2003-07-04 13:04:05 +00:00
|
|
|
class WXDLLIMPEXP_HTML wxHtmlHelpFrame : public wxFrame
|
1999-09-12 17:45:34 +00:00
|
|
|
{
|
2001-04-29 17:57:59 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxHtmlHelpFrame)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxHtmlHelpFrame(wxHtmlHelpData* data = NULL) { Init(data); }
|
|
|
|
wxHtmlHelpFrame(wxWindow* parent, wxWindowID wxWindowID,
|
|
|
|
const wxString& title = wxEmptyString,
|
2006-10-24 01:16:18 +00:00
|
|
|
int style = wxHF_DEFAULT_STYLE, wxHtmlHelpData* data = NULL,
|
|
|
|
wxConfigBase *config=NULL, const wxString& rootpath = wxEmptyString);
|
2001-04-29 17:57:59 +00:00
|
|
|
bool Create(wxWindow* parent, wxWindowID id, const wxString& title = wxEmptyString,
|
2006-10-24 01:16:18 +00:00
|
|
|
int style = wxHF_DEFAULT_STYLE,
|
|
|
|
wxConfigBase *config=NULL, const wxString& rootpath = wxEmptyString);
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxHtmlHelpFrame();
|
2001-04-29 17:57:59 +00:00
|
|
|
|
2006-01-09 13:42:57 +00:00
|
|
|
/// Returns the data associated with the window.
|
2001-04-29 17:57:59 +00:00
|
|
|
wxHtmlHelpData* GetData() { return m_Data; }
|
|
|
|
|
2006-01-09 13:42:57 +00:00
|
|
|
/// Returns the help controller associated with the window.
|
|
|
|
wxHtmlHelpController* GetController() const { return m_helpController; }
|
2001-04-29 17:57:59 +00:00
|
|
|
|
2006-01-09 13:42:57 +00:00
|
|
|
/// Sets the help controller associated with the window.
|
|
|
|
void SetController(wxHtmlHelpController* controller) { m_helpController = controller; }
|
2004-06-12 23:44:08 +00:00
|
|
|
|
2006-01-09 13:42:57 +00:00
|
|
|
/// Returns the help window.
|
|
|
|
wxHtmlHelpWindow* GetHelpWindow() const { return m_HtmlHelpWin; }
|
2001-04-29 17:57:59 +00:00
|
|
|
|
2006-01-09 13:42:57 +00: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 17:57:59 +00:00
|
|
|
|
2006-01-09 13:42:57 +00:00
|
|
|
// For compatibility
|
|
|
|
void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString);
|
2001-04-29 17:57:59 +00:00
|
|
|
|
2006-01-09 13:42:57 +00:00
|
|
|
// Make the help controller's frame 'modal' if
|
|
|
|
// needed
|
|
|
|
void AddGrabIfNeeded();
|
2004-06-29 07:16:51 +00:00
|
|
|
|
2006-01-09 13:42:57 +00:00
|
|
|
// Override to add custom buttons to the toolbar
|
|
|
|
virtual void AddToolbarButtons(wxToolBar* WXUNUSED(toolBar), int WXUNUSED(style)) {};
|
2001-04-29 17:57:59 +00:00
|
|
|
|
2006-04-07 00:38:49 +00:00
|
|
|
// we don't want to prevent the app from closing just because a help window
|
|
|
|
// remains opened
|
|
|
|
virtual bool ShouldPreventAppExit() const { return false; }
|
|
|
|
|
2006-04-12 00:47:36 +00:00
|
|
|
protected:
|
2006-01-09 13:42:57 +00:00
|
|
|
void Init(wxHtmlHelpData* data = NULL);
|
2001-04-29 17:57:59 +00:00
|
|
|
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
2002-05-25 09:40:17 +00:00
|
|
|
void OnActivate(wxActivateEvent& event);
|
2001-04-29 17:57:59 +00:00
|
|
|
|
2003-01-16 12:26:09 +00:00
|
|
|
#ifdef __WXMAC__
|
2003-01-18 00:03:59 +00:00
|
|
|
void OnClose(wxCommandEvent& event);
|
2003-01-16 12:26:09 +00:00
|
|
|
void OnAbout(wxCommandEvent& event);
|
|
|
|
#endif
|
|
|
|
|
2001-04-29 17:57:59 +00:00
|
|
|
// Images:
|
|
|
|
enum {
|
|
|
|
IMG_Book = 0,
|
|
|
|
IMG_Folder,
|
2002-03-21 23:40:28 +00:00
|
|
|
IMG_Page
|
2001-04-29 17:57:59 +00: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 13:42:57 +00:00
|
|
|
wxHtmlHelpWindow *m_HtmlHelpWin;
|
|
|
|
wxHtmlHelpController* m_helpController;
|
1999-10-27 23:26:24 +00:00
|
|
|
|
2004-06-29 07:16:51 +00:00
|
|
|
private:
|
2004-09-27 19:06:39 +00:00
|
|
|
|
2001-04-29 17:57:59 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2003-01-02 23:38:11 +00:00
|
|
|
DECLARE_NO_COPY_CLASS(wxHtmlHelpFrame)
|
1999-09-12 17:45:34 +00:00
|
|
|
};
|
|
|
|
|
2001-07-03 19:38:19 +00:00
|
|
|
#endif // wxUSE_WXHTML_HELP
|
1999-09-12 17:45:34 +00:00
|
|
|
|
|
|
|
#endif
|