From 8d6e323ef80fcb49c4fc8417564d1e2ef7797a73 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 24 Nov 2009 21:13:36 +0000 Subject: (svn r18280) -Codechange: remove widget indices that are not needed for custom drawing/handling input --- src/waypoint_gui.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/waypoint_gui.cpp') 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(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(), }; -- cgit v1.2.3-54-g00ecf