]>
Commit | Line | Data |
---|---|---|
336e2d44 | 1 | ///////////////////////////////////////////////////////////////////////////// |
93763ad5 | 2 | // Name: src/html/m_dflist.cpp |
336e2d44 VS |
3 | // Purpose: wxHtml module for definition lists (DL,DT,DD) |
4 | // Author: Vaclav Slavik | |
5 | // RCS-ID: $Id$ | |
6 | // Copyright: (c) 1999 Vaclav Slavik | |
65571936 | 7 | // Licence: wxWindows licence |
336e2d44 VS |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
336e2d44 VS |
10 | #include "wx/wxprec.h" |
11 | ||
2b5f62a0 | 12 | #ifdef __BORLANDC__ |
93763ad5 | 13 | #pragma hdrstop |
336e2d44 VS |
14 | #endif |
15 | ||
93763ad5 WS |
16 | #if wxUSE_HTML && wxUSE_STREAMS |
17 | ||
b4f4d3dd | 18 | #ifndef WX_PRECOMP |
336e2d44 VS |
19 | #endif |
20 | ||
336e2d44 VS |
21 | #include "wx/html/forcelnk.h" |
22 | #include "wx/html/m_templ.h" | |
23 | ||
24 | #include "wx/html/htmlcell.h" | |
25 | ||
26 | FORCE_LINK_ME(m_dflist) | |
27 | ||
28 | ||
29 | ||
30 | ||
2b5f62a0 | 31 | TAG_HANDLER_BEGIN(DEFLIST, "DL,DT,DD" ) |
336e2d44 | 32 | |
fc7a2a60 VZ |
33 | TAG_HANDLER_CONSTR(DEFLIST) { } |
34 | ||
336e2d44 VS |
35 | TAG_HANDLER_PROC(tag) |
36 | { | |
37 | wxHtmlContainerCell *c; | |
38 | ||
39 | ||
04dbb646 VZ |
40 | if (tag.GetName() == wxT("DL")) |
41 | { | |
e3774124 | 42 | if (m_WParser->GetContainer()->GetFirstChild() != NULL) |
04dbb646 | 43 | { |
4f9297b0 VS |
44 | m_WParser->CloseContainer(); |
45 | m_WParser->OpenContainer(); | |
336e2d44 | 46 | } |
4f9297b0 | 47 | m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP); |
336e2d44 VS |
48 | |
49 | ParseInner(tag); | |
50 | ||
e3774124 | 51 | if (m_WParser->GetContainer()->GetFirstChild() != NULL) |
04dbb646 | 52 | { |
4f9297b0 VS |
53 | m_WParser->CloseContainer(); |
54 | m_WParser->OpenContainer(); | |
336e2d44 | 55 | } |
4f9297b0 | 56 | m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP); |
336e2d44 | 57 | |
d1da8872 | 58 | return true; |
336e2d44 | 59 | } |
04dbb646 VZ |
60 | else if (tag.GetName() == wxT("DT")) |
61 | { | |
211dfedd VS |
62 | m_WParser->CloseContainer(); |
63 | c = m_WParser->OpenContainer(); | |
64 | c->SetAlignHor(wxHTML_ALIGN_LEFT); | |
65 | c->SetMinHeight(m_WParser->GetCharHeight()); | |
d1da8872 | 66 | return false; |
336e2d44 | 67 | } |
211dfedd | 68 | else // "DD" |
04dbb646 | 69 | { |
4f9297b0 VS |
70 | m_WParser->CloseContainer(); |
71 | c = m_WParser->OpenContainer(); | |
72 | c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT); | |
d1da8872 | 73 | return false; |
336e2d44 | 74 | } |
336e2d44 VS |
75 | } |
76 | ||
77 | TAG_HANDLER_END(DEFLIST) | |
78 | ||
79 | ||
80 | TAGS_MODULE_BEGIN(DefinitionList) | |
81 | ||
82 | TAGS_MODULE_ADD(DEFLIST) | |
83 | ||
84 | TAGS_MODULE_END(DefinitionList) | |
85 | ||
86 | #endif |