1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/html/m_span.cpp
3 // Purpose: wxHtml module for span handling
5 // Copyright: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
17 #include "wx/html/forcelnk.h"
18 #include "wx/html/m_templ.h"
19 #include "wx/fontenum.h"
20 #include "wx/tokenzr.h"
21 #include "wx/html/styleparams.h"
26 TAG_HANDLER_BEGIN(SPAN
, "SPAN" )
29 wxArrayString m_Faces
;
31 TAG_HANDLER_CONSTR(SPAN
) { }
35 wxColour oldclr
= m_WParser
->GetActualColor();
36 wxColour oldbackclr
= m_WParser
->GetActualBackgroundColor();
37 int oldbackmode
= m_WParser
->GetActualBackgroundMode();
38 int oldsize
= m_WParser
->GetFontSize();
39 int oldbold
= m_WParser
->GetFontBold();
40 int olditalic
= m_WParser
->GetFontItalic();
41 int oldunderlined
= m_WParser
->GetFontUnderlined();
42 wxString oldfontface
= m_WParser
->GetFontFace();
44 // Load any style parameters
45 wxHtmlStyleParams
styleParams(tag
);
47 ApplyStyle(styleParams
);
51 m_WParser
->SetFontSize(oldsize
);
52 m_WParser
->SetFontBold(oldbold
);
53 m_WParser
->SetFontUnderlined(oldunderlined
);
54 m_WParser
->SetFontFace(oldfontface
);
55 m_WParser
->SetFontItalic(olditalic
);
56 m_WParser
->GetContainer()->InsertCell(
57 new wxHtmlFontCell(m_WParser
->CreateCurrentFont()));
59 if (oldclr
!= m_WParser
->GetActualColor())
61 m_WParser
->SetActualColor(oldclr
);
62 m_WParser
->GetContainer()->InsertCell(
63 new wxHtmlColourCell(oldclr
));
66 if (oldbackmode
!= m_WParser
->GetActualBackgroundMode() ||
67 oldbackclr
!= m_WParser
->GetActualBackgroundColor())
69 m_WParser
->SetActualBackgroundMode(oldbackmode
);
70 m_WParser
->SetActualBackgroundColor(oldbackclr
);
71 m_WParser
->GetContainer()->InsertCell(
72 new wxHtmlColourCell(oldbackclr
, oldbackmode
== wxTRANSPARENT
? wxHTML_CLR_TRANSPARENT_BACKGROUND
: wxHTML_CLR_BACKGROUND
));
81 TAGS_MODULE_BEGIN(Spans
)
85 TAGS_MODULE_END(Spans
)