[Scummvm-cvs-logs] SF.net SVN: scummvm: [22646] scummvm/trunk/gui
sev at users.sourceforge.net
sev at users.sourceforge.net
Thu May 25 18:51:03 CEST 2006
Revision: 22646
Author: sev
Date: 2006-05-25 18:49:56 -0700 (Thu, 25 May 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=22646&view=rev
Log Message:
-----------
- Put scrollbar inside of list widget
- Use resize() instead of setPos() and setSize() where applicable
Modified Paths:
--------------
scummvm/trunk/engines/scumm/dialogs.cpp
scummvm/trunk/gui/ListWidget.cpp
scummvm/trunk/gui/console.cpp
Modified: scummvm/trunk/engines/scumm/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/scumm/dialogs.cpp 2006-05-26 01:16:21 UTC (rev 22645)
+++ scummvm/trunk/engines/scumm/dialogs.cpp 2006-05-26 01:49:56 UTC (rev 22646)
@@ -748,10 +748,8 @@
int dscH = g_gui.evaluator()->getVar("scummhelp_dsc.h");
for (int i = 0; i < HELP_NUM_LINES; i++) {
- _key[i]->setPos(keyX, keyYoff + lineHeight * (i + 2));
- _key[i]->setSize(keyW, keyH);
- _dsc[i]->setPos(dscX, dscYoff + lineHeight * (i + 2));
- _dsc[i]->setSize(dscW, dscH);
+ _key[i]->resize(keyX, keyYoff + lineHeight * (i + 2), keyW, keyH);
+ _dsc[i]->resize(dscX, dscYoff + lineHeight * (i + 2), dscW, dscH);
}
displayKeyBindings();
Modified: scummvm/trunk/gui/ListWidget.cpp
===================================================================
--- scummvm/trunk/gui/ListWidget.cpp 2006-05-26 01:16:21 UTC (rev 22645)
+++ scummvm/trunk/gui/ListWidget.cpp 2006-05-26 01:49:56 UTC (rev 22646)
@@ -31,7 +31,6 @@
ListWidget::ListWidget(GuiObject *boss, String name)
: EditableWidget(boss, name), CommandSender(boss) {
- int w = g_gui.evaluator()->getVar(_name + ".w");
WidgetSize ws = g_gui.getWidgetSize();
@@ -42,13 +41,14 @@
_hlLeftPadding = g_gui.evaluator()->getVar("ListWidget.hlLeftPadding", 0);
_hlRightPadding = g_gui.evaluator()->getVar("ListWidget.hlRightPadding", 0);
+ int scrollBarWidth;
if (ws == kBigWidgetSize) {
- _w = w - kBigScrollBarWidth;
+ scrollBarWidth = kBigScrollBarWidth;
} else {
- _w = w - kNormalScrollBarWidth;
+ scrollBarWidth = kNormalScrollBarWidth;
}
- _scrollBar = new ScrollBarWidget(boss, _x + _w, _y, (ws == kBigWidgetSize ? kBigScrollBarWidth : kNormalScrollBarWidth), _h);
+ _scrollBar = new ScrollBarWidget(this, _w - scrollBarWidth, 0, scrollBarWidth, _h);
_scrollBar->setTarget(this);
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE;
@@ -451,10 +451,11 @@
_hlLeftPadding = g_gui.evaluator()->getVar("ListWidget.hlLeftPadding", 0);
_hlRightPadding = g_gui.evaluator()->getVar("ListWidget.hlRightPadding", 0);
+ int scrollBarWidth;
if (ws == kBigWidgetSize) {
- _w = w - kBigScrollBarWidth;
+ scrollBarWidth = kBigScrollBarWidth;
} else {
- _w = w - kNormalScrollBarWidth;
+ scrollBarWidth = kNormalScrollBarWidth;
}
_entriesPerPage = (_h - _topPadding - _bottomPadding) / kLineHeight;
@@ -465,7 +466,7 @@
for (int i = 0; i < _entriesPerPage; i++)
_textWidth[i] = 0;
- _scrollBar->resize(_x + _w, _y, (ws == kBigWidgetSize ? kBigScrollBarWidth : kNormalScrollBarWidth), _h);
+ _scrollBar->resize(_w - scrollBarWidth, 0, scrollBarWidth, _h);
scrollBarRecalc();
}
Modified: scummvm/trunk/gui/console.cpp
===================================================================
--- scummvm/trunk/gui/console.cpp 2006-05-26 01:16:21 UTC (rev 22645)
+++ scummvm/trunk/gui/console.cpp 2006-05-26 01:49:56 UTC (rev 22646)
@@ -112,8 +112,7 @@
scrollBarWidth = kBigScrollBarWidth;
else
scrollBarWidth = kNormalScrollBarWidth;
- _scrollBar->setPos(_w - scrollBarWidth - 1, 0);
- _scrollBar->setSize(scrollBarWidth, _h);
+ _scrollBar->resize(_w - scrollBarWidth - 1, 0, scrollBarWidth, _h);
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list