From 721ab9053804ef63e42f33841e242753f1ed66aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 27 Jan 2000 00:02:44 +0000 Subject: [PATCH] inline functions with if moved to .cpp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5698 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/html/helpctrl.h | 9 ++------- include/wx/html/helpfrm.h | 7 +------ include/wx/html/htmlcell.h | 12 ++++++------ src/html/helpctrl.cpp | 9 +++++++++ src/html/helpfrm.cpp | 24 +++++++++++++++++------- src/html/htmlcell.cpp | 34 ++++++++++++++++++++++++++++++++++ 6 files changed, 69 insertions(+), 26 deletions(-) diff --git a/include/wx/html/helpctrl.h b/include/wx/html/helpctrl.h index 8ea6bf5ad2..9263ab6026 100644 --- a/include/wx/html/helpctrl.h +++ b/include/wx/html/helpctrl.h @@ -54,13 +54,8 @@ class WXDLLEXPORT wxHtmlHelpController : public wxEvtHandler CreateHelpWindow(); return m_helpFrame->KeywordSearch(keyword); } wxHtmlHelpFrame* GetFrame() { return m_helpFrame; } - void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString) - { - m_Config = config; - m_ConfigRoot = rootpath; - if (m_helpFrame) m_helpFrame -> UseConfig(config, rootpath); - ReadCustomization(config, rootpath); - } + 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 diff --git a/include/wx/html/helpfrm.h b/include/wx/html/helpfrm.h index 64447f5b11..437314805b 100644 --- a/include/wx/html/helpfrm.h +++ b/include/wx/html/helpfrm.h @@ -104,12 +104,7 @@ class WXDLLEXPORT wxHtmlHelpFrame : public wxFrame wxHtmlHelpData* GetData() { return m_Data; } - void SetTitleFormat(const wxString& format) - { - if (m_HtmlWin) - m_HtmlWin->SetRelatedFrame(this, format); - m_TitleFormat = format; - } + void SetTitleFormat(const wxString& format); // Sets format of title of the frame. Must contain exactly one "%s" // (for title of displayed HTML page) diff --git a/include/wx/html/htmlcell.h b/include/wx/html/htmlcell.h index fbae189ba8..cf872a1def 100644 --- a/include/wx/html/htmlcell.h +++ b/include/wx/html/htmlcell.h @@ -64,20 +64,20 @@ class WXDLLEXPORT wxHtmlCell : public wxObject void SetNext(wxHtmlCell *cell) {m_Next = cell;} // members writin methods - virtual void Layout(int w) {SetPos(0, 0); if (m_Next) m_Next -> Layout(w);}; + 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 - virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) {if (m_Next) m_Next -> Draw(dc, x, y, view_y1, view_y2);} + virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2); // renders the cell - virtual void DrawInvisible(wxDC& dc, int x, int y) {if (m_Next) m_Next -> DrawInvisible(dc, x, y);}; + 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 - virtual const wxHtmlCell* Find(int condition, const void* param) const {if (m_Next) return m_Next -> Find(condition, param); else return NULL;} + 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 @@ -165,7 +165,7 @@ class WXDLLEXPORT wxHtmlContainerCell : public wxHtmlCell { public: wxHtmlContainerCell(wxHtmlContainerCell *parent); - ~wxHtmlContainerCell() {if (m_Cells) delete m_Cells;} + ~wxHtmlContainerCell(); virtual void Layout(int w); virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2); @@ -289,7 +289,7 @@ class WXDLLEXPORT wxHtmlWidgetCell : public wxHtmlCell // 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() {if (m_Wnd) m_Wnd -> Destroy(); } + ~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); diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp index 5e68f95352..d51344199c 100644 --- a/src/html/helpctrl.cpp +++ b/src/html/helpctrl.cpp @@ -141,4 +141,13 @@ void wxHtmlHelpController::WriteCustomization(wxConfigBase* cfg, const wxString& m_helpFrame->WriteCustomization(cfg, path); } +void wxHtmlHelpController::UseConfig(wxConfigBase *config, const wxString& rootpath) +{ + m_Config = config; + m_ConfigRoot = rootpath; + if (m_helpFrame) m_helpFrame -> UseConfig(config, rootpath); + ReadCustomization(config, rootpath); +} + + #endif diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index e1dda001ad..f9efaaa048 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -349,7 +349,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& ti m_IndexCountInfo -> SetConstraints(b5); wxLayoutConstraints *b3 = new wxLayoutConstraints; - m_IndexList = new wxListBox(dummy, wxID_HTML_INDEXLIST, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE | wxLB_ALWAYS_SB); + m_IndexList = new wxListBox(dummy, wxID_HTML_INDEXLIST, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE); b3 -> top.Below (m_IndexCountInfo, 5); b3 -> left.SameAs (dummy, wxLeft, 0); b3 -> right.SameAs (dummy, wxRight, 0); @@ -417,7 +417,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& ti m_SearchButton -> SetConstraints(b2); wxLayoutConstraints *b3 = new wxLayoutConstraints; - m_SearchList = new wxListBox(dummy, wxID_HTML_SEARCHLIST, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE | wxLB_ALWAYS_SB); + m_SearchList = new wxListBox(dummy, wxID_HTML_SEARCHLIST, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE); b3 -> top.Below (m_SearchButton, 10); b3 -> left.SameAs (dummy, wxLeft, 0); b3 -> right.SameAs (dummy, wxRight, 0); @@ -431,7 +431,6 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& ti } m_HtmlWin -> Show(TRUE); - RefreshLists(); // showtime @@ -513,6 +512,13 @@ void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style) } +void wxHtmlHelpFrame::SetTitleFormat(const wxString& format) +{ + if (m_HtmlWin) + m_HtmlWin->SetRelatedFrame(this, format); + m_TitleFormat = format; +} + bool wxHtmlHelpFrame::Display(const wxString& x) { @@ -1062,15 +1068,19 @@ void wxHtmlHelpFrame::OnToolbar(wxCommandEvent& event) if (m_PagesHash) { wxString an = m_HtmlWin -> GetOpenedAnchor(); + wxString adr; wxHtmlHelpHashData *ha; - if (an.IsEmpty()) - ha = (wxHtmlHelpHashData*) m_PagesHash -> Get(m_HtmlWin -> GetOpenedPage()); - else - ha = (wxHtmlHelpHashData*) m_PagesHash -> Get(m_HtmlWin -> GetOpenedPage() + wxT("#") + an); + + if (an.IsEmpty()) adr = m_HtmlWin -> GetOpenedPage(); + else adr = m_HtmlWin -> GetOpenedPage() + wxT("#") + an; + + ha = (wxHtmlHelpHashData*) m_PagesHash -> Get(adr); if (ha && ha -> m_Index < m_Data -> GetContentsCnt() - 1) { wxHtmlContentsItem *it = m_Data -> GetContents() + (ha -> m_Index + 1); + + while (it -> m_Book -> GetBasePath() + it -> m_Page == adr) it++; m_HtmlWin -> LoadPage(it -> m_Book -> GetBasePath() + it -> m_Page); NotifyPageChanged(); } diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index e6c3269665..7b6eb3aacd 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -92,6 +92,35 @@ void wxHtmlCell::SetLink(const wxHtmlLinkInfo& link) +void wxHtmlCell::Layout(int w) +{ + SetPos(0, 0); + if (m_Next) m_Next -> Layout(w); +} + + +void wxHtmlCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) +{ + if (m_Next) m_Next -> Draw(dc, x, y, view_y1, view_y2); +} + + + +void wxHtmlCell::DrawInvisible(wxDC& dc, int x, int y) +{ + if (m_Next) m_Next -> DrawInvisible(dc, x, y); +} + + + +const wxHtmlCell* wxHtmlCell::Find(int condition, const void* param) const +{ + if (m_Next) return m_Next -> Find(condition, param); + else return NULL; +} + + + //----------------------------------------------------------------------------- // wxHtmlWordCell //----------------------------------------------------------------------------- @@ -248,6 +277,11 @@ wxHtmlContainerCell::wxHtmlContainerCell(wxHtmlContainerCell *parent) : wxHtmlCe m_LastLayout = -1; } +wxHtmlContainerCell::~wxHtmlContainerCell() +{ + if (m_Cells) delete m_Cells; +} + void wxHtmlContainerCell::SetIndent(int i, int what, int units) -- 2.47.2