From ef01b72f17352bb634f1e2e105b4568b71b4495f Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 20 Dec 1999 12:49:42 +0000 Subject: [PATCH] added , and tags; now use separate handlers for ,, git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/htmltags.tex | 14 +++++- src/html/m_fonts.cpp | 89 ++++++++++++++++++++++++++++++-------- 2 files changed, 84 insertions(+), 19 deletions(-) diff --git a/docs/latex/wx/htmltags.tex b/docs/latex/wx/htmltags.tex index 2a7ad15d23..1fa5033245 100644 --- a/docs/latex/wx/htmltags.tex +++ b/docs/latex/wx/htmltags.tex @@ -49,7 +49,7 @@ We will use these substitutions in tags descriptions: \end{verbatim} -\wxheading{Document layout and structure} +\wxheading{List of supported tags} \begin{verbatim} P ALIGN=[alignment] @@ -82,6 +82,12 @@ B I +EM + +STRONG + +CITE + TT H1 @@ -107,6 +113,12 @@ UL OL +DL + +DT + +DD + TABLE ALIGN=[alignment] WIDTH=[percent] WIDTH=[pixels] diff --git a/src/html/m_fonts.cpp b/src/html/m_fonts.cpp index afc454bc80..aae04a9b50 100644 --- a/src/html/m_fonts.cpp +++ b/src/html/m_fonts.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: mod_fonts.cpp +// Name: m_fonts.cpp // Purpose: wxHtml module for fonts & colors of fonts // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -27,7 +27,7 @@ #include "wx/html/forcelnk.h" #include "wx/html/m_templ.h" -FORCE_LINK_ME(mod_fonts) +FORCE_LINK_ME(m_fonts) TAG_HANDLER_BEGIN(FONT, "FONT") @@ -71,36 +71,86 @@ TAG_HANDLER_BEGIN(FONT, "FONT") TAG_HANDLER_END(FONT) -TAG_HANDLER_BEGIN(FACES, "U,I,B,TT") +TAG_HANDLER_BEGIN(FACES_U, "U") TAG_HANDLER_PROC(tag) { - int fixed = m_WParser -> GetFontFixed(), - italic = m_WParser -> GetFontItalic(), - underlined = m_WParser -> GetFontUnderlined(), - bold = m_WParser -> GetFontBold(); - - if (tag.GetName() == "U") - m_WParser -> SetFontUnderlined(TRUE); - else if (tag.GetName() == "B") - m_WParser -> SetFontBold(TRUE); - else if (tag.GetName() == "I") - m_WParser -> SetFontItalic(TRUE); - else - m_WParser -> SetFontFixed(TRUE); + int underlined = m_WParser -> GetFontUnderlined(); + + m_WParser -> SetFontUnderlined(TRUE); m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont())); ParseInner(tag); m_WParser -> SetFontUnderlined(underlined); + m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont())); + return TRUE; + } + +TAG_HANDLER_END(FACES_U) + + + + +TAG_HANDLER_BEGIN(FACES_B, "B,STRONG") + + TAG_HANDLER_PROC(tag) + { + int bold = m_WParser -> GetFontBold(); + + m_WParser -> SetFontBold(TRUE); + m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont())); + + ParseInner(tag); + m_WParser -> SetFontBold(bold); + m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont())); + return TRUE; + } + +TAG_HANDLER_END(FACES_B) + + + + +TAG_HANDLER_BEGIN(FACES_I, "I,EM,CITE") + + TAG_HANDLER_PROC(tag) + { + int italic = m_WParser -> GetFontItalic(); + + m_WParser -> SetFontItalic(TRUE); + m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont())); + + ParseInner(tag); + m_WParser -> SetFontItalic(italic); + m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont())); + return TRUE; + } + +TAG_HANDLER_END(FACES_I) + + + + +TAG_HANDLER_BEGIN(FACES_TT, "TT") + + TAG_HANDLER_PROC(tag) + { + int fixed = m_WParser -> GetFontFixed(); + + m_WParser -> SetFontFixed(TRUE); + m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont())); + + ParseInner(tag); + m_WParser -> SetFontFixed(fixed); m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont())); return TRUE; } -TAG_HANDLER_END(FACES) +TAG_HANDLER_END(FACES_TT) @@ -183,7 +233,10 @@ TAG_HANDLER_END(Hx) TAGS_MODULE_BEGIN(Fonts) TAGS_MODULE_ADD(FONT) - TAGS_MODULE_ADD(FACES) + TAGS_MODULE_ADD(FACES_U) + TAGS_MODULE_ADD(FACES_I) + TAGS_MODULE_ADD(FACES_B) + TAGS_MODULE_ADD(FACES_TT) TAGS_MODULE_ADD(Hx) TAGS_MODULE_END(Fonts) -- 2.45.2