Changeset - r10120:b4e83b1335af
[Not reviewed]
master
0 1 0
smatz - 16 years ago 2008-09-12 22:52:48
smatz@openttd.org
(svn r14304) -Fix (r14104): waypoint train list wasn't closed with the waypoint window (crashes since r14296)
1 file changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/waypoint_gui.cpp
Show inline comments
 
@@ -6,24 +6,25 @@
 
#include "openttd.h"
 
#include "window_gui.h"
 
#include "gui.h"
 
#include "textbuf_gui.h"
 
#include "vehicle_gui.h"
 
#include "waypoint.h"
 
#include "viewport_func.h"
 
#include "string_func.h"
 
#include "strings_func.h"
 
#include "gfx_func.h"
 
#include "command_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
#include "table/strings.h"
 

	
 
struct WaypointWindow : Window {
 
private:
 
	Waypoint *wp;
 

	
 
	enum WaypointViewWidget {
 
		WAYPVW_CLOSEBOX = 0,
 
		WAYPVW_CAPTION,
 
		WAYPVW_STICKY,
 
		WAYPVW_VIEWPORTPANEL,
 
@@ -36,24 +37,29 @@ private:
 
public:
 
	WaypointWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
 
	{
 
		this->wp = GetWaypoint(this->window_number);
 
		this->caption_color = this->wp->owner;
 

	
 
		this->flags4 |= WF_DISABLE_VP_SCROLL;
 
		InitializeWindowViewport(this, 3, 17, 254, 86, this->wp->xy, ZOOM_LVL_MIN);
 

	
 
		this->FindWindowPlacementAndResize(desc);
 
	}
 

	
 
	~WaypointWindow()
 
	{
 
		DeleteWindowById(WC_TRAINS_LIST, (this->window_number << 16) | (VEH_TRAIN << 11) | VLW_WAYPOINT_LIST | this->wp->owner);
 
	}
 

	
 
	virtual void OnPaint()
 
	{
 
		/* You can only change your own waypoints */
 
		this->SetWidgetDisabledState(WAYPVW_RENAME, !CheckOwnership(this->wp->owner));
 
		SetDParam(0, this->wp->index);
 
		this->DrawWidgets();
 

	
 
		this->DrawViewport();
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	{
0 comments (0 inline, 0 general)