Changeset - r13528:a122b758dbd7
[Not reviewed]
master
0 1 0
alberth - 15 years ago 2009-11-13 18:17:46
alberth@openttd.org
(svn r18059) -Codechange: Move some variable declarations to their use.
1 file changed with 4 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/group_gui.cpp
Show inline comments
 
@@ -333,15 +333,12 @@ public:
 
		this->SetDirty();
 
	}
 

	
 
	virtual void OnPaint()
 
	{
 
		const Owner owner = (Owner)GB(this->window_number, 0, 8);
 
		int y1 = PLY_WND_PRC__OFFSET_TOP_WIDGET + 2;
 
		int max;
 
		int i;
 

	
 
		/* If we select the all vehicles, this->list will contain all vehicles of the owner
 
		 * else this->list will contain all vehicles which belong to the selected group */
 
		this->BuildVehicleList(owner, this->group_sel, IsAllGroupID(this->group_sel) ? VLW_STANDARD : VLW_GROUP_LIST);
 
		this->SortVehicleList();
 

	
 
@@ -407,20 +404,21 @@ public:
 
		this->widget[GRP_WIDGET_SORT_BY_DROPDOWN].data = this->vehicle_sorter_names[this->vehicles.SortType()];
 

	
 
		this->DrawWidgets();
 

	
 
		/* Draw Matrix Group
 
		 * The selected group is drawn in white */
 
		int y1 = PLY_WND_PRC__OFFSET_TOP_WIDGET + 2;
 
		DrawString(this->widget[GRP_WIDGET_LIST_GROUP].left + 10, this->widget[GRP_WIDGET_LIST_GROUP].right, y1, STR_GROUP_ALL_TRAINS + this->vehicle_type, IsAllGroupID(this->group_sel) ? TC_WHITE : TC_BLACK);
 

	
 
		y1 += 13;
 

	
 
		DrawString(this->widget[GRP_WIDGET_LIST_GROUP].left + 10, this->widget[GRP_WIDGET_LIST_GROUP].right, y1, STR_GROUP_DEFAULT_TRAINS + this->vehicle_type, IsDefaultGroupID(this->group_sel) ? TC_WHITE : TC_BLACK);
 

	
 
		max = min(this->vscroll2.GetPosition() + this->vscroll2.GetCapacity(), this->groups.Length());
 
		for (i = this->vscroll2.GetPosition() ; i < max ; ++i) {
 
		int max = min(this->vscroll2.GetPosition() + this->vscroll2.GetCapacity(), this->groups.Length());
 
		for (int i = this->vscroll2.GetPosition() ; i < max ; ++i) {
 
			const Group *g = this->groups[i];
 

	
 
			assert(g->owner == owner);
 

	
 
			y1 += PLY_WND_PRC__SIZE_OF_ROW_TINY;
 

	
 
@@ -580,27 +578,25 @@ public:
 

	
 
				break;
 
			}
 

	
 
			case GRP_WIDGET_LIST_VEHICLE: { // Maxtrix vehicle
 
				uint32 id_v = (pt.y - PLY_WND_PRC__OFFSET_TOP_WIDGET) / (int)this->resize.step_height;
 
				const Vehicle *v;
 
				const VehicleID vindex = this->vehicle_sel;
 

	
 
				this->vehicle_sel = INVALID_VEHICLE;
 

	
 
				this->SetDirty();
 

	
 
				if (id_v >= this->vscroll.GetCapacity()) return; // click out of bounds
 

	
 
				id_v += this->vscroll.GetPosition();
 

	
 
				if (id_v >= this->vehicles.Length()) return; // click out of list bound
 

	
 
				v = this->vehicles[id_v];
 

	
 
				const Vehicle *v = this->vehicles[id_v];
 
				if (vindex == v->index) {
 
					ShowVehicleViewWindow(v);
 
				}
 

	
 
				break;
 
			}
0 comments (0 inline, 0 general)