1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/html/m_span.cpp
3 // Purpose: wxHtml module for span handling
6 // Copyright: wxWidgets team
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #include "wx/wxprec.h"
18 #include "wx/html/forcelnk.h"
19 #include "wx/html/m_templ.h"
20 #include "wx/fontenum.h"
21 #include "wx/tokenzr.h"
22 #include "wx/html/styleparams.h"
27 TAG_HANDLER_BEGIN(SPAN
, "SPAN" )
30 wxArrayString m_Faces
;
32 TAG_HANDLER_CONSTR(SPAN
) { }
36 wxColour oldclr
= m_WParser
->GetActualColor();
37 wxColour oldbackclr
= m_WParser
->GetActualBackgroundColor();
38 int oldbackmode
= m_WParser
->GetActualBackgroundMode();
39 int oldsize
= m_WParser
->GetFontSize();
40 int oldbold
= m_WParser
->GetFontBold();
41 int olditalic
= m_WParser
->GetFontItalic();
42 int oldunderlined
= m_WParser
->GetFontUnderlined();
43 wxString oldfontface
= m_WParser
->GetFontFace();
45 // Load any style parameters
46 wxHtmlStyleParams
styleParams(tag
);
48 ApplyStyle(styleParams
);
52 m_WParser
->SetFontSize(oldsize
);
53 m_WParser
->SetFontBold(oldbold
);
54 m_WParser
->SetFontUnderlined(oldunderlined
);
55 m_WParser
->SetFontFace(oldfontface
);
56 m_WParser
->SetFontItalic(olditalic
);
57 m_WParser
->GetContainer()->InsertCell(
58 new wxHtmlFontCell(m_WParser
->CreateCurrentFont()));
60 if (oldclr
!= m_WParser
->GetActualColor())
62 m_WParser
->SetActualColor(oldclr
);
63 m_WParser
->GetContainer()->InsertCell(
64 new wxHtmlColourCell(oldclr
));
67 if (oldbackmode
!= m_WParser
->GetActualBackgroundMode() ||
68 oldbackclr
!= m_WParser
->GetActualBackgroundColor())
70 m_WParser
->SetActualBackgroundMode(oldbackmode
);
71 m_WParser
->SetActualBackgroundColor(oldbackclr
);
72 m_WParser
->GetContainer()->InsertCell(
73 new wxHtmlColourCell(oldbackclr
, oldbackmode
== wxTRANSPARENT
? wxHTML_CLR_TRANSPARENT_BACKGROUND
: wxHTML_CLR_BACKGROUND
));
82 TAGS_MODULE_BEGIN(Spans
)
86 TAGS_MODULE_END(Spans
)