changeset 13484:4f31ac40685b draft

(svn r18003) -Cleanup: prune some unused functions from Window
author rubidium <rubidium@openttd.org>
date Sat, 07 Nov 2009 22:29:17 +0000
parents 783021d70eb7
children 397af0578ef8
files src/window.cpp src/window_gui.h
diffstat 2 files changed, 0 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1078,26 +1078,6 @@
 }
 
 /**
- * Open a new window. If there is no space for a new window, close an open
- * window. Try to avoid stickied windows, but if there is no else, close one of
- * those as well. Then make sure all created windows are below some always-on-top
- * ones. Finally set all variables and call the WE_CREATE event
- * @param x offset in pixels from the left of the screen
- * @param y offset in pixels from the top of the screen
- * @param width width in pixels of the window
- * @param height height in pixels of the window
- * @param cls see WindowClass class of the window, used for identification and grouping
- * @param *widget see Widget pointer to the window layout and various elements
- * @return Window pointer of the newly created window
- */
-Window::Window(int x, int y, int width, int height, WindowClass cls, const Widget *widget)
-{
-	assert(widget != NULL); // Constructor is used only for old-style widget array windows, they must always provide an old-style widget array.
-	this->InitializeData(cls, widget, 0);
-	this->InitializePositionSize(x, y, width, height);
-}
-
-/**
  * Decide whether a given rectangle is a good place to open a completely visible new window.
  * The new window should be within screen borders, and not overlap with another already
  * existing window (except for the main window in the background).
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -347,7 +347,6 @@
 	void FindWindowPlacementAndResize(const WindowDesc *desc);
 
 public:
-	Window(int x, int y, int width, int height, WindowClass cls, const Widget *widget);
 	Window(const WindowDesc *desc, WindowNumber number = 0);
 	Window();
 
@@ -581,31 +580,6 @@
 		return HasBit(this->widget[widget_index].display_flags, WIDG_LOWERED);
 	}
 
-	/**
-	 * Align widgets a and b next to each other.
-	 * @param widget_index_a  the left widget
-	 * @param widget_index_b  the right widget (fixed)
-	 */
-	inline void AlignWidgetRight(byte widget_index_a, byte widget_index_b)
-	{
-		assert(widget_index_a < this->widget_count);
-		assert(widget_index_b < this->widget_count);
-		int w = this->widget[widget_index_a].right - this->widget[widget_index_a].left;
-		this->widget[widget_index_a].right = this->widget[widget_index_b].left - 1;
-		this->widget[widget_index_a].left  = this->widget[widget_index_a].right - w;
-	}
-
-	/**
-	 * Get the width of a widget.
-	 * @param widget_index  the widget
-	 * @return width of the widget
-	 */
-	inline int GetWidgetWidth(byte widget_index) const
-	{
-		assert(widget_index < this->widget_count);
-		return this->widget[widget_index].right - this->widget[widget_index].left + 1;
-	}
-
 	bool SetFocusedWidget(byte widget_index);
 
 	void HandleButtonClick(byte widget);