Changeset - r12658:635a14abc5cd
[Not reviewed]
master
0 1 0
alberth - 15 years ago 2009-08-08 20:39:45
alberth@openttd.org
(svn r17123) -Codechange (r17122): Use this for calling methods.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/news_gui.cpp
Show inline comments
 
@@ -786,13 +786,13 @@ struct MessageHistoryWindow : Window {
 
	int date_width;  /// < Width needed for the date part.
 

	
 
	MessageHistoryWindow(const WindowDesc *desc) : Window()
 
	{
 
		this->InitNested(desc); // Initializes 'this->line_height' and 'this->date_width'.
 
		this->vscroll.cap = (this->nested_array[MHW_BACKGROUND]->current_y - this->top_spacing - this->bottom_spacing) / this->line_height;
 
		OnInvalidateData(0);
 
		this->OnInvalidateData(0);
 
	}
 

	
 
	virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize)
 
	{
 
		if (widget == MHW_BACKGROUND) {
 
			this->line_height = FONT_HEIGHT_NORMAL + 2;
 
@@ -805,13 +805,13 @@ struct MessageHistoryWindow : Window {
 
			size->width = max(200u, size->width); // At least 200 pixels wide.
 
		}
 
	}
 

	
 
	virtual void OnPaint()
 
	{
 
		OnInvalidateData(0);
 
		this->OnInvalidateData(0);
 
		this->DrawWidgets();
 
	}
 

	
 
	virtual void DrawWidget(const Rect &r, int widget) const
 
	{
 
		if (widget != MHW_BACKGROUND || _total_news == 0) return;
 
@@ -859,13 +859,13 @@ struct MessageHistoryWindow : Window {
 
		}
 
	}
 

	
 
	virtual void OnResize(Point delta)
 
	{
 
		this->vscroll.cap += delta.y / this->line_height;
 
		OnInvalidateData(0);
 
		this->OnInvalidateData(0);
 
	}
 
};
 

	
 
const int MessageHistoryWindow::top_spacing = WD_FRAMERECT_TOP + 4;
 
const int MessageHistoryWindow::bottom_spacing = WD_FRAMERECT_BOTTOM;
 

	
0 comments (0 inline, 0 general)