Dillo v3.1.1-98-g318d1f14
Loading...
Searching...
No Matches
listitem.cc
Go to the documentation of this file.
1/*
2 * Dillo Widget
3 *
4 * Copyright 2005-2007 Sebastian Geerken <sgeerken@dillo.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20
21
22#include "listitem.hh"
23#include "../lout/debug.hh"
24#include <stdio.h>
25
26namespace dw {
27
28int ListItem::CLASS_ID = -1;
29
30ListItem::ListItem (ListItem *ref, bool limitTextWidth):
31 AlignedTextblock (limitTextWidth)
32{
33 DBG_OBJ_CREATE ("dw::ListItem");
34 registerName ("dw::ListItem", &CLASS_ID);
35 setRefTextblock (ref);
36}
37
42
44{
45 return true;
46}
47
57
66
68{
69 if (words->size () == 0)
70 return 0;
71 else
72 return words->getRef(0)->size.width + words->getRef(0)->origSpace;
73}
74
75void ListItem::setMaxValue (int maxValue, int value)
76{
77 leftInnerPadding = maxValue;
78 line1Offset = - value;
79 redrawY = 0;
80 queueResize (0, true);
81}
82
83} // namespace dw
Base widget for all textblocks (sub classes of dw::Textblock), which are positioned vertically and al...
void setRefTextblock(AlignedTextblock *ref)
bool usesMaxGeneratorWidth()
Definition listitem.cc:43
ListItem(ListItem *ref, bool limitTextWidth)
Definition listitem.cc:30
void initWithText(const char *text, core::style::Style *style)
Definition listitem.cc:58
void initWithWidget(core::Widget *widget, core::style::Style *style)
Definition listitem.cc:48
static int CLASS_ID
Definition listitem.hh:16
int getValue()
Definition listitem.cc:67
void setMaxValue(int maxValue, int value)
Definition listitem.cc:75
void addWidget(core::Widget *widget, core::style::Style *style)
Add a widget (word type) to the page.
void addSpace(core::style::Style *style)
?
lout::misc::NotSoSimpleVector< Word > * words
Definition textblock.hh:611
void addText(const char *text, size_t len, core::style::Style *style)
Add a word to the page structure.
bool hasListitemValue
Definition textblock.hh:531
The base class of all dillo widgets.
Definition widget.hh:44
style::Style * style
Definition widget.hh:150
void queueResize(int ref, bool extremesChanged, bool fast)
This method should be called, when a widget changes its size.
Definition widget.cc:321
ListStylePosition listStylePosition
Definition style.hh:567
void registerName(const char *className, int *classId)
This method must be called in the constructor for the sub class.
Definition identity.cc:83
#define DBG_OBJ_DELETE()
#define DBG_OBJ_CREATE(klass)
@ LIST_STYLE_POSITION_OUTSIDE
Definition style.hh:300
Dw is in this namespace, or sub namespaces of this one.