]>
git.saurik.com Git - wxWidgets.git/blob - src/html/mod_hline.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxHtml module for horizontal line (HR tag)
4 // Author: Vaclav Slavik
5 // Copyright: (c) 1999 Vaclav Slavik
6 // Licence: wxWindows Licence
7 /////////////////////////////////////////////////////////////////////////////
13 #include <wx/html/forcelink.h>
14 #include <wx/html/mod_templ.h>
16 #include <wx/html/htmlcell.h>
18 FORCE_LINK_ME(mod_hline
)
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 class wxHtmlLineCell
: public wxHtmlCell
28 wxHtmlLineCell(int size
) : wxHtmlCell() {m_Height
= size
;}
29 void Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
);
30 void Layout(int w
) {m_Width
= w
; if (m_Next
) m_Next
-> Layout(w
);}
34 void wxHtmlLineCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
36 wxBrush
mybrush("BLACK", wxSOLID
);
37 wxPen
mypen("BLACK", 1, wxSOLID
);
40 dc
.DrawRectangle(x
+ m_PosX
, y
+ m_PosY
, m_Width
, m_Height
);
41 wxHtmlCell::Draw(dc
, x
, y
, view_y1
, view_y2
);
47 //-----------------------------------------------------------------------------
49 //-----------------------------------------------------------------------------
52 TAG_HANDLER_BEGIN(HR
, "HR")
56 wxHtmlContainerCell
*c
;
59 m_WParser
-> CloseContainer();
60 c
= m_WParser
-> OpenContainer();
62 c
-> SetIndent(m_WParser
-> GetCharHeight(), HTML_INDENT_VERTICAL
);
63 c
-> SetAlignHor(HTML_ALIGN_CENTER
);
65 c
-> SetWidthFloat(tag
);
66 if (tag
.HasParam("SIZE")) tag
.ScanParam("SIZE", "%i", &sz
);
68 c
-> InsertCell(new wxHtmlLineCell(sz
));
70 m_WParser
-> CloseContainer();
71 m_WParser
-> OpenContainer();
82 TAGS_MODULE_BEGIN(HLine
)
86 TAGS_MODULE_END(HLine
)