]> git.saurik.com Git - wxWidgets.git/blame - src/html/m_dflist.cpp
WinCE adaptations
[wxWidgets.git] / src / html / m_dflist.cpp
CommitLineData
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
65571936 7// Licence: wxWindows licence
336e2d44
VS
8/////////////////////////////////////////////////////////////////////////////
9
14f355c2 10#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
336e2d44
VS
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 19
2b5f62a0 20#ifdef __BORLANDC__
336e2d44
VS
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
32FORCE_LINK_ME(m_dflist)
33
34
35
36
2b5f62a0 37TAG_HANDLER_BEGIN(DEFLIST, "DL,DT,DD" )
336e2d44 38
fc7a2a60
VZ
39 TAG_HANDLER_CONSTR(DEFLIST) { }
40
336e2d44
VS
41 TAG_HANDLER_PROC(tag)
42 {
43 wxHtmlContainerCell *c;
44
45
04dbb646
VZ
46 if (tag.GetName() == wxT("DL"))
47 {
e3774124 48 if (m_WParser->GetContainer()->GetFirstChild() != NULL)
04dbb646 49 {
4f9297b0
VS
50 m_WParser->CloseContainer();
51 m_WParser->OpenContainer();
336e2d44 52 }
4f9297b0 53 m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
336e2d44
VS
54
55 ParseInner(tag);
56
e3774124 57 if (m_WParser->GetContainer()->GetFirstChild() != NULL)
04dbb646 58 {
4f9297b0
VS
59 m_WParser->CloseContainer();
60 m_WParser->OpenContainer();
336e2d44 61 }
4f9297b0 62 m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
336e2d44 63
d1da8872 64 return true;
336e2d44 65 }
04dbb646
VZ
66 else if (tag.GetName() == wxT("DT"))
67 {
211dfedd
VS
68 m_WParser->CloseContainer();
69 c = m_WParser->OpenContainer();
70 c->SetAlignHor(wxHTML_ALIGN_LEFT);
71 c->SetMinHeight(m_WParser->GetCharHeight());
d1da8872 72 return false;
336e2d44 73 }
211dfedd 74 else // "DD"
04dbb646 75 {
4f9297b0
VS
76 m_WParser->CloseContainer();
77 c = m_WParser->OpenContainer();
78 c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT);
d1da8872 79 return false;
336e2d44 80 }
336e2d44
VS
81 }
82
83TAG_HANDLER_END(DEFLIST)
84
85
86TAGS_MODULE_BEGIN(DefinitionList)
87
88 TAGS_MODULE_ADD(DEFLIST)
89
90TAGS_MODULE_END(DefinitionList)
91
92#endif