diff options
author | Eugene Sandulenko | 2008-01-30 22:51:21 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2008-01-30 22:51:21 +0000 |
commit | 5c6597562a0cc3fdfb621a8955a3b04f544b9ecf (patch) | |
tree | 78bf16c51840f82fecf857d27f108ae7355a2539 | |
parent | d92dbac6726d1beb8a9986021e702f76cd6aff8e (diff) | |
download | scummvm-rg350-5c6597562a0cc3fdfb621a8955a3b04f544b9ecf.tar.gz scummvm-rg350-5c6597562a0cc3fdfb621a8955a3b04f544b9ecf.tar.bz2 scummvm-rg350-5c6597562a0cc3fdfb621a8955a3b04f544b9ecf.zip |
Add ListWidget version with immediate parameters.
svn-id: r30709
-rw-r--r-- | gui/ListWidget.cpp | 30 | ||||
-rw-r--r-- | gui/ListWidget.h | 1 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp index 7781cf78c9..c43a0f64d7 100644 --- a/gui/ListWidget.cpp +++ b/gui/ListWidget.cpp @@ -62,6 +62,36 @@ ListWidget::ListWidget(GuiObject *boss, const String &name) _editable = true; } +ListWidget::ListWidget(GuiObject *boss, int x, int y, int w, int h) + : EditableWidget(boss, x, y, w, h), CommandSender(boss) { + + _scrollBar = NULL; + _textWidth = NULL; + + // This ensures that _entriesPerPage is properly initialised. + reflowLayout(); + + _scrollBar = new ScrollBarWidget(this, _w - _scrollBarWidth + 1, 0, _scrollBarWidth, _h); + _scrollBar->setTarget(this); + + setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE); + setHints(THEME_HINT_SAVE_BACKGROUND | THEME_HINT_USE_SHADOW); + _type = kListWidget; + _editMode = false; + _numberingMode = kListNumberingOne; + _currentPos = 0; + _selectedItem = -1; + _currentKeyDown = 0; + + _quickSelectTime = 0; + + // The item is selected, thus _bgcolor is used to draw the caret and _textcolorhi to erase it + _caretInverse = true; + + // FIXME: This flag should come from widget definition + _editable = true; +} + ListWidget::~ListWidget() { delete[] _textWidth; } diff --git a/gui/ListWidget.h b/gui/ListWidget.h index 7c35d9b9fe..dfc93cb1d1 100644 --- a/gui/ListWidget.h +++ b/gui/ListWidget.h @@ -75,6 +75,7 @@ protected: public: ListWidget(GuiObject *boss, const String &name); + ListWidget(GuiObject *boss, int x, int y, int w, int h); virtual ~ListWidget(); virtual Widget *findWidget(int x, int y); |