]>
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 /////////////////////////////////////////////////////////////////////////////
10 #pragma implementation
13 #include <wx/wxprec.h>
28 #include <wx/html/forcelink.h>
29 #include <wx/html/mod_templ.h>
31 #include <wx/html/htmlcell.h>
33 FORCE_LINK_ME(mod_hline
)
36 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
40 class wxHtmlLineCell
: public wxHtmlCell
43 wxHtmlLineCell(int size
) : wxHtmlCell() {m_Height
= size
;}
44 void Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
);
45 void Layout(int w
) {m_Width
= w
; if (m_Next
) m_Next
-> Layout(w
);}
49 void wxHtmlLineCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
51 wxBrush
mybrush("BLACK", wxSOLID
);
52 wxPen
mypen("BLACK", 1, wxSOLID
);
55 dc
.DrawRectangle(x
+ m_PosX
, y
+ m_PosY
, m_Width
, m_Height
);
56 wxHtmlCell::Draw(dc
, x
, y
, view_y1
, view_y2
);
62 //-----------------------------------------------------------------------------
64 //-----------------------------------------------------------------------------
67 TAG_HANDLER_BEGIN(HR
, "HR")
71 wxHtmlContainerCell
*c
;
74 m_WParser
-> CloseContainer();
75 c
= m_WParser
-> OpenContainer();
77 c
-> SetIndent(m_WParser
-> GetCharHeight(), HTML_INDENT_VERTICAL
);
78 c
-> SetAlignHor(HTML_ALIGN_CENTER
);
80 c
-> SetWidthFloat(tag
);
81 if (tag
.HasParam("SIZE")) tag
.ScanParam("SIZE", "%i", &sz
);
83 c
-> InsertCell(new wxHtmlLineCell(sz
));
85 m_WParser
-> CloseContainer();
86 m_WParser
-> OpenContainer();
97 TAGS_MODULE_BEGIN(HLine
)
101 TAGS_MODULE_END(HLine
)