From f2c2fa4d62b34608e21b04f8010149945aebda70 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 23 Dec 1999 21:11:46 +0000 Subject: [PATCH 1/1] wxHtmlWindow::OnLinkClicked and wxHtmlCell::Get/SetLink and wxHtmlWinParser::GetSetLink now work with wxHtmlLinkInfo instead of wxString (making it ready for frames) ************** also fixed font size interpretation to conform to HTML (1..6 instead of wrong -2..4) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5091 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/winpars.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index 73d81a70db..3de90241e0 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -107,14 +107,15 @@ void wxHtmlWinParser::InitParser(const wxString& source) wxASSERT_MSG(m_DC != NULL, _("no DC assigned to wxHtmlWinParser!!")); m_FontBold = m_FontItalic = m_FontUnderlined = m_FontFixed = FALSE; - m_FontSize = 0; + m_FontSize = 3; //default one CreateCurrentFont(); // we're selecting default font into m_DC -> GetTextExtent("H", &m_CharWidth, &m_CharHeight); /* NOTE : we're not using GetCharWidth/Height() because of differences under X and win */ - m_Link = ""; + m_UseLink = FALSE; + m_Link = wxHtmlLinkInfo("", ""); m_LinkColor.Set(0, 0, 0xFF); m_ActualColor.Set(0, 0, 0); m_Align = wxHTML_ALIGN_LEFT; @@ -242,13 +243,22 @@ wxHtmlContainerCell* wxHtmlWinParser::CloseContainer() } +void wxHtmlWinParser::SetFontSize(int s) +{ + if (s < 1) s = 1; + else if (s > 7) s = 7; + m_FontSize = s; +} + + + wxFont* wxHtmlWinParser::CreateCurrentFont() { int fb = GetFontBold(), fi = GetFontItalic(), fu = GetFontUnderlined(), ff = GetFontFixed(), - fs = GetFontSize() + 2 /*remap from <-2;4> to <0;7>*/ ; + fs = GetFontSize() - 1 /*remap from <1;7> to <0;6>*/ ; if (m_FontsTable[fb][fi][fu][ff][fs] == NULL) { m_FontsTable[fb][fi][fu][ff][fs] = @@ -265,6 +275,14 @@ wxFont* wxHtmlWinParser::CreateCurrentFont() +void wxHtmlWinParser::SetLink(const wxHtmlLinkInfo& link) +{ + m_Link = link; + m_UseLink = (link.GetHref() != wxEmptyString); +} + + + //----------------------------------------------------------------------------- // wxHtmlWinTagHandler -- 2.45.2