]> git.saurik.com Git - wxWidgets.git/commitdiff
added <EM>, <CITE> and <STRONG> tags; now use separate handlers for <B>,<I>,<TT>
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 20 Dec 1999 12:49:42 +0000 (12:49 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 20 Dec 1999 12:49:42 +0000 (12:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/htmltags.tex
src/html/m_fonts.cpp

index 2a7ad15d230fbb2fdfb07ceb11905ca6a769219a..1fa5033245683d8c6c0cfba7bdbb643f9cfc4acd 100644 (file)
@@ -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]
index afc454bc80fc6b7783eb4d9edca788b393360f32..aae04a9b501c6ea38d1df5cc59ab3c5c2ec1a5f2 100644 (file)
@@ -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)