summaryrefslogtreecommitdiff
path: root/src/waypoint_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-24 21:13:36 +0000
committerrubidium <rubidium@openttd.org>2009-11-24 21:13:36 +0000
commit8d6e323ef80fcb49c4fc8417564d1e2ef7797a73 (patch)
treefdd555748c6ddc5afd2181becd1006e6c8375ced /src/waypoint_gui.cpp
parent3f0e1c9091bc13f82bcab6874f35d62f46987de5 (diff)
downloadopenttd-8d6e323ef80fcb49c4fc8417564d1e2ef7797a73.tar.xz
(svn r18280) -Codechange: remove widget indices that are not needed for custom drawing/handling input
Diffstat (limited to 'src/waypoint_gui.cpp')
-rw-r--r--src/waypoint_gui.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp
index e935113b3..11ae59c1d 100644
--- a/src/waypoint_gui.cpp
+++ b/src/waypoint_gui.cpp
@@ -27,8 +27,6 @@
/** Widget definitions for the waypoint window. */
enum WaypointWindowWidgets {
WAYPVW_CAPTION,
- WAYPVW_VIEWPORTPANEL,
- WAYPVW_SPACER,
WAYPVW_VIEWPORT,
WAYPVW_CENTERVIEW,
WAYPVW_RENAME,
@@ -112,6 +110,14 @@ public:
ScrollWindowTo(x, y, -1, this);
}
+ virtual void OnResize()
+ {
+ if (this->viewport != NULL) {
+ NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WAYPVW_VIEWPORT);
+ nvp->UpdateViewportCoordinates(this);
+ }
+ }
+
virtual void OnQueryTextFinished(char *str)
{
if (str == NULL) return;
@@ -127,15 +133,16 @@ static const NWidgetPart _nested_waypoint_view_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY, WAYPVW_CAPTION), SetDataTip(STR_WAYPOINT_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
- NWidget(WWT_PANEL, COLOUR_GREY, WAYPVW_VIEWPORTPANEL),
- NWidget(WWT_INSET, COLOUR_GREY, WAYPVW_SPACER), SetPadding(2, 2, 2, 2),
- NWidget(NWID_VIEWPORT, COLOUR_GREY, WAYPVW_VIEWPORT), SetMinimalSize(256, 88), SetPadding(1, 1, 1, 1),
+ NWidget(WWT_PANEL, COLOUR_GREY),
+ NWidget(WWT_INSET, COLOUR_GREY), SetPadding(2, 2, 2, 2),
+ NWidget(NWID_VIEWPORT, COLOUR_GREY, WAYPVW_VIEWPORT), SetMinimalSize(256, 88), SetPadding(1, 1, 1, 1), SetResize(1, 1),
EndContainer(),
EndContainer(),
NWidget(NWID_HORIZONTAL),
- NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WAYPVW_CENTERVIEW), SetMinimalSize(100, 12), SetFill(1, 0), SetDataTip(STR_BUTTON_LOCATION, STR_BUOY_VIEW_CENTER_TOOLTIP),
- NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WAYPVW_RENAME), SetMinimalSize(100, 12), SetFill(1, 0), SetDataTip(STR_BUTTON_RENAME, STR_BUOY_VIEW_CHANGE_BUOY_NAME),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WAYPVW_CENTERVIEW), SetMinimalSize(100, 12), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_BUTTON_LOCATION, STR_BUOY_VIEW_CENTER_TOOLTIP),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WAYPVW_RENAME), SetMinimalSize(100, 12), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_BUTTON_RENAME, STR_BUOY_VIEW_CHANGE_BUOY_NAME),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WAYPVW_SHOW_VEHICLES), SetMinimalSize(15, 12), SetDataTip(STR_SHIP, STR_STATION_VIEW_SCHEDULED_SHIPS_TOOLTIP),
+ NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(),
};