]> git.saurik.com Git - wxWidgets.git/blame - src/html/m_dflist.cpp
added wxListBox::HitTest() from Ryan (patch 1446207)
[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
336e2d44
VS
10#include "wx/wxprec.h"
11
336e2d44 12#include "wx/defs.h"
f6bcfd97 13#if wxUSE_HTML && wxUSE_STREAMS
336e2d44 14
2b5f62a0 15#ifdef __BORLANDC__
336e2d44
VS
16#pragma hdrstop
17#endif
18
19#ifndef WXPRECOMP
336e2d44
VS
20#endif
21
336e2d44
VS
22#include "wx/html/forcelnk.h"
23#include "wx/html/m_templ.h"
24
25#include "wx/html/htmlcell.h"
26
27FORCE_LINK_ME(m_dflist)
28
29
30
31
2b5f62a0 32TAG_HANDLER_BEGIN(DEFLIST, "DL,DT,DD" )
336e2d44 33
fc7a2a60
VZ
34 TAG_HANDLER_CONSTR(DEFLIST) { }
35
336e2d44
VS
36 TAG_HANDLER_PROC(tag)
37 {
38 wxHtmlContainerCell *c;
39
40
04dbb646
VZ
41 if (tag.GetName() == wxT("DL"))
42 {
e3774124 43 if (m_WParser->GetContainer()->GetFirstChild() != NULL)
04dbb646 44 {
4f9297b0
VS
45 m_WParser->CloseContainer();
46 m_WParser->OpenContainer();
336e2d44 47 }
4f9297b0 48 m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
336e2d44
VS
49
50 ParseInner(tag);
51
e3774124 52 if (m_WParser->GetContainer()->GetFirstChild() != NULL)
04dbb646 53 {
4f9297b0
VS
54 m_WParser->CloseContainer();
55 m_WParser->OpenContainer();
336e2d44 56 }
4f9297b0 57 m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
336e2d44 58
d1da8872 59 return true;
336e2d44 60 }
04dbb646
VZ
61 else if (tag.GetName() == wxT("DT"))
62 {
211dfedd
VS
63 m_WParser->CloseContainer();
64 c = m_WParser->OpenContainer();
65 c->SetAlignHor(wxHTML_ALIGN_LEFT);
66 c->SetMinHeight(m_WParser->GetCharHeight());
d1da8872 67 return false;
336e2d44 68 }
211dfedd 69 else // "DD"
04dbb646 70 {
4f9297b0
VS
71 m_WParser->CloseContainer();
72 c = m_WParser->OpenContainer();
73 c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT);
d1da8872 74 return false;
336e2d44 75 }
336e2d44
VS
76 }
77
78TAG_HANDLER_END(DEFLIST)
79
80
81TAGS_MODULE_BEGIN(DefinitionList)
82
83 TAGS_MODULE_ADD(DEFLIST)
84
85TAGS_MODULE_END(DefinitionList)
86
87#endif