Returns full location of the opened page. If no page is opened or if the displayed page wasn't
produced by call to LoadPage, empty string is returned.
+\membersection{wxHtmlWindow::GetOpenedPageTitle}\label{wxhtmlwindowgetopenedpagetitle}
+
+\func{wxString}{GetOpenedPageTitle}{\void}
+
+Returns title of the opened page or wxEmptyString if current page does not contain {\tt <TITLE>} tag.
+
\membersection{wxHtmlWindow::GetRelatedFrame}\label{wxhtmlwindowgetrelatedframe}
\constfunc{wxFrame*}{GetRelatedFrame}{\void}
Called when user clicks on hypertext link. Default behaviour is to call
\helpref{LoadPage}{wxhtmlwindowloadpage} and do nothing else.
+
+\membersection{wxHtmlWindow::OnSetTitle}\label{wxhtmlwindowonsettitle}
+
+\func{virtual void}{OnSetTitle}{\param{const wxString\& }{title}}
+
+Called on parsing {\tt <TITLE>} tag.
+
+
\membersection{wxHtmlWindow::ReadCustomization}\label{wxhtmlwindowreadcustomization}
\func{virtual void}{ReadCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}}
\docparam{bar}{statusbar slot number (0..n)}
+
\membersection{wxHtmlWindow::WriteCustomization}\label{wxhtmlwindowwritecustomization}
\func{virtual void}{WriteCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}}
wxHtmlWindow() : wxScrolledWindow() {};
wxHtmlWindow(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = wxHW_SCROLLBAR_AUTO,
+ long style = wxHW_SCROLLBAR_AUTO,
const wxString& name = "htmlWindow");
~wxHtmlWindow();
wxString GetOpenedPage() const {return m_OpenedPage;}
// Returns full location of opened page
+ wxString GetOpenedPageTitle() const {return m_OpenedPageTitle;}
+ // Returns <TITLE> of opened page or empty string otherwise
+
void SetRelatedFrame(wxFrame* frame, const wxString& format);
// sets frame in which page title will be displayed. Format is format of
// frame title, e.g. "HtmlHelp : %s". It must contain exactly one %s
// sets fonts to be used when displaying HTML page.
// *_italic_mode can be either wxSLANT or wxITALIC
- void SetTitle(const wxString& title);
+ virtual void OnSetTitle(const wxString& title);
// Sets the title of the window
// (depending on the information passed to SetRelatedFrame() method)
// contains name of actualy opened page or empty string if no page opened
wxString m_OpenedAnchor;
// contains name of current anchor within m_OpenedPage
+ wxString m_OpenedPageTitle;
+ // contains title of actualy opened page or empty string if no <TITLE> tag
wxFileSystem* m_FS;
// class for opening files (file system)
m_RelatedStatusBar = -1;
m_RelatedFrame = NULL;
m_TitleFormat = "%s";
- m_OpenedPage = m_OpenedAnchor = wxEmptyString;
+ m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString;
m_Cell = NULL;
m_Parser = new wxHtmlWinParser(this);
m_Parser -> SetFS(m_FS);
void wxHtmlWindow::SetFonts(wxString normal_face, int normal_italic_mode, wxString fixed_face, int fixed_italic_mode, const int *sizes)
{
+ wxString op = m_OpenedPage;
+
m_Parser -> SetFonts(normal_face, normal_italic_mode, fixed_face, fixed_italic_mode, sizes);
- if (!m_OpenedPage.IsEmpty()) LoadPage(m_OpenedPage);
+ SetPage(wxT("")); // fonts changed => contents invalid
+ if (!op.IsEmpty()) LoadPage(op);
}
dc -> SetMapMode(wxMM_TEXT);
SetBackgroundColour(wxColour(0xFF, 0xFF, 0xFF));
- m_OpenedPage = m_OpenedAnchor = wxEmptyString;
+ m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString;
m_Parser -> SetDC(dc);
if (m_Cell) {
delete m_Cell;
}
-void wxHtmlWindow::SetTitle(const wxString& title)
+void wxHtmlWindow::OnSetTitle(const wxString& title)
{
if (m_RelatedFrame) {
wxString tit;
tit.Printf(m_TitleFormat, title.c_str());
m_RelatedFrame -> SetTitle(tit);
}
+ m_OpenedPageTitle = title;
}
{
wxString oldpath;
wxString tmp;
+ int p_fontsizes[7];
+ wxString p_fff, p_ffn;
+ int p_imf, p_imn;
if (path != wxEmptyString) {
oldpath = cfg -> GetPath();
}
m_Borders = cfg -> Read("wxHtmlWindow/Borders", m_Borders);
- m_Parser -> m_FontFaceFixed = cfg -> Read("wxHtmlWindow/FontFaceFixed", m_Parser -> m_FontFaceFixed);
- m_Parser -> m_FontFaceNormal = cfg -> Read("wxHtmlWindow/FontFaceNormal", m_Parser -> m_FontFaceNormal);
- m_Parser -> m_ItalicModeFixed = cfg -> Read("wxHtmlWindow/ItalicModeFixed", m_Parser -> m_ItalicModeFixed);
- m_Parser -> m_ItalicModeNormal = cfg -> Read("wxHtmlWindow/ItalicModeNormal", m_Parser -> m_ItalicModeNormal);
+ p_fff = cfg -> Read("wxHtmlWindow/FontFaceFixed", m_Parser -> m_FontFaceFixed);
+ p_ffn = cfg -> Read("wxHtmlWindow/FontFaceNormal", m_Parser -> m_FontFaceNormal);
+ p_imf = cfg -> Read("wxHtmlWindow/ItalicModeFixed", m_Parser -> m_ItalicModeFixed);
+ p_imn = cfg -> Read("wxHtmlWindow/ItalicModeNormal", m_Parser -> m_ItalicModeNormal);
for (int i = 0; i < 7; i++) {
tmp.Printf(wxT("wxHtmlWindow/FontsSize%i"), i);
- m_Parser -> m_FontsSizes[i] = cfg -> Read(tmp, m_Parser -> m_FontsSizes[i]);
+ p_fontsizes[i] = cfg -> Read(tmp, m_Parser -> m_FontsSizes[i]);
}
+ m_Parser -> SetFonts(p_ffn, p_imn, p_fff, p_imf, p_fontsizes);
if (path != wxEmptyString)
cfg -> SetPath(oldpath);
wxString *src = m_WParser -> GetSource();
for (int i = tag.GetBeginPos(); i < tag.GetEndPos1(); i++) title += (*src)[(unsigned int) i];
- wfr -> SetTitle(title);
+ wfr -> OnSetTitle(title);
}
}
return TRUE;