]> git.saurik.com Git - wxWidgets.git/blob - src/html/m_dflist.cpp
moved bookmarks to Contents panel
[wxWidgets.git] / src / html / m_dflist.cpp
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"
18 #if wxUSE_HTML
19
20 #ifdef __BORDLANDC__
21 #pragma hdrstop
22 #endif
23
24 #ifndef WXPRECOMP
25 #include "wx/wx.h"
26 #endif
27
28
29 #include "wx/html/forcelnk.h"
30 #include "wx/html/m_templ.h"
31
32 #include "wx/html/htmlcell.h"
33
34 FORCE_LINK_ME(m_dflist)
35
36
37
38
39 TAG_HANDLER_BEGIN(DEFLIST, "DL,DT,DD")
40
41 TAG_HANDLER_PROC(tag)
42 {
43 wxHtmlContainerCell *c;
44
45
46 if (tag.GetName() == wxT("DL")) {
47 if (m_WParser -> GetContainer() -> GetFirstCell() != NULL) {
48 m_WParser -> CloseContainer();
49 m_WParser -> OpenContainer();
50 }
51 m_WParser -> GetContainer() -> SetIndent(m_WParser -> GetCharHeight(), wxHTML_INDENT_TOP);
52
53 ParseInner(tag);
54
55 if (m_WParser -> GetContainer() -> GetFirstCell() != NULL) {
56 m_WParser -> CloseContainer();
57 m_WParser -> OpenContainer();
58 }
59 m_WParser -> GetContainer() -> SetIndent(m_WParser -> GetCharHeight(), wxHTML_INDENT_TOP);
60
61 return TRUE;
62 }
63
64 else if (tag.GetName() == wxT("DT")) {
65 if (!tag.IsEnding()) {
66 m_WParser -> CloseContainer();
67 c = m_WParser -> OpenContainer();
68 c -> SetAlignHor(wxHTML_ALIGN_LEFT);
69 c -> SetMinHeight(m_WParser -> GetCharHeight());
70 }
71 return FALSE;
72 }
73
74 else if (!tag.IsEnding()) { // "DD"
75 m_WParser -> CloseContainer();
76 c = m_WParser -> OpenContainer();
77 c -> SetIndent(5 * m_WParser -> GetCharWidth(), wxHTML_INDENT_LEFT);
78 return FALSE;
79 }
80
81 else return FALSE;
82 }
83
84 TAG_HANDLER_END(DEFLIST)
85
86
87 TAGS_MODULE_BEGIN(DefinitionList)
88
89 TAGS_MODULE_ADD(DEFLIST)
90
91 TAGS_MODULE_END(DefinitionList)
92
93 #endif