summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2011-01-15 14:17:53 +0000
committeralberth <alberth@openttd.org>2011-01-15 14:17:53 +0000
commit7be31ee03e59ad547ceef362284677d232a642aa (patch)
tree6319a4e299c3a9341465ab5a32530185b9b40001
parent0c497dd113eb8f72cd87a6b48d7c0893542a10ac (diff)
downloadopenttd-7be31ee03e59ad547ceef362284677d232a642aa.tar.xz
(svn r21801) -Fix (r21772): Attach scrollbar to select matrix in object gui.
-rw-r--r--src/object_gui.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/object_gui.cpp b/src/object_gui.cpp
index 0e6020677..60e4bb080 100644
--- a/src/object_gui.cpp
+++ b/src/object_gui.cpp
@@ -64,7 +64,9 @@ public:
this->SelectFirstAvailableObject(true);
this->GetWidget<NWidgetMatrix>(BOW_OBJECT_MATRIX)->SetCount(4);
- this->GetWidget<NWidgetMatrix>(BOW_SELECT_MATRIX)->SetCount(ObjectClass::GetCount(_selected_object_class));
+ NWidgetMatrix *matrix = this->GetWidget<NWidgetMatrix>(BOW_SELECT_MATRIX);
+ matrix->SetScrollbar(this->GetScrollbar(BOW_SELECT_SCROLL));
+ matrix->SetCount(ObjectClass::GetCount(_selected_object_class));
}
virtual ~BuildObjectWindow()
@@ -379,7 +381,7 @@ static const NWidgetPart _nested_build_object_widgets[] = {
EndContainer(),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetScrollbar(BOW_SELECT_SCROLL),
NWidget(NWID_HORIZONTAL),
- NWidget(NWID_MATRIX, COLOUR_DARK_GREEN, BOW_SELECT_MATRIX), SetFill(0, 1), SetPIP(0, 2, 0), SetScrollbar(BOW_SELECT_SCROLL),
+ NWidget(NWID_MATRIX, COLOUR_DARK_GREEN, BOW_SELECT_MATRIX), SetFill(0, 1), SetPIP(0, 2, 0),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, BOW_SELECT_IMAGE), SetMinimalSize(66, 60), SetDataTip(0x0, STR_OBJECT_BUILD_TOOLTIP),
SetFill(0, 0), SetResize(0, 0), SetScrollbar(BOW_SELECT_SCROLL),
EndContainer(),