File diff r14398:461a80e5f996 → r14399:3f819c0da60a
src/newgrf_gui.cpp
Show inline comments
 
@@ -341,18 +341,13 @@ public:
 
					ShowNewGRFInfo(this->sel, r.left + WD_FRAMERECT_LEFT, r.top + WD_FRAMERECT_TOP, r.right - WD_FRAMERECT_RIGHT, r.bottom - WD_FRAMERECT_BOTTOM, false);
 
				}
 
				break;
 
		}
 
	}
 

	
 
	virtual void OnDoubleClick(Point pt, int widget)
 
	{
 
		if (widget == ANGRFW_GRF_LIST) this->OnClick(pt, ANGRFW_ADD);
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
 
		switch (widget) {
 
			case ANGRFW_GRF_LIST: {
 
				/* Get row... */
 
				uint i = (pt.y - this->GetWidget<NWidgetBase>(ANGRFW_GRF_LIST)->pos_y - WD_FRAMERECT_TOP) / this->resize.step_height + this->vscroll.GetPosition();
 

	
 
@@ -361,15 +356,15 @@ public:
 
					this->sel_pos = i;
 
				} else {
 
					this->sel = NULL;
 
					this->sel_pos = -1;
 
				}
 
				this->InvalidateData(1);
 
				break;
 
				if (click_count == 1) break;
 
			}
 

	
 
			/* FALL THROUGH */
 
			case ANGRFW_ADD: // Add selection to list
 
				if (this->sel != NULL) {
 
					const GRFConfig *src = this->sel;
 
					GRFConfig **list;
 

	
 
					/* Find last entry in the list, checking for duplicate grfid on the way */
 
@@ -702,18 +697,13 @@ struct NewGRFWindow : public Window {
 
					ShowNewGRFInfo(this->sel, r.left + WD_FRAMERECT_LEFT, r.top + WD_FRAMERECT_TOP, r.right - WD_FRAMERECT_RIGHT, r.bottom - WD_FRAMERECT_BOTTOM, this->show_params);
 
				}
 
				break;
 
		}
 
	}
 

	
 
	virtual void OnDoubleClick(Point pt, int widget)
 
	{
 
		if (widget == SNGRFS_FILE_LIST) this->OnClick(pt, SNGRFS_SET_PARAMETERS);
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
 
		switch (widget) {
 
			case SNGRFS_PRESET_LIST: {
 
				DropDownList *list = new DropDownList();
 

	
 
				/* Add 'None' option for clearing list */
 
@@ -818,12 +808,13 @@ struct NewGRFWindow : public Window {
 
				for (c = this->list; c != NULL && i > 0; c = c->next, i--) {}
 

	
 
				if (this->sel != c) this->DeleteChildWindows(WC_QUERY_STRING); // Remove the parameter query window
 
				this->sel = c;
 

	
 
				this->InvalidateData();
 
				if (click_count > 1) this->OnClick(pt, SNGRFS_SET_PARAMETERS, 1);
 
				break;
 
			}
 

	
 
			case SNGRFS_APPLY_CHANGES: // Apply changes made to GRF list
 
				if (this->execute) {
 
					ShowQuery(