diff --git a/include/wx/html/helpctrl.h b/include/wx/html/helpctrl.h
index f168680ad5..8251c044f4 100644
--- a/include/wx/html/helpctrl.h
+++ b/include/wx/html/helpctrl.h
@@ -15,7 +15,7 @@
#include "wx/defs.h"
#ifdef __GNUG__
-#pragma interface
+#pragma interface "helpctrl.h"
#endif
#if wxUSE_HTML
@@ -25,85 +25,86 @@
class WXDLLEXPORT wxHtmlHelpController : public wxHelpControllerBase // wxEvtHandler
{
- DECLARE_DYNAMIC_CLASS(wxHtmlHelpController)
+ DECLARE_DYNAMIC_CLASS(wxHtmlHelpController)
- public:
- wxHtmlHelpController(int style = wxHF_DEFAULTSTYLE);
- virtual ~wxHtmlHelpController();
+public:
+ wxHtmlHelpController(int style = wxHF_DEFAULTSTYLE);
+ virtual ~wxHtmlHelpController();
- void SetTitleFormat(const wxString& format);
- void SetTempDir(const wxString& path) { m_helpData.SetTempDir(path); }
- bool AddBook(const wxString& book, bool show_wait_msg = FALSE);
- bool Display(const wxString& x)
- {
- CreateHelpWindow(); return m_helpFrame->Display(x);
- }
- bool Display(int id)
- {
- CreateHelpWindow(); return m_helpFrame->Display(id);
- }
- bool DisplayContents()
- {
- CreateHelpWindow(); return m_helpFrame->DisplayContents();
- }
- bool DisplayIndex()
- {
- CreateHelpWindow(); return m_helpFrame->DisplayIndex();
- }
- bool KeywordSearch(const wxString& keyword)
- {
- CreateHelpWindow(); return m_helpFrame->KeywordSearch(keyword);
- }
- wxHtmlHelpFrame* GetFrame() { return m_helpFrame; }
- void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString);
-
- // Assigns config object to the Ctrl. This config is then
- // used in subsequent calls to Read/WriteCustomization of both help
- // Ctrl and it's wxHtmlWindow
- virtual void ReadCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString);
- virtual void WriteCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString);
+ void SetTitleFormat(const wxString& format);
+ void SetTempDir(const wxString& path) { m_helpData.SetTempDir(path); }
+ bool AddBook(const wxString& book, bool show_wait_msg = FALSE);
+ bool Display(const wxString& x)
+ {
+ CreateHelpWindow(); return m_helpFrame->Display(x);
+ }
+ bool Display(int id)
+ {
+ CreateHelpWindow(); return m_helpFrame->Display(id);
+ }
+ bool DisplayContents()
+ {
+ CreateHelpWindow(); return m_helpFrame->DisplayContents();
+ }
+ bool DisplayIndex()
+ {
+ CreateHelpWindow(); return m_helpFrame->DisplayIndex();
+ }
+ bool KeywordSearch(const wxString& keyword)
+ {
+ CreateHelpWindow(); return m_helpFrame->KeywordSearch(keyword);
+ }
+ wxHtmlHelpFrame* GetFrame() { return m_helpFrame; }
+ void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString);
- //// Backward compatibility with wxHelpController API
+ // Assigns config object to the Ctrl. This config is then
+ // used in subsequent calls to Read/WriteCustomization of both help
+ // Ctrl and it's wxHtmlWindow
+ virtual void ReadCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString);
+ virtual void WriteCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString);
- virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize(file); }
- virtual bool Initialize(const wxString& file);
- virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
- virtual bool LoadFile(const wxString& file = "");
- virtual bool DisplaySection(int sectionNo);
- virtual bool DisplaySection(const wxString& section) { return Display(section); }
- virtual bool DisplayBlock(long blockNo) { return DisplaySection(blockNo); }
- virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos);
+ //// Backward compatibility with wxHelpController API
- virtual void SetFrameParameters(const wxString& title,
- const wxSize& size,
- const wxPoint& pos = wxDefaultPosition,
- bool newFrameEachTime = FALSE);
- /// Obtains the latest settings used by the help frame and the help
- /// frame.
- virtual wxFrame *GetFrameParameters(wxSize *size = NULL,
- wxPoint *pos = NULL,
- bool *newFrameEachTime = NULL);
+ virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize(file); }
+ virtual bool Initialize(const wxString& file);
+ virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
+ virtual bool LoadFile(const wxString& file = "");
+ virtual bool DisplaySection(int sectionNo);
+ virtual bool DisplaySection(const wxString& section) { return Display(section); }
+ virtual bool DisplayBlock(long blockNo) { return DisplaySection(blockNo); }
+ virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos);
- // Sets the specified book or all books to have the given base path
- virtual void SetBookBasePath(const wxString& basePath, int which = -1);
+ virtual void SetFrameParameters(const wxString& title,
+ const wxSize& size,
+ const wxPoint& pos = wxDefaultPosition,
+ bool newFrameEachTime = FALSE);
+ /// Obtains the latest settings used by the help frame and the help
+ /// frame.
+ virtual wxFrame *GetFrameParameters(wxSize *size = NULL,
+ wxPoint *pos = NULL,
+ bool *newFrameEachTime = NULL);
- virtual bool Quit() ;
- virtual void OnQuit() {};
+ // Sets the specified book or all books to have the given base path
+ virtual void SetBookBasePath(const wxString& basePath, int which = -1);
- void OnCloseFrame(wxCloseEvent& evt);
- protected:
- virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData *data);
-
- virtual void CreateHelpWindow();
- virtual void DestroyHelpWindow();
+ virtual bool Quit() ;
+ virtual void OnQuit() {};
- wxHtmlHelpData m_helpData;
- wxHtmlHelpFrame* m_helpFrame;
- wxConfigBase * m_Config;
- wxString m_ConfigRoot;
- wxString m_titleFormat;
- int m_FrameStyle;
- // DECLARE_EVENT_TABLE()
+ void OnCloseFrame(wxCloseEvent& evt);
+
+protected:
+ virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData *data);
+
+ virtual void CreateHelpWindow();
+ virtual void DestroyHelpWindow();
+
+ wxHtmlHelpData m_helpData;
+ wxHtmlHelpFrame* m_helpFrame;
+ wxConfigBase * m_Config;
+ wxString m_ConfigRoot;
+ wxString m_titleFormat;
+ int m_FrameStyle;
+ // DECLARE_EVENT_TABLE()
};
#endif
diff --git a/include/wx/html/helpdata.h b/include/wx/html/helpdata.h
index be84c07264..dd7135f7d2 100644
--- a/include/wx/html/helpdata.h
+++ b/include/wx/html/helpdata.h
@@ -13,7 +13,7 @@
#define _WX_HELPDATA_H_
#ifdef __GNUG__
-#pragma interface
+#pragma interface "helpdata.h"
#endif
#include "wx/defs.h"
@@ -26,85 +26,86 @@
#include "wx/dynarray.h"
#include "wx/font.h"
+class WXDLLEXPORT wxHtmlHelpData;
+
//--------------------------------------------------------------------------------
// helper classes & structs
//--------------------------------------------------------------------------------
class WXDLLEXPORT wxHtmlBookRecord : public wxObject
{
- public:
- wxHtmlBookRecord(const wxString& basepath, const wxString& title,
- const wxString& start)
- {
- m_BasePath = basepath;
- m_Title = title;
- m_Start = start;
- // for debugging, give the contents index obvious default values
- m_ContentsStart = m_ContentsEnd = -1;
- }
- wxString GetTitle() const { return m_Title; }
- wxString GetStart() const { return m_Start; }
- wxString GetBasePath() const { return m_BasePath; }
- /* SetContentsRange: store in the bookrecord where in the index/contents lists the
- * book's records are stored. This to facilitate searching in a specific book.
- * This code will have to be revised when loading/removing books becomes dynamic.
- * (as opposed to appending only)
- * Note that storing index range is pointless, because the index is alphab. sorted. */
- void SetContentsRange(int start, int end) { m_ContentsStart = start; m_ContentsEnd = end; }
- int GetContentsStart() const { return m_ContentsStart; }
- int GetContentsEnd() const { return m_ContentsEnd; }
+public:
+ wxHtmlBookRecord(const wxString& basepath, const wxString& title,
+ const wxString& start)
+ {
+ m_BasePath = basepath;
+ m_Title = title;
+ m_Start = start;
+ // for debugging, give the contents index obvious default values
+ m_ContentsStart = m_ContentsEnd = -1;
+ }
+ wxString GetTitle() const { return m_Title; }
+ wxString GetStart() const { return m_Start; }
+ wxString GetBasePath() const { return m_BasePath; }
+ /* SetContentsRange: store in the bookrecord where in the index/contents lists the
+ * book's records are stored. This to facilitate searching in a specific book.
+ * This code will have to be revised when loading/removing books becomes dynamic.
+ * (as opposed to appending only)
+ * Note that storing index range is pointless, because the index is alphab. sorted. */
+ void SetContentsRange(int start, int end) { m_ContentsStart = start; m_ContentsEnd = end; }
+ int GetContentsStart() const { return m_ContentsStart; }
+ int GetContentsEnd() const { return m_ContentsEnd; }
- void SetTitle(const wxString& title) { m_Title = title; }
- void SetBasePath(const wxString& path) { m_BasePath = path; }
- void SetStart(const wxString& start) { m_Start = start; }
+ void SetTitle(const wxString& title) { m_Title = title; }
+ void SetBasePath(const wxString& path) { m_BasePath = path; }
+ void SetStart(const wxString& start) { m_Start = start; }
- protected:
- wxString m_BasePath;
- wxString m_Title;
- wxString m_Start;
- int m_ContentsStart;
- int m_ContentsEnd;
+protected:
+ wxString m_BasePath;
+ wxString m_Title;
+ wxString m_Start;
+ int m_ContentsStart;
+ int m_ContentsEnd;
};
WX_DECLARE_EXPORTED_OBJARRAY(wxHtmlBookRecord, wxHtmlBookRecArray);
-typedef struct
+struct wxHtmlContentsItem
{
short int m_Level;
int m_ID;
wxChar* m_Name;
wxChar* m_Page;
wxHtmlBookRecord *m_Book;
-}
-wxHtmlContentsItem;
+};
//------------------------------------------------------------------------------
// wxSearchEngine
// This class takes input streams and scans them for occurence
// of keyword(s)
//------------------------------------------------------------------------------
+
class WXDLLEXPORT wxSearchEngine : public wxObject
{
- public:
- wxSearchEngine() : wxObject() {m_Keyword = NULL; }
- ~wxSearchEngine() {if (m_Keyword) delete[] m_Keyword; }
+public:
+ wxSearchEngine() : wxObject() {m_Keyword = NULL; }
+ ~wxSearchEngine() {if (m_Keyword) delete[] m_Keyword; }
- virtual void LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only);
- // Sets the keyword we will be searching for
+ // Sets the keyword we will be searching for
+ virtual void LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only);
- virtual bool Scan(wxInputStream *stream);
- // Scans the stream for the keyword.
- // Returns TRUE if the stream contains keyword, fALSE otherwise
+ // Scans the stream for the keyword.
+ // Returns TRUE if the stream contains keyword, fALSE otherwise
+ virtual bool Scan(wxInputStream *stream);
- private:
- wxChar *m_Keyword;
- bool m_CaseSensitive;
- bool m_WholeWords;
+private:
+ wxChar *m_Keyword;
+ bool m_CaseSensitive;
+ bool m_WholeWords;
};
-class wxHtmlHelpData;
// State information of a search action. I'd have prefered to make this a nested
// class inside wxHtmlHelpData, but that's against coding standards :-(
@@ -112,90 +113,87 @@ class wxHtmlHelpData;
// wxHtmlHelpData::PrepareKeywordSearch(const wxString& key)
class WXDLLEXPORT wxHtmlSearchStatus
{
- public:
- // constructor; supply wxHtmlHelpData ptr, the keyword and (optionally) the
- // title of the book to search. By default, all books are searched.
+public:
+ // constructor; supply wxHtmlHelpData ptr, the keyword and (optionally) the
+ // title of the book to search. By default, all books are searched.
+ wxHtmlSearchStatus(wxHtmlHelpData* base, const wxString& keyword,
+ bool case_sensitive, bool whole_words_only,
+ const wxString& book = wxEmptyString);
+ bool Search(); // do the next iteration
+ bool IsActive() { return m_Active; }
+ int GetCurIndex() { return m_CurIndex; }
+ int GetMaxIndex() { return m_MaxIndex; }
+ const wxString& GetName() { return m_Name; }
+ wxHtmlContentsItem* GetContentsItem() { return m_ContentsItem; }
- wxHtmlSearchStatus(wxHtmlHelpData* base, const wxString& keyword,
- bool case_sensitive, bool whole_words_only,
- const wxString& book = wxEmptyString);
- bool Search(); // do the next iteration
- bool IsActive() { return m_Active; }
- int GetCurIndex() { return m_CurIndex; }
- int GetMaxIndex() { return m_MaxIndex; }
- const wxString& GetName() { return m_Name; }
- wxHtmlContentsItem* GetContentsItem() { return m_ContentsItem; }
-
- private:
- wxHtmlHelpData* m_Data;
- wxSearchEngine m_Engine;
- wxString m_Keyword, m_Name;
- wxChar *m_LastPage;
- wxHtmlContentsItem* m_ContentsItem;
- bool m_Active; // search is not finished
- int m_CurIndex; // where we are now
- int m_MaxIndex; // number of files we search
- // For progress bar: 100*curindex/maxindex = % complete
+private:
+ wxHtmlHelpData* m_Data;
+ wxSearchEngine m_Engine;
+ wxString m_Keyword, m_Name;
+ wxChar *m_LastPage;
+ wxHtmlContentsItem* m_ContentsItem;
+ bool m_Active; // search is not finished
+ int m_CurIndex; // where we are now
+ int m_MaxIndex; // number of files we search
+ // For progress bar: 100*curindex/maxindex = % complete
};
class WXDLLEXPORT wxHtmlHelpData : public wxObject
{
- DECLARE_DYNAMIC_CLASS(wxHtmlHelpData)
+ DECLARE_DYNAMIC_CLASS(wxHtmlHelpData)
+ friend class wxHtmlSearchStatus;
- friend class wxHtmlSearchStatus;
+public:
+ wxHtmlHelpData();
+ ~wxHtmlHelpData();
- public:
- wxHtmlHelpData();
- ~wxHtmlHelpData();
+ // Sets directory where temporary files are stored.
+ // These temp files are index & contents file in binary (much faster to read)
+ // form. These files are NOT deleted on program's exit.
+ void SetTempDir(const wxString& path);
- void SetTempDir(const wxString& path);
- // Sets directory where temporary files are stored.
- // These temp files are index & contents file in binary (much faster to read)
- // form. These files are NOT deleted on program's exit.
+ // Adds new book. 'book' is location of .htb file (stands for "html book").
+ // See documentation for details on its format.
+ // Returns success.
+ bool AddBook(const wxString& book);
+ bool AddBookParam(const wxFSFile& bookfile,
+ wxFontEncoding encoding,
+ const wxString& title, const wxString& contfile,
+ const wxString& indexfile = wxEmptyString,
+ const wxString& deftopic = wxEmptyString,
+ const wxString& path = wxEmptyString);
- bool AddBook(const wxString& book);
- // Adds new book. 'book' is location of .htb file (stands for "html book").
- // See documentation for details on its format.
- // Returns success.
- bool AddBookParam(const wxFSFile& bookfile,
- wxFontEncoding encoding,
- const wxString& title, const wxString& contfile,
- const wxString& indexfile = wxEmptyString,
- const wxString& deftopic = wxEmptyString,
- const wxString& path = wxEmptyString);
+ // Some accessing stuff:
- // Some accessing stuff
- wxString FindPageByName(const wxString& page);
- // returns URL of page on basis of (file)name
- wxString FindPageById(int id);
- // returns URL of page on basis of MS id
+ // returns URL of page on basis of (file)name
+ wxString FindPageByName(const wxString& page);
+ // returns URL of page on basis of MS id
+ wxString FindPageById(int id);
- const wxHtmlBookRecArray& GetBookRecArray() { return m_BookRecords; }
- wxHtmlContentsItem* GetContents() { return m_Contents; }
- int GetContentsCnt() { return m_ContentsCnt; }
- wxHtmlContentsItem* GetIndex() { return m_Index; }
- int GetIndexCnt() { return m_IndexCnt; }
+ const wxHtmlBookRecArray& GetBookRecArray() { return m_BookRecords; }
+ wxHtmlContentsItem* GetContents() { return m_Contents; }
+ int GetContentsCnt() { return m_ContentsCnt; }
+ wxHtmlContentsItem* GetIndex() { return m_Index; }
+ int GetIndexCnt() { return m_IndexCnt; }
- protected:
- wxString m_TempPath;
+protected:
+ wxString m_TempPath;
- wxHtmlBookRecArray m_BookRecords;
- // each book has one record in this array
- wxHtmlContentsItem* m_Contents;
- int m_ContentsCnt;
- // list of all available books and pages.
- wxHtmlContentsItem* m_Index;
- int m_IndexCnt;
- // list of index items
+ wxHtmlBookRecArray m_BookRecords;
+ // each book has one record in this array:
+ wxHtmlContentsItem* m_Contents;
+ int m_ContentsCnt;
+ wxHtmlContentsItem* m_Index; // list of all available books and pages.
+ int m_IndexCnt; // list of index items
- protected:
- bool LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys,
- const wxString& indexfile, const wxString& contentsfile);
- // Imports .hhp files (MS HTML Help Workshop)
- bool LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f);
- // Reads binary book
- bool SaveCachedBook(wxHtmlBookRecord *book, wxOutputStream *f);
- // Writes binary book
+protected:
+ // Imports .hhp files (MS HTML Help Workshop)
+ bool LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys,
+ const wxString& indexfile, const wxString& contentsfile);
+ // Reads binary book
+ bool LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f);
+ // Writes binary book
+ bool SaveCachedBook(wxHtmlBookRecord *book, wxOutputStream *f);
};
// Utility function
diff --git a/include/wx/html/helpfrm.h b/include/wx/html/helpfrm.h
index 9bcf7574a4..a15cd0419c 100644
--- a/include/wx/html/helpfrm.h
+++ b/include/wx/html/helpfrm.h
@@ -13,7 +13,7 @@
#define _WX_HELPFRM_H_
#ifdef __GNUG__
-#pragma interface
+#pragma interface "helpfrm.h"
#endif
#include "wx/defs.h"
@@ -77,174 +77,172 @@ enum
wxID_HTML_SEARCHCHOICE,
wxID_HTML_COUNTINFO,
wxID_HTML_HELPFRAME // the id of wxHtmlHelpController's helpframe
-}
-;
+};
-typedef struct
+struct wxHtmlHelpFrameCfg
{
int x, y, w, h;
long sashpos;
bool navig_on;
-}
-wxHtmlHelpFrameCfg;
+};
class WXDLLEXPORT wxHelpControllerBase;
class WXDLLEXPORT wxHtmlHelpFrame : public wxFrame
{
- DECLARE_DYNAMIC_CLASS(wxHtmlHelpFrame)
+ DECLARE_DYNAMIC_CLASS(wxHtmlHelpFrame)
- public:
- wxHtmlHelpFrame(wxHtmlHelpData* data = NULL) { Init(data); }
- wxHtmlHelpFrame(wxWindow* parent, wxWindowID wxWindowID,
- const wxString& title = wxEmptyString,
- int style = wxHF_DEFAULTSTYLE, wxHtmlHelpData* data = NULL);
- bool Create(wxWindow* parent, wxWindowID id, const wxString& title = wxEmptyString,
- int style = wxHF_DEFAULTSTYLE);
- ~wxHtmlHelpFrame();
+public:
+ wxHtmlHelpFrame(wxHtmlHelpData* data = NULL) { Init(data); }
+ wxHtmlHelpFrame(wxWindow* parent, wxWindowID wxWindowID,
+ const wxString& title = wxEmptyString,
+ int style = wxHF_DEFAULTSTYLE, wxHtmlHelpData* data = NULL);
+ bool Create(wxWindow* parent, wxWindowID id, const wxString& title = wxEmptyString,
+ int style = wxHF_DEFAULTSTYLE);
+ ~wxHtmlHelpFrame();
- wxHtmlHelpData* GetData() { return m_Data; }
- wxHelpControllerBase* GetController() const { return m_helpController; }
- void SetController(wxHelpControllerBase* controller) { m_helpController = controller; }
+ wxHtmlHelpData* GetData() { return m_Data; }
+ wxHelpControllerBase* GetController() const { return m_helpController; }
+ void SetController(wxHelpControllerBase* controller) { m_helpController = controller; }
- void SetTitleFormat(const wxString& format);
- // Sets format of title of the frame. Must contain exactly one "%s"
- // (for title of displayed HTML page)
+ // Sets format of title of the frame. Must contain exactly one "%s"
+ // (for title of displayed HTML page)
+ void SetTitleFormat(const wxString& format);
- bool Display(const wxString& x);
- // Displays page x. If not found it will offect the user a choice of
- // searching books.
- // Looking for the page runs in these steps:
- // 1. try to locate file named x (if x is for example "doc/howto.htm")
- // 2. try to open starting page of book x
- // 3. try to find x in contents (if x is for example "How To ...")
- // 4. try to find x in index (if x is for example "How To ...")
- bool Display(const int id);
- // Alternative version that works with numeric ID.
- // (uses extension to MS format, , see docs)
+ // Displays page x. If not found it will offect the user a choice of
+ // searching books.
+ // Looking for the page runs in these steps:
+ // 1. try to locate file named x (if x is for example "doc/howto.htm")
+ // 2. try to open starting page of book x
+ // 3. try to find x in contents (if x is for example "How To ...")
+ // 4. try to find x in index (if x is for example "How To ...")
+ bool Display(const wxString& x);
- bool DisplayContents();
- // Displays help window and focuses contents.
+ // Alternative version that works with numeric ID.
+ // (uses extension to MS format, , see docs)
+ bool Display(const int id);
- bool DisplayIndex();
- // Displays help window and focuses index.
+ // Displays help window and focuses contents.
+ bool DisplayContents();
- bool KeywordSearch(const wxString& keyword);
- // Searches for keyword. Returns TRUE and display page if found, return
- // FALSE otherwise
- // Syntax of keyword is Altavista-like:
- // * words are separated by spaces
- // (but "\"hello world\"" is only one world "hello world")
- // * word may be pretended by + or -
- // (+ : page must contain the word ; - : page can't contain the word)
- // * if there is no + or - before the word, + is default
+ // Displays help window and focuses index.
+ bool DisplayIndex();
- void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString)
- {
- m_Config = config;
- m_ConfigRoot = rootpath;
- ReadCustomization(config, rootpath);
- }
+ // Searches for keyword. Returns TRUE and display page if found, return
+ // FALSE otherwise
+ // Syntax of keyword is Altavista-like:
+ // * words are separated by spaces
+ // (but "\"hello world\"" is only one world "hello world")
+ // * word may be pretended by + or -
+ // (+ : page must contain the word ; - : page can't contain the word)
+ // * if there is no + or - before the word, + is default
+ bool KeywordSearch(const wxString& keyword);
- void ReadCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString);
- // saves custom settings into cfg config. it will use the path 'path'
- // if given, otherwise it will save info into currently selected path.
- // saved values : things set by SetFonts, SetBorders.
- void WriteCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString);
- // ...
-
- void NotifyPageChanged();
- // call this to let wxHtmlHelpFrame know page changed
+ void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString)
+ {
+ m_Config = config;
+ m_ConfigRoot = rootpath;
+ ReadCustomization(config, rootpath);
+ }
- protected:
- void Init(wxHtmlHelpData* data = NULL);
+ // Saves custom settings into cfg config. it will use the path 'path'
+ // if given, otherwise it will save info into currently selected path.
+ // saved values : things set by SetFonts, SetBorders.
+ void ReadCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString);
+ void WriteCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString);
- void RefreshLists();
- // Refreshes Contents and Index tabs
+ // call this to let wxHtmlHelpFrame know page changed
+ void NotifyPageChanged();
- void CreateContents();
- // Adds items to m_Contents tree control
+protected:
+ void Init(wxHtmlHelpData* data = NULL);
- void CreateIndex();
- // Adds items to m_IndexList
+ // Refreshes Contents and Index tabs
+ void RefreshLists();
- void CreateSearch();
- // Add books to search choice panel
+ // Adds items to m_Contents tree control
+ void CreateContents();
- virtual void AddToolbarButtons(wxToolBar *toolBar, int style);
- // Add custom buttons to toolbar
+ // Adds items to m_IndexList
+ void CreateIndex();
- virtual void OptionsDialog();
- // Displays options dialog (fonts etc.)
+ // Add books to search choice panel
+ void CreateSearch();
- void OnToolbar(wxCommandEvent& event);
- void OnContentsSel(wxTreeEvent& event);
- void OnIndexSel(wxCommandEvent& event);
- void OnIndexFind(wxCommandEvent& event);
- void OnIndexAll(wxCommandEvent& event);
- void OnSearchSel(wxCommandEvent& event);
- void OnSearch(wxCommandEvent& event);
- void OnBookmarksSel(wxCommandEvent& event);
- void OnCloseWindow(wxCloseEvent& event);
+ // Add custom buttons to toolbar
+ virtual void AddToolbarButtons(wxToolBar *toolBar, int style);
- // Images:
- enum {
- IMG_Book = 0,
- IMG_Folder,
- IMG_Page,
- IMG_RootFolder
- };
+ // Displays options dialog (fonts etc.)
+ virtual void OptionsDialog();
- protected:
- wxHtmlHelpData* m_Data;
- bool m_DataCreated; // m_Data created by frame, or supplied?
- wxString m_TitleFormat; // title of the help frame
- // below are various pointers to GUI components
- wxHtmlWindow *m_HtmlWin;
- wxSplitterWindow *m_Splitter;
- wxNotebook *m_NavigPan;
- wxTreeCtrl *m_ContentsBox;
- wxTextCtrl *m_IndexText;
- wxButton *m_IndexButton;
- wxButton *m_IndexButtonAll;
- wxListBox *m_IndexList;
- wxTextCtrl *m_SearchText;
- wxButton *m_SearchButton;
- wxListBox *m_SearchList;
- wxChoice *m_SearchChoice;
- wxStaticText *m_IndexCountInfo;
- wxCheckBox *m_SearchCaseSensitive;
- wxCheckBox *m_SearchWholeWords;
+ void OnToolbar(wxCommandEvent& event);
+ void OnContentsSel(wxTreeEvent& event);
+ void OnIndexSel(wxCommandEvent& event);
+ void OnIndexFind(wxCommandEvent& event);
+ void OnIndexAll(wxCommandEvent& event);
+ void OnSearchSel(wxCommandEvent& event);
+ void OnSearch(wxCommandEvent& event);
+ void OnBookmarksSel(wxCommandEvent& event);
+ void OnCloseWindow(wxCloseEvent& event);
- wxComboBox *m_Bookmarks;
- wxArrayString m_BookmarksNames, m_BookmarksPages;
+ // Images:
+ enum {
+ IMG_Book = 0,
+ IMG_Folder,
+ IMG_Page,
+ IMG_RootFolder
+ };
- wxHtmlHelpFrameCfg m_Cfg;
+protected:
+ wxHtmlHelpData* m_Data;
+ bool m_DataCreated; // m_Data created by frame, or supplied?
+ wxString m_TitleFormat; // title of the help frame
+ // below are various pointers to GUI components
+ wxHtmlWindow *m_HtmlWin;
+ wxSplitterWindow *m_Splitter;
+ wxNotebook *m_NavigPan;
+ wxTreeCtrl *m_ContentsBox;
+ wxTextCtrl *m_IndexText;
+ wxButton *m_IndexButton;
+ wxButton *m_IndexButtonAll;
+ wxListBox *m_IndexList;
+ wxTextCtrl *m_SearchText;
+ wxButton *m_SearchButton;
+ wxListBox *m_SearchList;
+ wxChoice *m_SearchChoice;
+ wxStaticText *m_IndexCountInfo;
+ wxCheckBox *m_SearchCaseSensitive;
+ wxCheckBox *m_SearchWholeWords;
- wxConfigBase *m_Config;
- wxString m_ConfigRoot;
+ wxComboBox *m_Bookmarks;
+ wxArrayString m_BookmarksNames, m_BookmarksPages;
- // pagenumbers of controls in notebook (usually 0,1,2)
- int m_ContentsPage;
- int m_IndexPage;
- int m_SearchPage;
-
- // lists of available fonts (used in options dialog)
- wxArrayString *m_NormalFonts, *m_FixedFonts;
- int m_FontSize; // 0,1,2 = small,medium,big
- wxString m_NormalFace, m_FixedFace;
-
- bool m_UpdateContents;
+ wxHtmlHelpFrameCfg m_Cfg;
+
+ wxConfigBase *m_Config;
+ wxString m_ConfigRoot;
+
+ // pagenumbers of controls in notebook (usually 0,1,2)
+ int m_ContentsPage;
+ int m_IndexPage;
+ int m_SearchPage;
+
+ // lists of available fonts (used in options dialog)
+ wxArrayString *m_NormalFonts, *m_FixedFonts;
+ int m_FontSize; // 0,1,2 = small,medium,big
+ wxString m_NormalFace, m_FixedFace;
+
+ bool m_UpdateContents;
#if wxUSE_PRINTING_ARCHITECTURE
- wxHtmlEasyPrinting *m_Printer;
+ wxHtmlEasyPrinting *m_Printer;
#endif
- wxHashTable *m_PagesHash;
- wxHelpControllerBase* m_helpController;
+ wxHashTable *m_PagesHash;
+ wxHelpControllerBase* m_helpController;
- DECLARE_EVENT_TABLE()
+ DECLARE_EVENT_TABLE()
};
#endif // wxUSE_HTML
diff --git a/include/wx/html/htmlcell.h b/include/wx/html/htmlcell.h
index ef3c6952a8..4f7532a910 100644
--- a/include/wx/html/htmlcell.h
+++ b/include/wx/html/htmlcell.h
@@ -13,7 +13,7 @@
#define _WX_HTMLCELL_H_
#ifdef __GNUG__
-#pragma interface
+#pragma interface "htmlcell.h"
#endif
#include "wx/defs.h"
@@ -39,94 +39,94 @@ class WXDLLEXPORT wxHtmlContainerCell;
class WXDLLEXPORT wxHtmlCell : public wxObject
{
- public:
- wxHtmlCell();
- virtual ~wxHtmlCell();
+public:
+ wxHtmlCell();
+ virtual ~wxHtmlCell();
- void SetParent(wxHtmlContainerCell *p) {m_Parent = p;}
- wxHtmlContainerCell *GetParent() const {return m_Parent;}
+ void SetParent(wxHtmlContainerCell *p) {m_Parent = p;}
+ wxHtmlContainerCell *GetParent() const {return m_Parent;}
- int GetPosX() const {return m_PosX;}
- int GetPosY() const {return m_PosY;}
- int GetWidth() const {return m_Width;}
- int GetHeight() const {return m_Height;}
- int GetDescent() const {return m_Descent;}
- virtual wxHtmlLinkInfo* GetLink(int WXUNUSED(x) = 0,
- int WXUNUSED(y) = 0) const
- { return m_Link; }
- // returns the link associated with this cell. The position is position within
- // the cell so it varies from 0 to m_Width, from 0 to m_Height
- wxHtmlCell *GetNext() const {return m_Next;}
- // members access methods
+ int GetPosX() const {return m_PosX;}
+ int GetPosY() const {return m_PosY;}
+ int GetWidth() const {return m_Width;}
+ int GetHeight() const {return m_Height;}
+ int GetDescent() const {return m_Descent;}
- virtual void SetPos(int x, int y) {m_PosX = x, m_PosY = y;}
- void SetLink(const wxHtmlLinkInfo& link);
- void SetNext(wxHtmlCell *cell) {m_Next = cell;}
- // members writin methods
+ // returns the link associated with this cell. The position is position within
+ // the cell so it varies from 0 to m_Width, from 0 to m_Height
+ virtual wxHtmlLinkInfo* GetLink(int WXUNUSED(x) = 0, int WXUNUSED(y) = 0) const
+ { return m_Link; }
- virtual void Layout(int w);
- // 1. adjust cell's width according to the fact that maximal possible width is w.
- // (this has sense when working with horizontal lines, tables etc.)
- // 2. prepare layout (=fill-in m_PosX, m_PosY (and sometime m_Height) members)
- // = place items to fit window, according to the width w
+ // members access methods
+ wxHtmlCell *GetNext() const {return m_Next;}
- virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
- // renders the cell
+ // members writin methods
+ virtual void SetPos(int x, int y) {m_PosX = x, m_PosY = y;}
+ void SetLink(const wxHtmlLinkInfo& link);
+ void SetNext(wxHtmlCell *cell) {m_Next = cell;}
- virtual void DrawInvisible(wxDC& dc, int x, int y);
- // proceed drawing actions in case the cell is not visible (scrolled out of screen).
- // This is needed to change fonts, colors and so on
+ // 1. adjust cell's width according to the fact that maximal possible width is w.
+ // (this has sense when working with horizontal lines, tables etc.)
+ // 2. prepare layout (=fill-in m_PosX, m_PosY (and sometime m_Height) members)
+ // = place items to fit window, according to the width w
+ virtual void Layout(int w);
- virtual const wxHtmlCell* Find(int condition, const void* param) const;
- // This method returns pointer to the FIRST cell for that
- // the condition
- // is true. It first checks if the condition is true for this
- // cell and then calls m_Next->Find(). (Note: it checks
- // all subcells if the cell is container)
- // Condition is unique condition identifier (see htmldefs.h)
- // (user-defined condition IDs should start from 10000)
- // and param is optional parameter
- // Example : m_Cell->Find(wxHTML_COND_ISANCHOR, "news");
- // returns pointer to anchor news
+ // renders the cell
+ virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
- virtual void OnMouseClick(wxWindow *parent, int x, int y, const wxMouseEvent& event);
- // This function is called when mouse button is clicked over the cell.
- // left, middle, right are flags indicating whether the button was or wasn't
- // pressed.
- // Parent is pointer to wxHtmlWindow that generated the event
- // HINT: if this handling is not enough for you you should use
- // wxHtmlBinderCell
+ // proceed drawing actions in case the cell is not visible (scrolled out of screen).
+ // This is needed to change fonts, colors and so on
+ virtual void DrawInvisible(wxDC& dc, int x, int y);
- virtual bool AdjustPagebreak(int *pagebreak) const;
- // This method used to adjust pagebreak position. The parameter is
- // variable that contains y-coordinate of page break (= horizontal line that
- // should not be crossed by words, images etc.). If this cell cannot be divided
- // into two pieces (each one on another page) then it moves the pagebreak
- // few pixels up.
- //
- // Returned value : true if pagebreak was modified, false otherwise
- // Usage : while (container->AdjustPagebreak(&p)) {}
+ // This method returns pointer to the FIRST cell for that
+ // the condition
+ // is true. It first checks if the condition is true for this
+ // cell and then calls m_Next->Find(). (Note: it checks
+ // all subcells if the cell is container)
+ // Condition is unique condition identifier (see htmldefs.h)
+ // (user-defined condition IDs should start from 10000)
+ // and param is optional parameter
+ // Example : m_Cell->Find(wxHTML_COND_ISANCHOR, "news");
+ // returns pointer to anchor news
+ virtual const wxHtmlCell* Find(int condition, const void* param) const;
- void SetCanLiveOnPagebreak(bool can) {m_CanLiveOnPagebreak = can;}
- // Sets cell's behaviour on pagebreaks (see AdjustPagebreak). Default
- // is true - the cell can be split on two pages
+ // This function is called when mouse button is clicked over the cell.
+ // left, middle, right are flags indicating whether the button was or wasn't
+ // pressed.
+ // Parent is pointer to wxHtmlWindow that generated the event
+ // HINT: if this handling is not enough for you you should use
+ // wxHtmlBinderCell
+ virtual void OnMouseClick(wxWindow *parent, int x, int y, const wxMouseEvent& event);
+
+ // This method used to adjust pagebreak position. The parameter is
+ // variable that contains y-coordinate of page break (= horizontal line that
+ // should not be crossed by words, images etc.). If this cell cannot be divided
+ // into two pieces (each one on another page) then it moves the pagebreak
+ // few pixels up.
+ //
+ // Returned value : true if pagebreak was modified, false otherwise
+ // Usage : while (container->AdjustPagebreak(&p)) {}
+ virtual bool AdjustPagebreak(int *pagebreak) const;
+
+ // Sets cell's behaviour on pagebreaks (see AdjustPagebreak). Default
+ // is true - the cell can be split on two pages
+ void SetCanLiveOnPagebreak(bool can) {m_CanLiveOnPagebreak = can;}
- protected:
- wxHtmlCell *m_Next;
- // pointer to the next cell
- wxHtmlContainerCell *m_Parent;
- // pointer to parent cell
- long m_Width, m_Height, m_Descent;
- // dimensions of fragment
- // m_Descent is used to position text&images..
- long m_PosX, m_PosY;
- // position where the fragment is drawn
- wxHtmlLinkInfo *m_Link;
- // destination address if this fragment is hypertext link, "" otherwise
- bool m_CanLiveOnPagebreak;
- // true if this cell can be placed on pagebreak, false otherwise
-
+protected:
+ wxHtmlCell *m_Next;
+ // pointer to the next cell
+ wxHtmlContainerCell *m_Parent;
+ // pointer to parent cell
+ long m_Width, m_Height, m_Descent;
+ // dimensions of fragment
+ // m_Descent is used to position text&images..
+ long m_PosX, m_PosY;
+ // position where the fragment is drawn
+ wxHtmlLinkInfo *m_Link;
+ // destination address if this fragment is hypertext link, "" otherwise
+ bool m_CanLiveOnPagebreak;
+ // true if this cell can be placed on pagebreak, false otherwise
};
@@ -144,12 +144,12 @@ class WXDLLEXPORT wxHtmlCell : public wxObject
class WXDLLEXPORT wxHtmlWordCell : public wxHtmlCell
{
- public:
- wxHtmlWordCell(const wxString& word, wxDC& dc);
- void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
+public:
+ wxHtmlWordCell(const wxString& word, wxDC& dc);
+ void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
- protected:
- wxString m_Word;
+protected:
+ wxString m_Word;
};
@@ -163,70 +163,74 @@ class WXDLLEXPORT wxHtmlWordCell : public wxHtmlCell
class WXDLLEXPORT wxHtmlContainerCell : public wxHtmlCell
{
- public:
- wxHtmlContainerCell(wxHtmlContainerCell *parent);
- ~wxHtmlContainerCell();
+public:
+ wxHtmlContainerCell(wxHtmlContainerCell *parent);
+ ~wxHtmlContainerCell();
- virtual void Layout(int w);
- virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
- virtual void DrawInvisible(wxDC& dc, int x, int y);
- virtual bool AdjustPagebreak(int *pagebreak) const;
+ virtual void Layout(int w);
+ virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
+ virtual void DrawInvisible(wxDC& dc, int x, int y);
+ virtual bool AdjustPagebreak(int *pagebreak) const;
- void InsertCell(wxHtmlCell *cell);
- // insert cell at the end of m_Cells list
- void SetAlignHor(int al) {m_AlignHor = al; m_LastLayout = -1;}
- int GetAlignHor() const {return m_AlignHor;}
- void SetAlignVer(int al) {m_AlignVer = al; m_LastLayout = -1;}
- // sets horizontal/vertical alignment
- int GetAlignVer() const {return m_AlignVer;}
- void SetIndent(int i, int what, int units = wxHTML_UNITS_PIXELS);
- // sets left-border indentation. units is one of wxHTML_UNITS_* constants
- // what is combination of wxHTML_INDENT_*
- int GetIndent(int ind) const;
- // returns the indentation. ind is one of wxHTML_INDENT_* constants
- int GetIndentUnits(int ind) const;
- // returns type of value returned by GetIndent(ind)
- void SetAlign(const wxHtmlTag& tag);
- // sets alignment info based on given tag's params
- void SetWidthFloat(int w, int units) {m_WidthFloat = w; m_WidthFloatUnits = units; m_LastLayout = -1;}
- void SetWidthFloat(const wxHtmlTag& tag, double pixel_scale = 1.0);
- // sets floating width adjustment
- // (examples : 32 percent of parent container,
- // -15 pixels percent (this means 100 % - 15 pixels)
- void SetMinHeight(int h, int align = wxHTML_ALIGN_TOP) {m_MinHeight = h; m_MinHeightAlign = align; m_LastLayout = -1;}
- // sets minimal height of this container.
- void SetBackgroundColour(const wxColour& clr) {m_UseBkColour = TRUE; m_BkColour = clr;}
- void SetBorder(const wxColour& clr1, const wxColour& clr2) {m_UseBorder = TRUE; m_BorderColour1 = clr1, m_BorderColour2 = clr2;}
- virtual wxHtmlLinkInfo* GetLink(int x = 0, int y = 0) const;
- virtual const wxHtmlCell* Find(int condition, const void* param) const;
- virtual void OnMouseClick(wxWindow *parent, int x, int y, const wxMouseEvent& event);
+ // insert cell at the end of m_Cells list
+ void InsertCell(wxHtmlCell *cell);
- wxHtmlCell* GetFirstCell() const {return m_Cells;}
- // returns pointer to the first cell in container or NULL
+ // sets horizontal/vertical alignment
+ void SetAlignHor(int al) {m_AlignHor = al; m_LastLayout = -1;}
+ int GetAlignHor() const {return m_AlignHor;}
+ void SetAlignVer(int al) {m_AlignVer = al; m_LastLayout = -1;}
+ int GetAlignVer() const {return m_AlignVer;}
- protected:
- int m_IndentLeft, m_IndentRight, m_IndentTop, m_IndentBottom;
- // indentation of subcells. There is always m_Indent pixels
- // big space between given border of the container and the subcells
- // it m_Indent < 0 it is in PERCENTS, otherwise it is in pixels
- int m_MinHeight, m_MinHeightAlign;
- // minimal height.
- wxHtmlCell *m_Cells, *m_LastCell;
- // internal cells, m_Cells points to the first of them, m_LastCell to the last one.
- // (LastCell is needed only to speed-up InsertCell)
- int m_AlignHor, m_AlignVer;
- // alignment horizontal and vertical (left, center, right)
- int m_WidthFloat, m_WidthFloatUnits;
- // width float is used in adjustWidth
- bool m_UseBkColour;
- wxColour m_BkColour;
- // background color of this container
- bool m_UseBorder;
- wxColour m_BorderColour1, m_BorderColour2;
- // borders color of this container
- int m_LastLayout;
- // if != -1 then call to Layout may be no-op
- // if previous call to Layout has same argument
+ // sets left-border indentation. units is one of wxHTML_UNITS_* constants
+ // what is combination of wxHTML_INDENT_*
+ void SetIndent(int i, int what, int units = wxHTML_UNITS_PIXELS);
+ // returns the indentation. ind is one of wxHTML_INDENT_* constants
+ int GetIndent(int ind) const;
+ // returns type of value returned by GetIndent(ind)
+ int GetIndentUnits(int ind) const;
+
+ // sets alignment info based on given tag's params
+ void SetAlign(const wxHtmlTag& tag);
+ // sets floating width adjustment
+ // (examples : 32 percent of parent container,
+ // -15 pixels percent (this means 100 % - 15 pixels)
+ void SetWidthFloat(int w, int units) {m_WidthFloat = w; m_WidthFloatUnits = units; m_LastLayout = -1;}
+ void SetWidthFloat(const wxHtmlTag& tag, double pixel_scale = 1.0);
+ // sets minimal height of this container.
+ void SetMinHeight(int h, int align = wxHTML_ALIGN_TOP) {m_MinHeight = h; m_MinHeightAlign = align; m_LastLayout = -1;}
+
+ void SetBackgroundColour(const wxColour& clr) {m_UseBkColour = TRUE; m_BkColour = clr;}
+ void SetBorder(const wxColour& clr1, const wxColour& clr2) {m_UseBorder = TRUE; m_BorderColour1 = clr1, m_BorderColour2 = clr2;}
+ virtual wxHtmlLinkInfo* GetLink(int x = 0, int y = 0) const;
+ virtual const wxHtmlCell* Find(int condition, const void* param) const;
+ virtual void OnMouseClick(wxWindow *parent, int x, int y, const wxMouseEvent& event);
+
+ // returns pointer to the first cell in container or NULL
+ wxHtmlCell* GetFirstCell() const {return m_Cells;}
+
+protected:
+ int m_IndentLeft, m_IndentRight, m_IndentTop, m_IndentBottom;
+ // indentation of subcells. There is always m_Indent pixels
+ // big space between given border of the container and the subcells
+ // it m_Indent < 0 it is in PERCENTS, otherwise it is in pixels
+ int m_MinHeight, m_MinHeightAlign;
+ // minimal height.
+ wxHtmlCell *m_Cells, *m_LastCell;
+ // internal cells, m_Cells points to the first of them, m_LastCell to the last one.
+ // (LastCell is needed only to speed-up InsertCell)
+ int m_AlignHor, m_AlignVer;
+ // alignment horizontal and vertical (left, center, right)
+ int m_WidthFloat, m_WidthFloatUnits;
+ // width float is used in adjustWidth
+ bool m_UseBkColour;
+ wxColour m_BkColour;
+ // background color of this container
+ bool m_UseBorder;
+ wxColour m_BorderColour1, m_BorderColour2;
+ // borders color of this container
+ int m_LastLayout;
+ // if != -1 then call to Layout may be no-op
+ // if previous call to Layout has same argument
};
@@ -240,14 +244,14 @@ class WXDLLEXPORT wxHtmlContainerCell : public wxHtmlCell
class WXDLLEXPORT wxHtmlColourCell : public wxHtmlCell
{
- public:
- wxHtmlColourCell(const wxColour& clr, int flags = wxHTML_CLR_FOREGROUND) : wxHtmlCell() {m_Colour = clr; m_Flags = flags;}
- virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
- virtual void DrawInvisible(wxDC& dc, int x, int y);
+public:
+ wxHtmlColourCell(const wxColour& clr, int flags = wxHTML_CLR_FOREGROUND) : wxHtmlCell() {m_Colour = clr; m_Flags = flags;}
+ virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
+ virtual void DrawInvisible(wxDC& dc, int x, int y);
- protected:
- wxColour m_Colour;
- unsigned m_Flags;
+protected:
+ wxColour m_Colour;
+ unsigned m_Flags;
};
@@ -260,13 +264,13 @@ class WXDLLEXPORT wxHtmlColourCell : public wxHtmlCell
class WXDLLEXPORT wxHtmlFontCell : public wxHtmlCell
{
- public:
- wxHtmlFontCell(wxFont *font) : wxHtmlCell() { m_Font = (*font); }
- virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
- virtual void DrawInvisible(wxDC& dc, int x, int y);
+public:
+ wxHtmlFontCell(wxFont *font) : wxHtmlCell() { m_Font = (*font); }
+ virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
+ virtual void DrawInvisible(wxDC& dc, int x, int y);
- protected:
- wxFont m_Font;
+protected:
+ wxFont m_Font;
};
@@ -283,21 +287,21 @@ class WXDLLEXPORT wxHtmlFontCell : public wxHtmlCell
class WXDLLEXPORT wxHtmlWidgetCell : public wxHtmlCell
{
- public:
- wxHtmlWidgetCell(wxWindow *wnd, int w = 0);
- // !!! wnd must have correct parent!
- // if w != 0 then the m_Wnd has 'floating' width - it adjust
- // it's width according to parent container's width
- // (w is percent of parent's width)
- ~wxHtmlWidgetCell() { m_Wnd->Destroy(); }
- virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
- virtual void DrawInvisible(wxDC& dc, int x, int y);
- virtual void Layout(int w);
+public:
+ // !!! wnd must have correct parent!
+ // if w != 0 then the m_Wnd has 'floating' width - it adjust
+ // it's width according to parent container's width
+ // (w is percent of parent's width)
+ wxHtmlWidgetCell(wxWindow *wnd, int w = 0);
+ ~wxHtmlWidgetCell() { m_Wnd->Destroy(); }
+ virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
+ virtual void DrawInvisible(wxDC& dc, int x, int y);
+ virtual void Layout(int w);
- protected:
- wxWindow* m_Wnd;
- int m_WidthFloat;
- // width float is used in adjustWidth (it is in percents)
+protected:
+ wxWindow* m_Wnd;
+ int m_WidthFloat;
+ // width float is used in adjustWidth (it is in percents)
};
@@ -309,28 +313,30 @@ class WXDLLEXPORT wxHtmlWidgetCell : public wxHtmlCell
class WXDLLEXPORT wxHtmlLinkInfo : public wxObject
{
- public:
- wxHtmlLinkInfo() : wxObject()
- { m_Href = m_Target = wxEmptyString; m_Event = NULL, m_Cell = NULL; }
- wxHtmlLinkInfo(const wxString& href, const wxString& target = wxEmptyString) : wxObject()
- { m_Href = href; m_Target = target; m_Event = NULL, m_Cell = NULL; }
- wxHtmlLinkInfo(const wxHtmlLinkInfo& l) : wxObject()
- { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event, m_Cell = l.m_Cell; }
- wxHtmlLinkInfo& operator=(const wxHtmlLinkInfo& l)
- { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event, m_Cell = l.m_Cell; return *this; }
+public:
+ wxHtmlLinkInfo() : wxObject()
+ { m_Href = m_Target = wxEmptyString; m_Event = NULL, m_Cell = NULL; }
+ wxHtmlLinkInfo(const wxString& href, const wxString& target = wxEmptyString) : wxObject()
+ { m_Href = href; m_Target = target; m_Event = NULL, m_Cell = NULL; }
+ wxHtmlLinkInfo(const wxHtmlLinkInfo& l) : wxObject()
+ { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event;
+ m_Cell = l.m_Cell; }
+ wxHtmlLinkInfo& operator=(const wxHtmlLinkInfo& l)
+ { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event;
+ m_Cell = l.m_Cell; return *this; }
- void SetEvent(const wxMouseEvent *e) { m_Event = e; }
- void SetHtmlCell(const wxHtmlCell *e) { m_Cell = e; }
+ void SetEvent(const wxMouseEvent *e) { m_Event = e; }
+ void SetHtmlCell(const wxHtmlCell *e) { m_Cell = e; }
- wxString GetHref() const { return m_Href; }
- wxString GetTarget() const { return m_Target; }
- const wxMouseEvent* GetEvent() const { return m_Event; }
- const wxHtmlCell* GetHtmlCell() const { return m_Cell; }
+ wxString GetHref() const { return m_Href; }
+ wxString GetTarget() const { return m_Target; }
+ const wxMouseEvent* GetEvent() const { return m_Event; }
+ const wxHtmlCell* GetHtmlCell() const { return m_Cell; }
- private:
- wxString m_Href, m_Target;
- const wxMouseEvent *m_Event;
- const wxHtmlCell *m_Cell;
+private:
+ wxString m_Href, m_Target;
+ const wxMouseEvent *m_Event;
+ const wxHtmlCell *m_Cell;
};
diff --git a/include/wx/html/htmlpars.h b/include/wx/html/htmlpars.h
index 272c44ad5e..6a93d07ddb 100644
--- a/include/wx/html/htmlpars.h
+++ b/include/wx/html/htmlpars.h
@@ -12,7 +12,7 @@
#define _WX_HTMLPARS_H_
#ifdef __GNUG__
-#pragma interface
+#pragma interface "htmlpars.h"
#endif
#include "wx/defs.h"
diff --git a/include/wx/html/htmltag.h b/include/wx/html/htmltag.h
index 88aacdd4dd..7ce80f3629 100644
--- a/include/wx/html/htmltag.h
+++ b/include/wx/html/htmltag.h
@@ -12,56 +12,38 @@
#define _WX_HTMLTAG_H_
#ifdef __GNUG__
-#pragma interface
+#pragma interface "htmltag.h"
#endif
#include "wx/defs.h"
#if wxUSE_HTML
-
-//--------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
// wxHtmlTagsCache
-// !! INTERNAL STRUCTURE !! Do not use in your program!
-// This structure contains information on positions of tags
-// in the string being parsed
-//--------------------------------------------------------------------------------
-
-typedef struct {
- int Key;
- // this is "pos" value passed to wxHtmlTag's constructor.
- // it is position of '<' character of the tag
- int End1, End2;
- // end positions for the tag:
- // end1 is '<' of ending tag,
- // end2 is '>' or both are
- // -1 if there is no ending tag for this one...
- // or -2 if this is ending tag
- wxChar *Name;
- // name of this tag
- } sCacheItem;
-
+// - internal wxHTML class, do not use!
+//-----------------------------------------------------------------------------
+struct wxHtmlCacheItem;
class wxHtmlTagsCache : public wxObject
{
DECLARE_DYNAMIC_CLASS(wxHtmlTagsCache)
- private:
- sCacheItem *m_Cache;
- int m_CacheSize;
- int m_CachePos;
+private:
+ wxHtmlCacheItem *m_Cache;
+ int m_CacheSize;
+ int m_CachePos;
- public:
- wxHtmlTagsCache() : wxObject() {m_CacheSize = 0; m_Cache = NULL;}
- wxHtmlTagsCache(const wxString& source);
- ~wxHtmlTagsCache() {free(m_Cache);}
+public:
+ wxHtmlTagsCache() : wxObject() {m_CacheSize = 0; m_Cache = NULL;}
+ wxHtmlTagsCache(const wxString& source);
+ ~wxHtmlTagsCache() {free(m_Cache);}
- void QueryTag(int at, int* end1, int* end2);
- // Finds parameters for tag starting at at and fills the variables
+ // Finds parameters for tag starting at at and fills the variables
+ void QueryTag(int at, int* end1, int* end2);
};
-
//--------------------------------------------------------------------------------
// wxHtmlTag
// This represents single tag. It is used as internal structure
@@ -72,63 +54,62 @@ class WXDLLEXPORT wxHtmlTag : public wxObject
{
DECLARE_CLASS(wxHtmlTag)
- public:
- wxHtmlTag(const wxString& source, int pos, int end_pos, wxHtmlTagsCache* cache);
- // constructs wxHtmlTag object based on HTML tag.
- // The tag begins (with '<' character) at position pos in source
- // end_pos is position where parsing ends (usually end of document)
+public:
+ // constructs wxHtmlTag object based on HTML tag.
+ // The tag begins (with '<' character) at position pos in source
+ // end_pos is position where parsing ends (usually end of document)
+ wxHtmlTag(const wxString& source, int pos, int end_pos, wxHtmlTagsCache* cache);
- inline wxString GetName() const {return m_Name;}
- // Returns tag's name in uppercase.
-
- bool HasParam(const wxString& par) const;
- // Returns TRUE if the tag has given parameter. Parameter
- // should always be in uppercase.
- // Example : HasParam("SRC") returns TRUE
-
- wxString GetParam(const wxString& par, bool with_commas = FALSE) const;
- // Returns value of the param. Value is in uppercase unless it is
- // enclosed with "
- // Example :
GetParam("ALIGN") returns (RIGHT) - //
GetParam("SRC") returns (WhaT.jpg)
- // (or ("WhaT.jpg") if with_commas == TRUE)
+ // Returns tag's name in uppercase.
+ inline wxString GetName() const {return m_Name;}
- int ScanParam(const wxString& par, wxChar *format, void *param) const;
- // Scans param like scanf() functions family do.
- // Example : ScanParam("COLOR", "\"#%X\"", &clr);
- // This is always with with_commas=FALSE
- // Returns number of scanned values
- // (like sscanf() does)
- // NOTE: unlike scanf family, this function only accepts
- // *one* parameter !
+ // Returns TRUE if the tag has given parameter. Parameter
+ // should always be in uppercase.
+ // Example : GetParam("ALIGN") returns (RIGHT)
+ // GetParam("SRC") returns (WhaT.jpg)
+ // (or ("WhaT.jpg") if with_commas == TRUE)
+ wxString GetParam(const wxString& par, bool with_commas = FALSE) const;
- inline int GetBeginPos() const {return m_Begin;}
- // returns beginning position of _internal_ block of text
- // See explanation (returned value is marked with *):
- // bla bla bla HasParam("SRC") returns TRUE
+ bool HasParam(const wxString& par) const;
- inline const wxString& GetAllParams() const {return m_Params;}
- // Returns string containing all params.
-
- inline bool IsEnding() const {return m_Ending;}
- // return TRUE if this is ending tag () or FALSE
- // if it isn't (