X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/66a77a748e5c8002f3f9ebd66f5457aca5aabad8..4304b42f1a1a586e96c645cb47d1cd3c98e3dec6:/src/html/htmlwin.cpp?ds=sidebyside diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index e7b07636cf..c1bdbfb3ee 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -12,7 +12,7 @@ #pragma implementation #endif -#include +#include "wx/wxprec.h" #include "wx/defs.h" #if wxUSE_HTML @@ -22,11 +22,10 @@ #endif #ifndef WXPRECOMP -#include +#include "wx/wx.h" #endif #include "wx/html/htmlwin.h" - #include "wx/html/forcelnk.h" @@ -37,7 +36,7 @@ -#include +#include "wx/arrimpl.cpp" WX_DEFINE_OBJARRAY(HtmlHistoryArray) @@ -51,7 +50,7 @@ wxHtmlWindow::wxHtmlWindow(wxWindow *parent, wxWindowID id, const wxPoint& pos, 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); @@ -96,8 +95,11 @@ void wxHtmlWindow::SetRelatedStatusBar(int bar) 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); } @@ -108,7 +110,7 @@ bool wxHtmlWindow::SetPage(const wxString& source) 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; @@ -128,7 +130,9 @@ bool wxHtmlWindow::LoadPage(const wxString& location) { wxFSFile *f; bool rt_val; - wxBusyCursor b; + + SetCursor(*wxHOURGLASS_CURSOR); + wxYield(); m_tmpCanDraw = FALSE; if (m_HistoryOn && (m_HistoryPos != -1)) { // store scroll position into history item @@ -158,6 +162,8 @@ bool wxHtmlWindow::LoadPage(const wxString& location) m_tmpCanDraw = TRUE; Refresh(); wxMessageBox(err, "Error"); + + SetCursor(*wxSTANDARD_CURSOR); return FALSE; } @@ -209,6 +215,8 @@ bool wxHtmlWindow::LoadPage(const wxString& location) m_History.Add(new HtmlHistoryItem(m_OpenedPage, m_OpenedAnchor)); } + SetCursor(*wxSTANDARD_CURSOR); + m_tmpCanDraw = TRUE; Refresh(); return rt_val; @@ -231,13 +239,14 @@ bool wxHtmlWindow::ScrollToAnchor(const wxString& anchor) } -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; } @@ -284,6 +293,9 @@ void wxHtmlWindow::ReadCustomization(wxConfigBase *cfg, wxString path) { wxString oldpath; wxString tmp; + int p_fontsizes[7]; + wxString p_fff, p_ffn; + int p_imf, p_imn; if (path != wxEmptyString) { oldpath = cfg -> GetPath(); @@ -291,14 +303,15 @@ void wxHtmlWindow::ReadCustomization(wxConfigBase *cfg, wxString path) } 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);