first part of revisions of html/h* interface headers

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2008-10-23 13:55:07 +00:00
parent 4726bcc51b
commit c87f263ea5
5 changed files with 241 additions and 162 deletions

View File

@@ -10,71 +10,116 @@
@class wxHtmlHelpController @class wxHtmlHelpController
This help controller provides an easy way of displaying HTML help in your This help controller provides an easy way of displaying HTML help in your
application (see @e test sample). The help system is based on @b books application (see @sample{html}, test example).
(see wxHtmlHelpController::AddBook). A book is a logical
section of documentation (for example "User's Guide" or "Programmer's Guide" or
"C++ Reference" or "wxWidgets Reference"). The help controller can handle as
many books as you want.
Although this class has an API compatible with other wxWidgets The help system is based on @b books (see wxHtmlHelpController::AddBook).
help controllers as documented by wxHelpController, it A book is a logical section of documentation (for example "User's Guide" or
is recommended that you use the enhanced capabilities of wxHtmlHelpController's "Programmer's Guide" or "C++ Reference" or "wxWidgets Reference").
API. The help controller can handle as many books as you want.
Although this class has an API compatible with other wxWidgets help controllers
as documented by wxHelpController, it is recommended that you use the enhanced
capabilities of wxHtmlHelpController's API.
wxHTML uses Microsoft's HTML Help Workshop project files (.hhp, .hhk, .hhc) as wxHTML uses Microsoft's HTML Help Workshop project files (.hhp, .hhk, .hhc) as
its its native format. The file format is described in @ref overview_html_helpformats.
native format. The file format is described here(). The directory @c helpfiles in the @sample{html} contains sample project files.
Have a look at docs/html/ directory where sample project files are stored.
You can use Tex2RTF to produce these files when generating HTML, if you set @b Note that the Microsoft's HTML Help Workshop
htmlWorkshopFiles to @b @true in (http://www.microsoft.com/downloads/details.aspx?FamilyID=00535334-c8a6-452f-9aa0-d597d16580cc)
your tex2rtf.ini file. The commercial tool HelpBlocks (www.helpblocks.com) can also runs on other platforms using WINE (http://www.winehq.org/) and it can
also create these files. be used to create the .hpp, .hhk and .hhc files through a friendly GUI.
The commercial tool HelpBlocks (http://www.helpblocks.com) can also create these files.
@library{wxhtml} @library{wxhtml}
@category{help} @category{help,html}
@see @ref overview_wxhelpcontroller "Information about wxBestHelpController", @see wxBestHelpController, wxHtmlHelpFrame, wxHtmlHelpDialog,
wxHtmlHelpFrame, wxHtmlHelpDialog, wxHtmlHelpWindow, wxHtmlModalHelp wxHtmlHelpWindow, wxHtmlModalHelp
*/ */
class wxHtmlHelpController class wxHtmlHelpController
{ {
public: public:
/** /**
Constructor. Constructor.
@param style
This is a combination of these flags:
- wxHF_TOOLBAR: The help window has a toolbar.
- wxHF_FLAT_TOOLBAR: The help window has a toolbar with flat buttons (aka coolbar).
- wxHF_CONTENTS: The help window has a contents panel.
- wxHF_INDEX: The help window has an index panel.
- wxHF_SEARCH: The help window has a search panel.
- wxHF_BOOKMARKS: The help window has bookmarks controls.
- wxHF_OPEN_FILES: Allows user to open arbitrary HTML document.
- wxHF_PRINT: The toolbar contains "print" button.
- wxHF_MERGE_BOOKS: The contents pane does not show book nodes.
All books are merged together and appear as single book to the user.
- wxHF_ICONS_BOOK: All nodes in contents pane have a book icon.
This is how Microsoft's HTML help viewer behaves.
- wxHF_ICONS_FOLDER: Book nodes in contents pane have a book icon, book's
sections have a folder icon. This is the default.
- wxHF_ICONS_BOOK_CHAPTER: Both book nodes and nodes of top-level
sections of a book (i.e. chapters) have a book icon, all other sections
(sections, subsections, ...) have a folder icon.
- wxHF_EMBEDDED: Specifies that the help controller controls an embedded
window of class wxHtmlHelpWindow that should not be destroyed when
the controller is destroyed.
- wxHF_DIALOG: Specifies that the help controller should create a
dialog containing the help window.
- wxHF_FRAME: Specifies that the help controller should create a frame
containing the help window.
This is the default if neither wxHF_DIALOG nor wxHF_EMBEDDED is specified.
- wxHF_MODAL: Specifies that the help controller should create a modal
dialog containing the help window (used with the wxHF_DIALOG style).
- wxHF_DEFAULT_STYLE: wxHF_TOOLBAR | wxHF_CONTENTS | wxHF_INDEX |
wxHF_SEARCH | wxHF_BOOKMARKS | wxHF_PRINT
@param parentWindow
This is an optional window to be used as the parent for the help window.
*/ */
wxHtmlHelpController(int style = wxHF_DEFAULT_STYLE, wxHtmlHelpController(int style = wxHF_DEFAULT_STYLE,
wxWindow* parentWindow = NULL); wxWindow* parentWindow = NULL);
//@{
/** /**
Adds book (@ref overview_helpformat ".hhp file" - HTML Help Workshop project Adds a book (i.e. a @ref overview_html_helpformats ".hhp file"; an HTML Help
file) into the list of loaded books. Workshop project file) into the list of loaded books.
This must be called at least once before displaying any help.
@a bookFile or @a bookUrl may be either .hhp file or ZIP archive This must be called at least once before displaying any help.
that contains arbitrary number of .hhp files in @a bookFile or @a bookUrl may be either @c ".hhp" file or a ZIP archive
top-level directory. This ZIP archive must have .zip or .htb extension that contains an arbitrary number of @c ".hhp" files in its top-level
(the latter stands for "HTML book"). In other words, @c directory.
This ZIP archive must have @c ".zip" or @c ".htb" extension (the latter
stands for "HTML book"). In other words,
@code
AddBook(wxFileName("help.zip")) AddBook(wxFileName("help.zip"))
@endcode
is possible and is the recommended way. is possible and is the recommended way.
@param showWaitMsg
If @true then a decoration-less window with progress message is displayed.
@param bookFile @param bookFile
Help book filename. It is recommended to use this prototype Help book filename. It is recommended to use this prototype
instead of the one taking URL, because it is less error-prone. instead of the one taking URL, because it is less error-prone.
@param bookUrl @param showWaitMsg
Help book URL (note that syntax of filename and URL is If @true then a decoration-less window with progress message is displayed.
different on most platforms)
*/ */
bool AddBook(const wxFileName& bookFile, bool showWaitMsg); bool AddBook(const wxFileName& bookFile, bool showWaitMsg);
/**
Adds a book (i.e. a @ref overview_html_helpformats ".hhp file"; an HTML Help
Workshop project file) into the list of loaded books.
See the other overload for additional info.
@param bookUrl
Help book URL (note that syntax of filename and URL is
different on most platforms).
@param showWaitMsg
If @true then a decoration-less window with progress message is displayed.
*/
bool AddBook(const wxString& bookUrl, bool showWaitMsg); bool AddBook(const wxString& bookUrl, bool showWaitMsg);
//@}
/** /**
This protected virtual method may be overridden so that when specifying the This protected virtual method may be overridden so that when specifying the
wxHF_DIALOG style, the controller @c wxHF_DIALOG style, the controller uses a different dialog.
uses a different dialog.
*/ */
virtual wxHtmlHelpDialog* CreateHelpDialog(wxHtmlHelpData* data); virtual wxHtmlHelpDialog* CreateHelpDialog(wxHtmlHelpData* data);
@@ -84,13 +129,30 @@ public:
*/ */
virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData* data); virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData* data);
//@{
/** /**
This alternative form is used to search help contents by numeric IDs. Displays page @a x.
This is THE important function - it is used to display the help in application.
You can specify the page in many ways:
- as direct filename of HTML document
- as chapter name (from contents) or as a book name
- as some word from index
- even as any word (will be searched)
Looking for the page runs in these steps:
-# try to locate file named x (if x is for example "doc/howto.htm")
-# try to open starting page of book named x
-# try to find x in contents (if x is for example "How To ...")
-# 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); void Display(const wxString& x);
/**
@overload
This alternative form is used to search help contents by numeric IDs.
*/
void Display(const int id); void Display(const int id);
//@}
/** /**
Displays help window and focuses contents panel. Displays help window and focuses contents panel.
@@ -103,11 +165,14 @@ public:
void DisplayIndex(); void DisplayIndex();
/** /**
Displays help window, focuses search panel and starts searching. Returns @true Displays the help window, focuses search panel and starts searching.
if the keyword was found. Optionally it searches through the index (mode = Returns @true if the keyword was found. Optionally it searches through the
wxHELP_SEARCH_INDEX), default the content (mode = wxHELP_SEARCH_ALL). index (mode = @c wxHELP_SEARCH_INDEX), default the content
@b Important: KeywordSearch searches only pages listed in .hhc file(s). (mode = @c wxHELP_SEARCH_ALL).
You should list all pages in the contents file.
@note
KeywordSearch() searches only pages listed in @c ".hhc" file(s).
You should list all pages in the contents file.
*/ */
bool KeywordSearch(const wxString& keyword, bool KeywordSearch(const wxString& keyword,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL); wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
@@ -120,30 +185,33 @@ public:
/** /**
Sets the path for storing temporary files - cached binary versions of index and Sets the path for storing temporary files - cached binary versions of index and
contents files. These binary contents files.
forms are much faster to read. Default value is empty string (empty string means
that no cached data are stored). Note that these files are @e not These binary forms are much faster to read. Default value is empty string
deleted when program exits. (empty string means that no cached data are stored). Note that these files
are @e not deleted when program exits.
Once created these cached files will be used in all subsequent executions Once created these cached files will be used in all subsequent executions
of your application. If cached files become older than corresponding .hhp of your application. If cached files become older than corresponding @c ".hhp"
file (e.g. if you regenerate documentation) it will be refreshed. file (e.g. if you regenerate documentation) it will be refreshed.
*/ */
void SetTempDir(const wxString& path); void SetTempDir(const wxString& path);
/** /**
Sets format of title of the frame. Must contain exactly one "%s" Sets format of title of the frame.
(for title of displayed HTML page). Must contain exactly one "%s" (for title of displayed HTML page).
*/ */
void SetTitleFormat(const wxString& format); void SetTitleFormat(const wxString& format);
/** /**
Associates @a config object with the controller. Associates the @a config object with the controller.
If there is associated config object, wxHtmlHelpController automatically If there is associated config object, wxHtmlHelpController automatically
reads and writes settings (including wxHtmlWindow's settings) when needed. reads and writes settings (including wxHtmlWindow's settings) when needed.
The only thing you must do is create wxConfig object and call UseConfig. The only thing you must do is create wxConfig object and call UseConfig().
If you do not use @e UseConfig, wxHtmlHelpController will use
default wxConfig object if available (for details see If you do not use UseConfig(), wxHtmlHelpController will use the default
wxConfigBase::Get and wxConfig object if available (for details see wxConfigBase::Get and
wxConfigBase::Set). wxConfigBase::Set).
*/ */
void UseConfig(wxConfigBase* config, void UseConfig(wxConfigBase* config,
@@ -161,28 +229,27 @@ public:
/** /**
@class wxHtmlModalHelp @class wxHtmlModalHelp
This class uses wxHtmlHelpController This class uses wxHtmlHelpController to display help in a modal dialog.
to display help in a modal dialog. This is useful on platforms such as wxMac This is useful on platforms such as wxMac where if you display help from a
where if you display help from a modal dialog, the help window must itself be a modal dialog, the help window must itself be a modal dialog.
modal
dialog.
Create objects of this class on the stack, for example: Create objects of this class on the stack, for example:
@code @code
// The help can be browsed during the lifetime of this object; when the user // The help can be browsed during the lifetime of this object; when the
quits // user quits the help, program execution will continue.
// the help, program execution will continue.
wxHtmlModalHelp help(parent, wxT("help"), wxT("My topic")); wxHtmlModalHelp help(parent, wxT("help"), wxT("My topic"));
@endcode @endcode
@library{wxhtml} @library{wxhtml}
@category{FIXME} @category{help,html}
*/ */
class wxHtmlModalHelp class wxHtmlModalHelp
{ {
public: public:
/** /**
The ctor.
@param parent @param parent
is the parent of the dialog. is the parent of the dialog.
@param helpFile @param helpFile
@@ -191,7 +258,7 @@ public:
is an optional topic. If this is empty, the help contents will be shown. is an optional topic. If this is empty, the help contents will be shown.
@param style @param style
is a combination of the flags described in the wxHtmlHelpController is a combination of the flags described in the wxHtmlHelpController
documentation. documentation.
*/ */
wxHtmlModalHelp(wxWindow* parent, const wxString& helpFile, wxHtmlModalHelp(wxWindow* parent, const wxString& helpFile,
const wxString& topic = wxEmptyString, const wxString& topic = wxEmptyString,

View File

@@ -9,13 +9,14 @@
/** /**
@class wxHtmlHelpData @class wxHtmlHelpData
This class is used by wxHtmlHelpController This class is used by wxHtmlHelpController and wxHtmlHelpFrame to access HTML
and wxHtmlHelpFrame to access HTML help items. help items.
It is internal class and should not be used directly - except for the case It is internal class and should not be used directly - except for the case
you're writing your own HTML help controller. you're writing your own HTML help controller.
@library{wxhtml} @library{wxhtml}
@category{FIXME} @category{help,html}
*/ */
class wxHtmlHelpData : public wxObject class wxHtmlHelpData : public wxObject
{ {
@@ -26,9 +27,12 @@ public:
wxHtmlHelpData(); wxHtmlHelpData();
/** /**
Adds new book. @e book is URL (not filename!) of HTML help project (hhp) Adds new book.
or ZIP file that contains arbitrary number of .hhp projects (this zip
file can have either .zip or .htb extension, htb stands for "html book"). @a book_url is URL (not filename!) of HTML help project (hhp) or ZIP file
that contains arbitrary number of .hhp projects (this zip file can have
either .zip or .htb extension, htb stands for "html book").
Returns success. Returns success.
*/ */
bool AddBook(const wxString& book_url); bool AddBook(const wxString& book_url);
@@ -59,7 +63,7 @@ public:
const wxHtmlHelpDataItems GetIndexArray(); const wxHtmlHelpDataItems GetIndexArray();
/** /**
Sets temporary directory where binary cached versions of MS HTML Workshop Sets the temporary directory where binary cached versions of MS HTML Workshop
files will be stored. (This is turned off by default and you can enable files will be stored. (This is turned off by default and you can enable
this feature by setting non-empty temp dir.) this feature by setting non-empty temp dir.)
*/ */

View File

@@ -9,39 +9,39 @@
/** /**
@class wxHtmlHelpDialog @class wxHtmlHelpDialog
This class is used by wxHtmlHelpController This class is used by wxHtmlHelpController to display help.
to display help.
It is an internal class and should not be used directly - except for the case It is an internal class and should not be used directly - except for the case
when you're writing your own HTML help controller. when you're writing your own HTML help controller.
@library{wxhtml} @library{wxhtml}
@category{FIXME} @category{help,html}
*/ */
class wxHtmlHelpDialog : public wxFrame class wxHtmlHelpDialog : public wxFrame
{ {
public: public:
//@{
/**
Constructor. For the values of @e style, please see the documentation for
wxHtmlHelpController.
*/
wxHtmlHelpDialog(wxHtmlHelpData* data = NULL); wxHtmlHelpDialog(wxHtmlHelpData* data = NULL);
/**
Constructor.
For the possible values of @a style, please see wxHtmlHelpController.
*/
wxHtmlHelpDialog(wxWindow* parent, int wxWindowID, wxHtmlHelpDialog(wxWindow* parent, int wxWindowID,
const wxString& title = wxEmptyString, const wxString& title = wxEmptyString,
int style = wxHF_DEFAULT_STYLE, int style = wxHF_DEFAULT_STYLE,
wxHtmlHelpData* data = NULL); wxHtmlHelpData* data = NULL);
//@}
/** /**
You may override this virtual method to add more buttons to the help window's You may override this virtual method to add more buttons to the help window's
toolbar. @a toolBar is a pointer to the toolbar and @a style is the style toolbar. @a toolBar is a pointer to the toolbar and @a style is the style
flag as passed to the Create method. flag as passed to the Create() method.
wxToolBar::Realize is called immediately after returning from this function. wxToolBar::Realize is called immediately after returning from this function.
*/ */
virtual void AddToolbarButtons(wxToolBar* toolBar, int style); virtual void AddToolbarButtons(wxToolBar* toolBar, int style);
/** /**
Creates the dialog. See @ref wxhtmlhelpdialog() "the constructor" Creates the dialog. See @ref wxHtmlHelpDialog() "the constructor"
for a description of the parameters. for a description of the parameters.
*/ */
bool Create(wxWindow* parent, wxWindowID id, bool Create(wxWindow* parent, wxWindowID id,
@@ -54,8 +54,9 @@ public:
wxHtmlHelpController* GetController() const; wxHtmlHelpController* GetController() const;
/** /**
Reads the user's settings for this dialog see Reads the user's settings for this dialog
wxHtmlHelpController::ReadCustomization)
@see wxHtmlHelpController::ReadCustomization
*/ */
void ReadCustomization(wxConfigBase* cfg, void ReadCustomization(wxConfigBase* cfg,
const wxString& path = wxEmptyString); const wxString& path = wxEmptyString);
@@ -66,14 +67,16 @@ public:
void SetController(wxHtmlHelpController* contoller); void SetController(wxHtmlHelpController* contoller);
/** /**
Sets the dialog's title format. @a format must contain exactly one "%s" Sets the dialog's title format.
(it will be replaced by the page title).
@a format must contain exactly one "%s" (it will be replaced by the page title).
*/ */
void SetTitleFormat(const wxString& format); void SetTitleFormat(const wxString& format);
/** /**
Saves the user's settings for this dialog (see Saves the user's settings for this dialog
wxHtmlHelpController::WriteCustomization).
@see wxHtmlHelpController::WriteCustomization
*/ */
void WriteCustomization(wxConfigBase* cfg, void WriteCustomization(wxConfigBase* cfg,
const wxString& path = wxEmptyString); const wxString& path = wxEmptyString);

View File

@@ -9,39 +9,39 @@
/** /**
@class wxHtmlHelpFrame @class wxHtmlHelpFrame
This class is used by wxHtmlHelpController This class is used by wxHtmlHelpController to display help.
to display help.
It is an internal class and should not be used directly - except for the case It is an internal class and should not be used directly - except for the case
when you're writing your own HTML help controller. when you're writing your own HTML help controller.
@library{wxhtml} @library{wxhtml}
@category{FIXME} @category{help,html}
*/ */
class wxHtmlHelpFrame : public wxFrame class wxHtmlHelpFrame : public wxFrame
{ {
public: public:
//@{
/**
Constructor. For the values of @e style, please see the documentation for
wxHtmlHelpController.
*/
wxHtmlHelpFrame(wxHtmlHelpData* data = NULL); wxHtmlHelpFrame(wxHtmlHelpData* data = NULL);
/**
Constructor.
For the possible values of @a style, please see wxHtmlHelpController.
*/
wxHtmlHelpFrame(wxWindow* parent, int wxWindowID, wxHtmlHelpFrame(wxWindow* parent, int wxWindowID,
const wxString& title = wxEmptyString, const wxString& title = wxEmptyString,
int style = wxHF_DEFAULT_STYLE, int style = wxHF_DEFAULT_STYLE,
wxHtmlHelpData* data = NULL); wxHtmlHelpData* data = NULL);
//@}
/** /**
You may override this virtual method to add more buttons to the help window's You may override this virtual method to add more buttons to the help window's
toolbar. @a toolBar is a pointer to the toolbar and @a style is the style toolbar. @a toolBar is a pointer to the toolbar and @a style is the style
flag as passed to the Create method. flag as passed to the Create() method.
wxToolBar::Realize is called immediately after returning from this function. wxToolBar::Realize is called immediately after returning from this function.
*/ */
virtual void AddToolbarButtons(wxToolBar* toolBar, int style); virtual void AddToolbarButtons(wxToolBar* toolBar, int style);
/** /**
Creates the frame. See @ref wxhtmlhelpframe() "the constructor" Creates the frame. See @ref wxHtmlHelpFrame() "the constructor"
for a description of the parameters. for a description of the parameters.
*/ */
bool Create(wxWindow* parent, wxWindowID id, bool Create(wxWindow* parent, wxWindowID id,
@@ -54,8 +54,9 @@ public:
wxHtmlHelpController* GetController() const; wxHtmlHelpController* GetController() const;
/** /**
Reads the user's settings for this frame see Reads the user's settings for this frame.
wxHtmlHelpController::ReadCustomization)
@see wxHtmlHelpController::ReadCustomization
*/ */
void ReadCustomization(wxConfigBase* cfg, void ReadCustomization(wxConfigBase* cfg,
const wxString& path = wxEmptyString); const wxString& path = wxEmptyString);
@@ -66,14 +67,16 @@ public:
void SetController(wxHtmlHelpController* contoller); void SetController(wxHtmlHelpController* contoller);
/** /**
Sets the frame's title format. @a format must contain exactly one "%s" Sets the frame's title format.
(it will be replaced by the page title).
@a format must contain exactly one "%s" (it will be replaced by the page title).
*/ */
void SetTitleFormat(const wxString& format); void SetTitleFormat(const wxString& format);
/** /**
Saves the user's settings for this frame (see Saves the user's settings for this frame.
wxHtmlHelpController::WriteCustomization).
@see wxHtmlHelpController::WriteCustomization
*/ */
void WriteCustomization(wxConfigBase* cfg, void WriteCustomization(wxConfigBase* cfg,
const wxString& path = wxEmptyString); const wxString& path = wxEmptyString);

View File

@@ -9,63 +9,60 @@
/** /**
@class wxHtmlHelpWindow @class wxHtmlHelpWindow
This class is used by wxHtmlHelpController This class is used by wxHtmlHelpController to display help within a frame or
to display help within a frame or dialog, but you can use it yourself to create dialog, but you can use it yourself to create an embedded HTML help window.
an embedded HTML help window.
For example: For example:
@code @code
// m_embeddedHelpWindow is a wxHtmlHelpWindow // m_embeddedHelpWindow is a wxHtmlHelpWindow
// m_embeddedHtmlHelp is a wxHtmlHelpController // m_embeddedHtmlHelp is a wxHtmlHelpController
// Create embedded HTML Help window // Create embedded HTML Help window
m_embeddedHelpWindow = new wxHtmlHelpWindow; m_embeddedHelpWindow = new wxHtmlHelpWindow;
m_embeddedHtmlHelp.UseConfig(config, rootPath); // Set your own config m_embeddedHtmlHelp.UseConfig(config, rootPath); // Set your own config object here
object here
m_embeddedHtmlHelp.SetHelpWindow(m_embeddedHelpWindow); m_embeddedHtmlHelp.SetHelpWindow(m_embeddedHelpWindow);
m_embeddedHelpWindow-Create(this, m_embeddedHelpWindow->Create(this, wxID_ANY, wxDefaultPosition, GetClientSize(),
wxID_ANY, wxDefaultPosition, GetClientSize(), wxTAB_TRAVERSAL|wxBORDER_NONE, wxHF_DEFAULT_STYLE);
wxTAB_TRAVERSAL|wxBORDER_NONE, wxHF_DEFAULT_STYLE);
m_embeddedHtmlHelp.AddBook(wxFileName(_T("doc.zip"))); m_embeddedHtmlHelp.AddBook(wxFileName(_T("doc.zip")));
@endcode @endcode
You should pass the style wxHF_EMBEDDED to the style parameter of You should pass the style wxHF_EMBEDDED to the style parameter of
wxHtmlHelpController to allow wxHtmlHelpController to allow the embedded window to be destroyed
the embedded window to be destroyed independently of the help controller. independently of the help controller.
@library{wxhtml} @library{wxhtml}
@category{FIXME} @category{help,html}
*/ */
class wxHtmlHelpWindow : public wxWindow class wxHtmlHelpWindow : public wxWindow
{ {
public: public:
//@{ wxHtmlHelpWindow(wxHtmlHelpData* data = NULL);
/** /**
Constructor. Constructor.
Constructor. For the values of @e helpStyle, please see the documentation for
For the values of @a helpStyle, please see the documentation for
wxHtmlHelpController. wxHtmlHelpController.
*/ */
wxHtmlHelpWindow(wxHtmlHelpData* data = NULL);
wxHtmlHelpWindow(wxWindow* parent, int wxWindowID, wxHtmlHelpWindow(wxWindow* parent, int wxWindowID,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& pos = wxDefaultSize, const wxSize& pos = wxDefaultSize,
int style = wxTAB_TRAVERSAL|wxBORDER_NONE, int style = wxTAB_TRAVERSAL|wxBORDER_NONE,
int helpStyle = wxHF_DEFAULT_STYLE, int helpStyle = wxHF_DEFAULT_STYLE,
wxHtmlHelpData* data = NULL); wxHtmlHelpData* data = NULL);
//@}
/** /**
You may override this virtual method to add more buttons to the help window's You may override this virtual method to add more buttons to the help window's
toolbar. @a toolBar is a pointer to the toolbar and @a style is the style toolbar. @a toolBar is a pointer to the toolbar and @a style is the style
flag as passed to the Create method. flag as passed to the Create() method.
wxToolBar::Realize is called immediately after returning from this function. wxToolBar::Realize is called immediately after returning from this function.
See @e samples/html/helpview for an example. See @c samples/html/helpview for an example.
*/ */
virtual void AddToolbarButtons(wxToolBar* toolBar, int style); virtual void AddToolbarButtons(wxToolBar* toolBar, int style);
/** /**
Creates the help window. See @ref wxhtmlhelpwindow() "the constructor" Creates the help window. See @ref wxHtmlHelpWindow() "the constructor"
for a description of the parameters. for a description of the parameters.
*/ */
bool Create(wxWindow* parent, wxWindowID id, bool Create(wxWindow* parent, wxWindowID id,
@@ -75,38 +72,29 @@ public:
int helpStyle = wxHF_DEFAULT_STYLE, int helpStyle = wxHF_DEFAULT_STYLE,
wxHtmlHelpData* data = NULL); wxHtmlHelpData* data = NULL);
/**
Creates contents panel. (May take some time.)
Protected.
*/
void CreateContents();
/**
Creates index panel. (May take some time.)
Protected.
*/
void CreateIndex();
/** /**
Creates search panel. Creates search panel.
*/ */
void CreateSearch(); void CreateSearch();
//@{
/** /**
Displays page x. If not found it will give the user the choice of Displays page x.
searching books. If not found it will give the user the choice of searching books.
Looking for the page runs in these steps: Looking for the page runs in these steps:
try to locate file named x (if x is for example "doc/howto.htm") -# try to locate file named x (if x is for example "doc/howto.htm")
try to open starting page of book x -# try to open starting page of book x
try to find x in contents (if x is for example "How To ...") -# try to find x in contents (if x is for example "How To ...")
try to find x in index (if x is for example "How To ...") -# try to find x in index (if x is for example "How To ...")
The second form takes numeric ID as the parameter.
(uses extension to MS format, param name="ID" value=id)
*/ */
bool Display(const wxString& x); bool Display(const wxString& x);
/**
@overload
This form takes numeric ID as the parameter (uses an extension to MS format,
param name="ID" value=id).
*/
bool Display(const int id); bool Display(const int id);
//@}
/** /**
Displays contents panel. Displays contents panel.
@@ -125,28 +113,24 @@ public:
wxHtmlHelpData* GetData(); wxHtmlHelpData* GetData();
/** /**
Search for given keyword. Optionally it searches through the index (mode = Search for given keyword. Optionally it searches through the index
wxHELP_SEARCH_INDEX), default the content (mode = wxHELP_SEARCH_ALL). (mode = @c wxHELP_SEARCH_INDEX), default the content (mode = @c wxHELP_SEARCH_ALL).
*/ */
bool KeywordSearch(const wxString& keyword, bool KeywordSearch(const wxString& keyword,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL); wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
/** /**
Reads the user's settings for this window (see Reads the user's settings for this window.
wxHtmlHelpController::ReadCustomization)
@see wxHtmlHelpController::ReadCustomization
*/ */
void ReadCustomization(wxConfigBase* cfg, void ReadCustomization(wxConfigBase* cfg,
const wxString& path = wxEmptyString); const wxString& path = wxEmptyString);
/** /**
Refresh all panels. This is necessary if a new book was added. Sets the frame's title format.
Protected.
*/
void RefreshLists();
/** @a format must contain exactly one "%s" (it will be replaced by the page title).
Sets the frame's title format. @a format must contain exactly one "%s"
(it will be replaced by the page title).
*/ */
void SetTitleFormat(const wxString& format); void SetTitleFormat(const wxString& format);
@@ -158,10 +142,28 @@ public:
const wxString& rootpath = wxEmptyString); const wxString& rootpath = wxEmptyString);
/** /**
Saves the user's settings for this window(see Saves the user's settings for this window.
wxHtmlHelpController::WriteCustomization).
@see wxHtmlHelpController::WriteCustomization
*/ */
void WriteCustomization(wxConfigBase* cfg, void WriteCustomization(wxConfigBase* cfg,
const wxString& path = wxEmptyString); const wxString& path = wxEmptyString);
protected:
/**
Creates contents panel. (May take some time.)
*/
void CreateContents();
/**
Creates index panel. (May take some time.)
*/
void CreateIndex();
/**
Refresh all panels. This is necessary if a new book was added.
*/
void RefreshLists();
}; };