]> git.saurik.com Git - wxWidgets.git/blame - src/html/m_dflist.cpp
Log error messages work.
[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
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
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
34FORCE_LINK_ME(m_dflist)
35
36
37
38
39TAG_HANDLER_BEGIN(DEFLIST, "DL,DT,DD")
40
41 TAG_HANDLER_PROC(tag)
42 {
43 wxHtmlContainerCell *c;
44
45
4f9297b0
VS
46 if (tag.GetName() == wxT("DL"))
47 {
48 if (m_WParser->GetContainer()->GetFirstCell() != NULL)
49 {
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
4f9297b0
VS
57 if (m_WParser->GetContainer()->GetFirstCell() != NULL)
58 {
59 m_WParser->CloseContainer();
60 m_WParser->OpenContainer();
336e2d44 61 }
4f9297b0 62 m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
336e2d44
VS
63
64 return TRUE;
65 }
66
4f9297b0
VS
67 else if (tag.GetName() == wxT("DT"))
68 {
69 if (!tag.IsEnding())
70 {
71 m_WParser->CloseContainer();
72 c = m_WParser->OpenContainer();
73 c->SetAlignHor(wxHTML_ALIGN_LEFT);
74 c->SetMinHeight(m_WParser->GetCharHeight());
336e2d44
VS
75 }
76 return FALSE;
77 }
78
4f9297b0
VS
79 else if (!tag.IsEnding()) // "DD"
80 {
81 m_WParser->CloseContainer();
82 c = m_WParser->OpenContainer();
83 c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT);
336e2d44
VS
84 return FALSE;
85 }
86
87 else return FALSE;
88 }
89
90TAG_HANDLER_END(DEFLIST)
91
92
93TAGS_MODULE_BEGIN(DefinitionList)
94
95 TAGS_MODULE_ADD(DEFLIST)
96
97TAGS_MODULE_END(DefinitionList)
98
99#endif