]> git.saurik.com Git - wxWidgets.git/blob - src/html/m_dflist.cpp
The alignment controls are now left-aligned if the floating controls are not shown.
[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 // Copyright: (c) 1999 Vaclav Slavik
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8
9 #include "wx/wxprec.h"
10
11 #ifdef __BORLANDC__
12 #pragma hdrstop
13 #endif
14
15 #if wxUSE_HTML && wxUSE_STREAMS
16
17 #ifndef WX_PRECOMP
18 #endif
19
20 #include "wx/html/forcelnk.h"
21 #include "wx/html/m_templ.h"
22
23 #include "wx/html/htmlcell.h"
24
25 FORCE_LINK_ME(m_dflist)
26
27
28
29
30 TAG_HANDLER_BEGIN(DEFLIST, "DL,DT,DD" )
31
32 TAG_HANDLER_CONSTR(DEFLIST) { }
33
34 TAG_HANDLER_PROC(tag)
35 {
36 wxHtmlContainerCell *c;
37
38
39 if (tag.GetName() == wxT("DL"))
40 {
41 if (m_WParser->GetContainer()->GetFirstChild() != NULL)
42 {
43 m_WParser->CloseContainer();
44 m_WParser->OpenContainer();
45 }
46 m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
47
48 ParseInner(tag);
49
50 if (m_WParser->GetContainer()->GetFirstChild() != NULL)
51 {
52 m_WParser->CloseContainer();
53 m_WParser->OpenContainer();
54 }
55 m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
56
57 return true;
58 }
59 else if (tag.GetName() == wxT("DT"))
60 {
61 m_WParser->CloseContainer();
62 c = m_WParser->OpenContainer();
63 c->SetAlignHor(wxHTML_ALIGN_LEFT);
64 c->SetMinHeight(m_WParser->GetCharHeight());
65 return false;
66 }
67 else // "DD"
68 {
69 m_WParser->CloseContainer();
70 c = m_WParser->OpenContainer();
71 c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT);
72 return false;
73 }
74 }
75
76 TAG_HANDLER_END(DEFLIST)
77
78
79 TAGS_MODULE_BEGIN(DefinitionList)
80
81 TAGS_MODULE_ADD(DEFLIST)
82
83 TAGS_MODULE_END(DefinitionList)
84
85 #endif