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

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