added <EM>, <CITE> and <STRONG> tags; now use separate handlers for <B>,<I>,<TT>
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -49,7 +49,7 @@ We will use these substitutions in tags descriptions:
|
|||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
||||||
|
|
||||||
\wxheading{Document layout and structure}
|
\wxheading{List of supported tags}
|
||||||
|
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
P ALIGN=[alignment]
|
P ALIGN=[alignment]
|
||||||
@@ -82,6 +82,12 @@ B
|
|||||||
|
|
||||||
I
|
I
|
||||||
|
|
||||||
|
EM
|
||||||
|
|
||||||
|
STRONG
|
||||||
|
|
||||||
|
CITE
|
||||||
|
|
||||||
TT
|
TT
|
||||||
|
|
||||||
H1
|
H1
|
||||||
@@ -107,6 +113,12 @@ UL
|
|||||||
|
|
||||||
OL
|
OL
|
||||||
|
|
||||||
|
DL
|
||||||
|
|
||||||
|
DT
|
||||||
|
|
||||||
|
DD
|
||||||
|
|
||||||
TABLE ALIGN=[alignment]
|
TABLE ALIGN=[alignment]
|
||||||
WIDTH=[percent]
|
WIDTH=[percent]
|
||||||
WIDTH=[pixels]
|
WIDTH=[pixels]
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: mod_fonts.cpp
|
// Name: m_fonts.cpp
|
||||||
// Purpose: wxHtml module for fonts & colors of fonts
|
// Purpose: wxHtml module for fonts & colors of fonts
|
||||||
// Author: Vaclav Slavik
|
// Author: Vaclav Slavik
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
#include "wx/html/forcelnk.h"
|
#include "wx/html/forcelnk.h"
|
||||||
#include "wx/html/m_templ.h"
|
#include "wx/html/m_templ.h"
|
||||||
|
|
||||||
FORCE_LINK_ME(mod_fonts)
|
FORCE_LINK_ME(m_fonts)
|
||||||
|
|
||||||
|
|
||||||
TAG_HANDLER_BEGIN(FONT, "FONT")
|
TAG_HANDLER_BEGIN(FONT, "FONT")
|
||||||
@@ -71,36 +71,86 @@ TAG_HANDLER_BEGIN(FONT, "FONT")
|
|||||||
TAG_HANDLER_END(FONT)
|
TAG_HANDLER_END(FONT)
|
||||||
|
|
||||||
|
|
||||||
TAG_HANDLER_BEGIN(FACES, "U,I,B,TT")
|
TAG_HANDLER_BEGIN(FACES_U, "U")
|
||||||
|
|
||||||
TAG_HANDLER_PROC(tag)
|
TAG_HANDLER_PROC(tag)
|
||||||
{
|
{
|
||||||
int fixed = m_WParser -> GetFontFixed(),
|
int underlined = m_WParser -> GetFontUnderlined();
|
||||||
italic = m_WParser -> GetFontItalic(),
|
|
||||||
underlined = m_WParser -> GetFontUnderlined(),
|
|
||||||
bold = m_WParser -> GetFontBold();
|
|
||||||
|
|
||||||
if (tag.GetName() == "U")
|
m_WParser -> SetFontUnderlined(TRUE);
|
||||||
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);
|
|
||||||
m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont()));
|
m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont()));
|
||||||
|
|
||||||
ParseInner(tag);
|
ParseInner(tag);
|
||||||
|
|
||||||
m_WParser -> SetFontUnderlined(underlined);
|
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 -> 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 -> 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 -> SetFontFixed(fixed);
|
||||||
m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont()));
|
m_WParser -> GetContainer() -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont()));
|
||||||
return TRUE;
|
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_BEGIN(Fonts)
|
||||||
|
|
||||||
TAGS_MODULE_ADD(FONT)
|
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_ADD(Hx)
|
||||||
|
|
||||||
TAGS_MODULE_END(Fonts)
|
TAGS_MODULE_END(Fonts)
|
||||||
|
Reference in New Issue
Block a user