Merge in from trunk r67662 to r64801
[wxWidgets.git] / src / html / m_dflist.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/html/m_dflist.cpp
3 // Purpose: wxHtml module for definition lists (DL,DT,DD)
4 // Author: Vaclav Slavik
5 // RCS-ID: $Id$
6 // Copyright: (c) 1999 Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #include "wx/wxprec.h"
11
12 #ifdef __BORLANDC__
13 #pragma hdrstop
14 #endif
15
16 #if wxUSE_HTML && wxUSE_STREAMS
17
18 #ifndef WX_PRECOMP
19 #endif
20
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
31 TAG_HANDLER_BEGIN(DEFLIST, "DL,DT,DD" )
32
33 TAG_HANDLER_CONSTR(DEFLIST) { }
34
35 TAG_HANDLER_PROC(tag)
36 {
37 wxHtmlContainerCell *c;
38
39
40 if (tag.GetName() == wxT("DL"))
41 {
42 if (m_WParser->GetContainer()->GetFirstChild() != NULL)
43 {
44 m_WParser->CloseContainer();
45 m_WParser->OpenContainer();
46 }
47 m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
48
49 ParseInner(tag);
50
51 if (m_WParser->GetContainer()->GetFirstChild() != NULL)
52 {
53 m_WParser->CloseContainer();
54 m_WParser->OpenContainer();
55 }
56 m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
57
58 return true;
59 }
60 else if (tag.GetName() == wxT("DT"))
61 {
62 m_WParser->CloseContainer();
63 c = m_WParser->OpenContainer();
64 c->SetAlignHor(wxHTML_ALIGN_LEFT);
65 c->SetMinHeight(m_WParser->GetCharHeight());
66 return false;
67 }
68 else // "DD"
69 {
70 m_WParser->CloseContainer();
71 c = m_WParser->OpenContainer();
72 c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT);
73 return false;
74 }
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