X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fadc2df6823d988f7a264b94e69a7e1bbcac1337..d3fa4bc22e84e3ca4d88cc1772f2d414140a1017:/interface/wx/html/helpctrl.h?ds=sidebyside diff --git a/interface/wx/html/helpctrl.h b/interface/wx/html/helpctrl.h index 006cc238c5..a784927cdf 100644 --- a/interface/wx/html/helpctrl.h +++ b/interface/wx/html/helpctrl.h @@ -3,9 +3,27 @@ // Purpose: interface of wxHtmlHelpController // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#define wxID_HTML_HELPFRAME (wxID_HIGHEST + 1) + +/// This style indicates that the window is +/// embedded in the application and must not be +/// destroyed by the help controller. +#define wxHF_EMBEDDED 0x00008000 + +/// Create a dialog for the help window. +#define wxHF_DIALOG 0x00010000 + +/// Create a frame for the help window. +#define wxHF_FRAME 0x00020000 + +/// Make the dialog modal when displaying help. +#define wxHF_MODAL 0x00040000 + + + /** @class wxHtmlHelpController @@ -37,7 +55,7 @@ @see wxBestHelpController, wxHtmlHelpFrame, wxHtmlHelpDialog, wxHtmlHelpWindow, wxHtmlModalHelp */ -class wxHtmlHelpController +class wxHtmlHelpController : public wxHelpControllerBase { public: /** @@ -79,6 +97,8 @@ public: */ wxHtmlHelpController(int style = wxHF_DEFAULT_STYLE, wxWindow* parentWindow = NULL); + wxHtmlHelpController(wxWindow* parentWindow, int style = wxHF_DEFAULT_STYLE); + /** Adds a book (i.e. a @ref overview_html_helpformats ".hhp file"; an HTML Help @@ -101,7 +121,7 @@ public: @param showWaitMsg If @true then a decoration-less window with progress message is displayed. */ - bool AddBook(const wxFileName& bookFile, bool showWaitMsg); + bool AddBook(const wxFileName& bookFile, bool showWaitMsg = false); /** Adds a book (i.e. a @ref overview_html_helpformats ".hhp file"; an HTML Help @@ -115,19 +135,7 @@ public: @param showWaitMsg If @true then a decoration-less window with progress message is displayed. */ - bool AddBook(const wxString& bookUrl, bool showWaitMsg); - - /** - This protected virtual method may be overridden so that when specifying the - @c wxHF_DIALOG style, the controller uses a different dialog. - */ - virtual wxHtmlHelpDialog* CreateHelpDialog(wxHtmlHelpData* data); - - /** - This protected virtual method may be overridden so that the controller - uses a different frame. - */ - virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData* data); + bool AddBook(const wxString& bookUrl, bool showWaitMsg = false); /** Displays page @a x. @@ -145,24 +153,24 @@ public: -# try to find x in index (if x is for example "How To ...") -# switch to Search panel and start searching */ - void Display(const wxString& x); + bool Display(const wxString& x); /** @overload This alternative form is used to search help contents by numeric IDs. */ - void Display(const int id); + bool Display(int id); /** Displays help window and focuses contents panel. */ - void DisplayContents(); + virtual bool DisplayContents(); /** Displays help window and focuses index panel. */ - void DisplayIndex(); + bool DisplayIndex(); /** Displays the help window, focuses search panel and starts searching. @@ -180,8 +188,23 @@ public: /** Reads the controller's setting (position of window, etc.) */ - void ReadCustomization(wxConfigBase* cfg, - wxString path = wxEmptyString); + virtual void ReadCustomization(wxConfigBase* cfg, + const wxString& path = wxEmptyString); + + /** + Sets whether the help frame should prevent application from exiting + if it's the only remaining top level window. + + @enable + If @true, the application will not quit unless the help frame is + closed. Default is @false, i.e. the application does exit if only + the help window remains opened. + + @see wxApp::SetExitOnFrameDelete() + + @since 2.9.2 + */ + void SetShouldPreventAppExit(bool enable); /** Sets the path for storing temporary files - cached binary versions of index and @@ -220,8 +243,47 @@ public: /** Stores controllers setting (position of window etc.) */ - void WriteCustomization(wxConfigBase* cfg, - wxString path = wxEmptyString); + virtual void WriteCustomization(wxConfigBase* cfg, + const wxString& path = wxEmptyString); + + /** + Get the current help window + */ + wxHtmlHelpWindow* GetHelpWindow(); + + /** + Set the help window to be managed by this controller. This makes it + possible to have a help window that might not be in a wxHtmlHelpFrame or + dialog but is embedded in some other window in the application. Be sure + to use the wxHF_EMBEDDED style in this case. + */ + void SetHelpWindow(wxHtmlHelpWindow* helpWindow); + + /** + Returns the current help frame. (May be NULL.) + */ + wxHtmlHelpFrame* GetFrame(); + + /** + Returns the current help dialog. (May be NULL.) + */ + wxHtmlHelpDialog* GetDialog(); + + + +protected: + + /** + This protected virtual method may be overridden so that when specifying the + @c wxHF_DIALOG style, the controller uses a different dialog. + */ + virtual wxHtmlHelpDialog* CreateHelpDialog(wxHtmlHelpData* data); + + /** + This protected virtual method may be overridden so that the controller + uses a different frame. + */ + virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData* data); }; @@ -238,7 +300,7 @@ public: @code // The help can be browsed during the lifetime of this object; when the // user quits the help, program execution will continue. - wxHtmlModalHelp help(parent, wxT("help"), wxT("My topic")); + wxHtmlModalHelp help(parent, "help", "My topic"); @endcode @library{wxhtml}