]>
Commit | Line | Data |
---|---|---|
336e2d44 VS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: 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 | #ifdef __GNUG__ | |
11 | #pragma implementation | |
12 | #endif | |
13 | ||
14 | #include "wx/wxprec.h" | |
15 | ||
16 | ||
17 | #include "wx/defs.h" | |
f6bcfd97 | 18 | #if wxUSE_HTML && wxUSE_STREAMS |
336e2d44 VS |
19 | |
20 | #ifdef __BORDLANDC__ | |
21 | #pragma hdrstop | |
22 | #endif | |
23 | ||
24 | #ifndef WXPRECOMP | |
336e2d44 VS |
25 | #endif |
26 | ||
336e2d44 VS |
27 | #include "wx/html/forcelnk.h" |
28 | #include "wx/html/m_templ.h" | |
29 | ||
30 | #include "wx/html/htmlcell.h" | |
31 | ||
32 | FORCE_LINK_ME(m_dflist) | |
33 | ||
34 | ||
35 | ||
36 | ||
37 | TAG_HANDLER_BEGIN(DEFLIST, "DL,DT,DD") | |
38 | ||
39 | TAG_HANDLER_PROC(tag) | |
40 | { | |
41 | wxHtmlContainerCell *c; | |
42 | ||
43 | ||
04dbb646 VZ |
44 | if (tag.GetName() == wxT("DL")) |
45 | { | |
46 | if (m_WParser->GetContainer()->GetFirstCell() != NULL) | |
47 | { | |
4f9297b0 VS |
48 | m_WParser->CloseContainer(); |
49 | m_WParser->OpenContainer(); | |
336e2d44 | 50 | } |
4f9297b0 | 51 | m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP); |
336e2d44 VS |
52 | |
53 | ParseInner(tag); | |
54 | ||
04dbb646 VZ |
55 | if (m_WParser->GetContainer()->GetFirstCell() != NULL) |
56 | { | |
4f9297b0 VS |
57 | m_WParser->CloseContainer(); |
58 | m_WParser->OpenContainer(); | |
336e2d44 | 59 | } |
4f9297b0 | 60 | m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP); |
336e2d44 VS |
61 | |
62 | return TRUE; | |
63 | } | |
04dbb646 VZ |
64 | else if (tag.GetName() == wxT("DT")) |
65 | { | |
66 | if (!tag.IsEnding()) | |
67 | { | |
4f9297b0 VS |
68 | m_WParser->CloseContainer(); |
69 | c = m_WParser->OpenContainer(); | |
70 | c->SetAlignHor(wxHTML_ALIGN_LEFT); | |
71 | c->SetMinHeight(m_WParser->GetCharHeight()); | |
336e2d44 VS |
72 | } |
73 | return FALSE; | |
74 | } | |
4f9297b0 | 75 | else if (!tag.IsEnding()) // "DD" |
04dbb646 | 76 | { |
4f9297b0 VS |
77 | m_WParser->CloseContainer(); |
78 | c = m_WParser->OpenContainer(); | |
79 | c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT); | |
336e2d44 VS |
80 | return FALSE; |
81 | } | |
04dbb646 | 82 | |
336e2d44 VS |
83 | else return FALSE; |
84 | } | |
85 | ||
86 | TAG_HANDLER_END(DEFLIST) | |
87 | ||
88 | ||
89 | TAGS_MODULE_BEGIN(DefinitionList) | |
90 | ||
91 | TAGS_MODULE_ADD(DEFLIST) | |
92 | ||
93 | TAGS_MODULE_END(DefinitionList) | |
94 | ||
95 | #endif |