File diff r14398:461a80e5f996 → r14399:3f819c0da60a
src/network/network_gui.cpp
Show inline comments
 
@@ -658,7 +658,7 @@ public:
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
 
		this->field = widget;
 
		switch (widget) {
 
@@ -697,6 +697,9 @@ public:
 
				this->server = (id_v < this->servers.Length()) ? this->servers[id_v] : NULL;
 
				this->list_pos = (server == NULL) ? SLP_INVALID : id_v;
 
				this->SetDirty();
 

	
 
				/* FIXME the disabling should go into some InvalidateData, which is called instead of the SetDirty */
 
				if (!this->IsWidgetDisabled(NGWW_JOIN)) this->OnClick(pt, NGWW_JOIN, 1);
 
			} break;
 

	
 
			case NGWW_LASTJOINED: {
 
@@ -713,6 +716,9 @@ public:
 
					}
 
					this->ScrollToSelectedServer();
 
					this->SetDirty();
 

	
 
					/* FIXME the disabling should go into some InvalidateData, which is called instead of the SetDirty */
 
					if (!this->IsWidgetDisabled(NGWW_JOIN)) this->OnClick(pt, NGWW_JOIN, 1);
 
				}
 
			} break;
 

	
 
@@ -755,14 +761,6 @@ public:
 
		}
 
	}
 

	
 
	virtual void OnDoubleClick(Point pt, int widget)
 
	{
 
		if (widget == NGWW_MATRIX || widget == NGWW_LASTJOINED) {
 
			/* is the Join button enabled? */
 
			if (!this->IsWidgetDisabled(NGWW_JOIN)) this->OnClick(pt, NGWW_JOIN);
 
		}
 
	}
 

	
 
	virtual void OnDropdownSelect(int widget, int index)
 
	{
 
		switch (widget) {
 
@@ -1157,7 +1155,7 @@ struct NetworkStartServerWindow : public
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
 
		this->field = widget;
 
		switch (widget) {
 
@@ -1621,7 +1619,7 @@ struct NetworkLobbyWindow : public Windo
 
		DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_GAME_LOBBY_PLAYERS); // players
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
 
		switch (widget) {
 
			case NLWW_CANCEL:   // Cancel button
 
@@ -1636,6 +1634,9 @@ struct NetworkLobbyWindow : public Windo
 
				id_v += this->vscroll.GetPosition();
 
				this->company = (id_v >= this->server->info.companies_on) ? INVALID_COMPANY : NetworkLobbyFindCompanyIndex(id_v);
 
				this->SetDirty();
 

	
 
				/* FIXME the disabling should go into some InvalidateData, which is called instead of the SetDirty */
 
				if (!this->IsWidgetDisabled(NLWW_JOIN)) this->OnClick(pt, NLWW_JOIN, 1);
 
			} break;
 

	
 
			case NLWW_JOIN:     // Join company
 
@@ -1660,14 +1661,6 @@ struct NetworkLobbyWindow : public Windo
 
		}
 
	}
 

	
 
	virtual void OnDoubleClick(Point pt, int widget)
 
	{
 
		if (widget == NLWW_MATRIX) {
 
			/* is the Join button enabled? */
 
			if (!this->IsWidgetDisabled(NLWW_JOIN)) this->OnClick(pt, NLWW_JOIN);
 
		}
 
	}
 

	
 
	virtual void OnResize()
 
	{
 
		this->vscroll.SetCapacityFromWidget(this, NLWW_MATRIX);
 
@@ -2085,7 +2078,7 @@ struct NetworkClientListWindow : Window 
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
 
		/* Show the popup with option */
 
		if (this->selected_item != -1) {
 
@@ -2218,7 +2211,7 @@ struct NetworkJoinStatusWindow : Window 
 
		size->width = width + WD_FRAMERECT_LEFT + WD_FRAMERECT_BOTTOM + 10;
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
 
		if (widget == NJSW_CANCELOK) { // Disconnect button
 
			NetworkDisconnect();
 
@@ -2304,7 +2297,7 @@ struct NetworkCompanyPasswordWindow : pu
 
		this->DrawEditBox(NCPWW_PASSWORD);
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
 
		switch (widget) {
 
			case NCPWW_OK: