Changeset - r9115:dd5b7219608f
[Not reviewed]
master
0 21 0
rubidium - 16 years ago 2008-05-06 21:28:30
rubidium@openttd.org
(svn r12975) -Codechange: replace DeleteWindow(w) with delete w.
21 files changed with 86 insertions and 86 deletions:
0 comments (0 inline, 0 general)
src/airport_gui.cpp
Show inline comments
 
@@ -236,7 +236,7 @@ static void BuildAirportPickerWndProc(Wi
 

	
 
		case WE_MOUSELOOP: {
 
			if (WP(w, def_d).close) {
 
				DeleteWindow(w);
 
				delete w;
 
				return;
 
			}
 

	
src/bridge_gui.cpp
Show inline comments
 
@@ -42,7 +42,7 @@ void CcBuildBridge(bool success, TileInd
 

	
 
static void BuildBridge(Window *w, int i)
 
{
 
	DeleteWindow(w);
 
	delete w;
 
	DoCommandP(_bridgedata.end_tile, _bridgedata.start_tile,
 
		_bridgedata.type | _bridgedata.indexes[i], CcBuildBridge,
 
		CMD_BUILD_BRIDGE | CMD_MSG(STR_5015_CAN_T_BUILD_BRIDGE_HERE));
src/dock_gui.cpp
Show inline comments
 
@@ -280,7 +280,7 @@ static void BuildDockStationWndProc(Wind
 

	
 
	case WE_MOUSELOOP:
 
		if (WP(w, def_d).close) {
 
			DeleteWindow(w);
 
			delete w;
 
			return;
 
		}
 

	
 
@@ -354,7 +354,7 @@ static void BuildDocksDepotWndProc(Windo
 
	} break;
 

	
 
	case WE_MOUSELOOP:
 
		if (WP(w, def_d).close) DeleteWindow(w);
 
		if (WP(w, def_d).close) delete w;
 
		break;
 

	
 
	case WE_DESTROY:
src/engine_gui.cpp
Show inline comments
 
@@ -96,7 +96,7 @@ static void EnginePreviewWndProc(Window 
 
				DoCommandP(0, w->window_number, 0, NULL, CMD_WANT_ENGINE_PREVIEW);
 
				/* Fallthrough */
 
			case 3:
 
				DeleteWindow(w);
 
				delete w;
 
				break;
 
		}
 
		break;
src/genworld_gui.cpp
Show inline comments
 
@@ -342,7 +342,7 @@ static void GenerateLandscapeWndProc(Win
 

	
 
		case WE_CLICK:
 
			switch (e->we.click.widget) {
 
				case 0: DeleteWindow(w); break;
 
				case 0: delete w; break;
 

	
 
				case GLAND_TEMPERATE:
 
				case GLAND_ARCTIC:
src/misc_gui.cpp
Show inline comments
 
@@ -558,11 +558,11 @@ static void ErrmsgWndProc(Window *w, Win
 
			break;
 

	
 
		case WE_MOUSELOOP:
 
			if (_right_button_down) DeleteWindow(w);
 
			if (_right_button_down) delete w;
 
			break;
 

	
 
		case WE_4:
 
			if (--_errmsg_duration == 0) DeleteWindow(w);
 
			if (--_errmsg_duration == 0) delete w;
 
			break;
 

	
 
		case WE_DESTROY:
 
@@ -575,7 +575,7 @@ static void ErrmsgWndProc(Window *w, Win
 
			if (e->we.keypress.keycode == WKC_SPACE) {
 
				/* Don't continue. */
 
				e->we.keypress.cont = false;
 
				DeleteWindow(w);
 
				delete w;
 
			}
 
			break;
 
	}
 
@@ -711,9 +711,9 @@ static void TooltipsWndProc(Window *w, W
 
			/* We can show tooltips while dragging tools. These are shown as long as
 
			 * we are dragging the tool. Normal tooltips work with rmb */
 
			if (WP(w, tooltips_d).paramcount == 0 ) {
 
				if (!_right_button_down) DeleteWindow(w);
 
				if (!_right_button_down) delete w;
 
			} else {
 
				if (!_left_button_down) DeleteWindow(w);
 
				if (!_left_button_down) delete w;
 
			}
 

	
 
			break;
 
@@ -1171,7 +1171,7 @@ static void QueryStringWndProc(Window *w
 
					}
 
					/* Fallthrough */
 
				case QUERY_STR_WIDGET_CANCEL:
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 
			}
 
			break;
 
@@ -1183,7 +1183,7 @@ static void QueryStringWndProc(Window *w
 
		case WE_KEYPRESS:
 
			switch (HandleEditBoxKey(w, qs, QUERY_STR_WIDGET_TEXT, e)) {
 
				case 1: goto press_ok; // Enter pressed, confirms change
 
				case 2: DeleteWindow(w); break; // ESC pressed, closes window, abandons changes
 
				case 2: delete w; break; // ESC pressed, closes window, abandons changes
 
			}
 
			break;
 

	
 
@@ -1296,7 +1296,7 @@ static void QueryWndProc(Window *w, Wind
 
					if (q->proc != NULL) q->proc(w->parent, true);
 
					/* Fallthrough */
 
				case QUERY_WIDGET_NO:
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 
				}
 
			break;
 
@@ -1310,7 +1310,7 @@ static void QueryWndProc(Window *w, Wind
 
					/* Fallthrough */
 
				case WKC_ESC:
 
					e->we.keypress.cont = false;
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 
			}
 
			break;
 
@@ -1581,13 +1581,13 @@ static void SaveLoadDlgWndProc(Window *w
 
							ttd_strlcpy(_file_to_saveload.name, name, sizeof(_file_to_saveload.name));
 
							ttd_strlcpy(_file_to_saveload.title, file->title, sizeof(_file_to_saveload.title));
 

	
 
							DeleteWindow(w);
 
							delete w;
 
						} else if (_saveload_mode == SLD_LOAD_HEIGHTMAP) {
 
							SetFiosType(file->type);
 
							ttd_strlcpy(_file_to_saveload.name, name, sizeof(_file_to_saveload.name));
 
							ttd_strlcpy(_file_to_saveload.title, file->title, sizeof(_file_to_saveload.title));
 

	
 
							DeleteWindow(w);
 
							delete w;
 
							ShowHeightmapLoad();
 
						} else {
 
							/* SLD_SAVE_GAME, SLD_SAVE_SCENARIO copy clicked name to editbox */
 
@@ -1620,7 +1620,7 @@ static void SaveLoadDlgWndProc(Window *w
 

	
 
		case WE_KEYPRESS:
 
			if (e->we.keypress.keycode == WKC_ESC) {
 
				DeleteWindow(w);
 
				delete w;
 
				return;
 
			}
 

	
src/network/network_gui.cpp
Show inline comments
 
@@ -869,7 +869,7 @@ static void NetworkStartServerWindowWndP
 
							ttd_strlcpy(_file_to_saveload.name, name, sizeof(_file_to_saveload.name));
 
							ttd_strlcpy(_file_to_saveload.title, nd->map->title, sizeof(_file_to_saveload.title));
 

	
 
							DeleteWindow(w);
 
							delete w;
 
							SwitchMode(SM_START_SCENARIO);
 
						}
 
					}
 
@@ -879,7 +879,7 @@ static void NetworkStartServerWindowWndP
 
					_is_network_server = true;
 
					/* XXX - WC_NETWORK_WINDOW (this window) should stay, but if it stays, it gets
 
					* copied all the elements of 'load game' and upon closing that, it segfaults */
 
					DeleteWindow(w);
 
					delete w;
 
					ShowSaveLoadDialog(SLD_LOAD_GAME);
 
					break;
 
			}
 
@@ -1672,7 +1672,7 @@ static void NetworkJoinStatusWindowWndPr
 
		case WE_CLICK:
 
			if (e->we.click.widget == 2) { //Disconnect button
 
				NetworkDisconnect();
 
				DeleteWindow(w);
 
				delete w;
 
				SwitchMode(SM_MENU);
 
				ShowNetworkGameWindow();
 
			}
 
@@ -1891,7 +1891,7 @@ static void ChatWindowWndProc(Window *w,
 
				case 3: /* Send */
 
					SendChat(WP(w, chatquerystr_d).text.buf, WP(w, chatquerystr_d).dtype, WP(w, chatquerystr_d).dest);
 
				/* FALLTHROUGH */
 
				case 0: /* Cancel */ DeleteWindow(w); break;
 
				case 0: /* Cancel */ delete w; break;
 
			}
 
			break;
 

	
 
@@ -1908,7 +1908,7 @@ static void ChatWindowWndProc(Window *w,
 
					case 1: /* Return */
 
						SendChat(WP(w, chatquerystr_d).text.buf, WP(w, chatquerystr_d).dtype, WP(w, chatquerystr_d).dest);
 
					/* FALLTHROUGH */
 
					case 2: /* Escape */ DeleteWindow(w); break;
 
					case 2: /* Escape */ delete w; break;
 
				}
 
			}
 
			break;
 
@@ -1987,7 +1987,7 @@ static void NetworkCompanyPasswordWindow
 

	
 
				/* FALL THROUGH */
 
				case NCPWW_CANCEL:
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 

	
 
				case NCPWW_SAVE_AS_DEFAULT_PASSWORD:
 
@@ -2013,7 +2013,7 @@ static void NetworkCompanyPasswordWindow
 
					break;
 

	
 
				case 2: // Escape
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 
			}
 
			break;
src/news_gui.cpp
Show inline comments
 
@@ -195,7 +195,7 @@ static void NewsWindowProc(Window *w, Wi
 
			switch (e->we.click.widget) {
 
				case 1: {
 
					NewsItem *ni = WP(w, news_d).ni;
 
					DeleteWindow(w);
 
					delete w;
 
					ni->duration = 0;
 
					_forced_news = INVALID_NEWS;
 
					break;
 
@@ -227,7 +227,7 @@ static void NewsWindowProc(Window *w, Wi
 
			if (e->we.keypress.keycode == WKC_SPACE) {
 
				/* Don't continue. */
 
				e->we.keypress.cont = false;
 
				DeleteWindow(w);
 
				delete w;
 
			}
 
			break;
 

	
src/osk_gui.cpp
Show inline comments
 
@@ -164,7 +164,7 @@ static void OskWndProc(Window *w, Window
 
							parent->HandleWindowEvent(&e);
 
						}
 
					}
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 

	
 
				case OSK_WIDGET_CANCEL:
 
@@ -179,7 +179,7 @@ static void OskWndProc(Window *w, Window
 
						UpdateTextBufferSize(&qs->text);
 
						MoveTextBufferPos(&qs->text, WKC_END);
 
					}
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 
			}
 
			/* make sure that the parent window's textbox also gets updated */
src/player_gui.cpp
Show inline comments
 
@@ -197,7 +197,7 @@ static void PlayerFinancesWndProc(Window
 
					int oldleft = w->left; ///< current left position of the window before closing it
 
					PlayerID player = (PlayerID)w->window_number;
 

	
 
					DeleteWindow(w);
 
					delete w;
 
					/* Open up the (toggled size) Finance window at the same position as the previous */
 
					DoShowPlayerFinances(player, !HasBit(mode, 0), stickied, oldtop, oldleft);
 
				}
 
@@ -871,20 +871,20 @@ static void SelectPlayerFaceWndProc(Wind
 
					int oldleft = w->left;   ///< current top position of the window before closing it
 

	
 
					DoCommandP(0, 0, *pf, NULL, CMD_SET_PLAYER_FACE);
 
					DeleteWindow(w);
 
					delete w;
 
					/* Open up the (toggled size) Face selection window at the same position as the previous */
 
					DoSelectPlayerFace((PlayerID)w->window_number, !WP(w, facesel_d).advanced, oldtop, oldleft);
 
				} break;
 

	
 
				/* Cancel button */
 
				case PFW_WIDGET_CANCEL:
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 

	
 
				/* OK button */
 
				case PFW_WIDGET_ACCEPT:
 
					DoCommandP(0, 0, *pf, NULL, CMD_SET_PLAYER_FACE);
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 

	
 
				/* Load button */
 
@@ -1379,7 +1379,7 @@ static void BuyCompanyWndProc(Window *w,
 
		case WE_CLICK:
 
			switch (e->we.click.widget) {
 
				case 3:
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 
				case 4: {
 
					DoCommandP(0, w->window_number, 0, NULL, CMD_BUY_COMPANY | CMD_MSG(STR_7060_CAN_T_BUY_COMPANY));
 
@@ -1464,7 +1464,7 @@ static void EndGameWndProc(Window *w, Wi
 
		} break;
 

	
 
		case WE_CLICK: /* Close the window (and show the highscore window) */
 
			DeleteWindow(w);
 
			delete w;
 
			break;
 

	
 
		case WE_DESTROY: /* Show the highscore window when this one is closed */
 
@@ -1505,7 +1505,7 @@ static void HighScoreWndProc(Window *w, 
 
		} break;
 

	
 
		case WE_CLICK: /* Onclick to close window, and in destroy event handle the rest */
 
			DeleteWindow(w);
 
			delete w;
 
			break;
 

	
 
		case WE_DESTROY: /* Get back all the hidden windows */
src/rail_gui.cpp
Show inline comments
 
@@ -1128,7 +1128,7 @@ static void StationBuildWndProc(Window *
 

	
 
	case WE_MOUSELOOP:
 
		if (WP(w, def_d).close) {
 
			DeleteWindow(w);
 
			delete w;
 
			return;
 
		}
 
		CheckRedrawStationCoverage(w);
 
@@ -1352,7 +1352,7 @@ static void SignalBuildWndProc(Window *w
 
			break;
 

	
 
		case WE_MOUSELOOP:
 
			if (WP(w, def_d).close) DeleteWindow(w);
 
			if (WP(w, def_d).close) delete w;
 
			return;
 

	
 
		case WE_DESTROY:
 
@@ -1443,7 +1443,7 @@ static void BuildTrainDepotWndProc(Windo
 
		break;
 

	
 
	case WE_MOUSELOOP:
 
		if (WP(w, def_d).close) DeleteWindow(w);
 
		if (WP(w, def_d).close) delete w;
 
		return;
 

	
 
	case WE_DESTROY:
 
@@ -1542,7 +1542,7 @@ static void BuildWaypointWndProc(Window 
 
	}
 

	
 
	case WE_MOUSELOOP:
 
		if (WP(w, def_d).close) DeleteWindow(w);
 
		if (WP(w, def_d).close) delete w;
 
		break;
 

	
 
	case WE_DESTROY:
src/road_gui.cpp
Show inline comments
 
@@ -767,7 +767,7 @@ static void BuildRoadDepotWndProc(Window
 
			break;
 

	
 
		case WE_MOUSELOOP:
 
			if (WP(w, def_d).close) DeleteWindow(w);
 
			if (WP(w, def_d).close) delete w;
 
			break;
 

	
 
		case WE_DESTROY:
 
@@ -925,7 +925,7 @@ static void RoadStationPickerWndProc(Win
 

	
 
		case WE_MOUSELOOP:
 
			if (WP(w, def_d).close) {
 
				DeleteWindow(w);
 
				delete w;
 
				return;
 
			}
 

	
src/settings_gui.cpp
Show inline comments
 
@@ -642,7 +642,7 @@ static void GameDifficultyWndProc(Window
 
							DoCommandP(0, btn, val, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
 
					}
 
					DoCommandP(0, UINT_MAX, _opt_mod_temp.diff_level, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
 
					DeleteWindow(w);
 
					delete w;
 
					/* If we are in the editor, we should reload the economy.
 
					 * This way when you load a game, the max loan and interest rate
 
					 * are loaded correctly. */
 
@@ -651,7 +651,7 @@ static void GameDifficultyWndProc(Window
 
				}
 

	
 
				case GDW_CANCEL: // Cancel button - close window, abandon changes
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 
			} break;
 

	
src/signs_gui.cpp
Show inline comments
 
@@ -246,7 +246,7 @@ static void QuerySignEditWndProc(Window 
 
					/* FALL THROUGH */
 

	
 
				case QUERY_EDIT_SIGN_WIDGET_CANCEL:
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 
			}
 
			break;
 
@@ -258,7 +258,7 @@ static void QuerySignEditWndProc(Window 
 
					/* FALL THROUGH */
 

	
 
				case 2: // ESC pressed, closes window, abandons changes
 
					DeleteWindow(w);
 
					delete w;
 
					break;
 
			}
 
			break;
src/toolbar_gui.cpp
Show inline comments
 
@@ -1142,7 +1142,7 @@ static void MenuWndProc(Window *w, Windo
 
			}
 

	
 
			int action_id = WP(w, menu_d).action_id;
 
			DeleteWindow(w);
 
			delete w;
 

	
 
			if (index >= 0) {
 
				assert((uint)index <= lengthof(_menu_clicked_procs));
 
@@ -1347,7 +1347,7 @@ static void PlayerMenuWndProc(Window *w,
 
					index = WP(w, menu_d).sel_index;
 
			}
 

	
 
			DeleteWindow(w);
 
			delete w;
 

	
 
			if (index >= 0) {
 
				assert(index >= 0 && index < 30);
src/train_cmd.cpp
Show inline comments
 
@@ -1347,8 +1347,7 @@ CommandCost CmdSellRailWagon(TileIndex t
 

	
 
	if (flags & DC_EXEC) {
 
		if (v == first && IsFrontEngine(first)) {
 
			w = FindWindowById(WC_VEHICLE_VIEW, first->index);
 
			if (w != NULL) DeleteWindow(w);
 
			delete FindWindowById(WC_VEHICLE_VIEW, first->index);
 
		}
 
		InvalidateWindow(WC_VEHICLE_DEPOT, first->tile);
 
		RebuildVehicleLists();
src/vehicle_gui.cpp
Show inline comments
 
@@ -398,9 +398,9 @@ static void VehicleRefitWndProc(Window *
 
								case VEH_SHIP:     command = CMD_REFIT_SHIP         | CMD_MSG(STR_9841_CAN_T_REFIT_SHIP);     break;
 
								case VEH_AIRCRAFT: command = CMD_REFIT_AIRCRAFT     | CMD_MSG(STR_A042_CAN_T_REFIT_AIRCRAFT); break;
 
							}
 
							if (DoCommandP(v->tile, v->index, WP(w, refit_d).cargo->cargo | WP(w, refit_d).cargo->subtype << 8, NULL, command)) DeleteWindow(w);
 
							if (DoCommandP(v->tile, v->index, WP(w, refit_d).cargo->cargo | WP(w, refit_d).cargo->subtype << 8, NULL, command)) delete w;
 
						} else {
 
							if (DoCommandP(v->tile, v->index, WP(w, refit_d).cargo->cargo | WP(w, refit_d).cargo->subtype << 8 | WP(w, refit_d).order << 16, NULL, CMD_ORDER_REFIT)) DeleteWindow(w);
 
							if (DoCommandP(v->tile, v->index, WP(w, refit_d).cargo->cargo | WP(w, refit_d).cargo->subtype << 8 | WP(w, refit_d).order << 16, NULL, CMD_ORDER_REFIT)) delete w;
 
						}
 
					}
 
					break;
src/widgets/dropdown.cpp
Show inline comments
 
@@ -172,7 +172,7 @@ static void DropDownMenuWndProc(Window *
 
		case WE_MOUSELOOP: {
 
			Window *w2 = FindWindowById(WP(w, dropdown_d).parent_wnd_class, WP(w,dropdown_d).parent_wnd_num);
 
			if (w2 == NULL) {
 
				DeleteWindow(w);
 
				delete w;
 
				return;
 
			}
 

	
 
@@ -182,7 +182,7 @@ static void DropDownMenuWndProc(Window *
 
				e.we.dropdown.button = WP(w, dropdown_d).parent_button;
 
				e.we.dropdown.index  = WP(w, dropdown_d).selected_index;
 
				w2->HandleWindowEvent(&e);
 
				DeleteWindow(w);
 
				delete w;
 
				return;
 
			}
 

	
 
@@ -362,7 +362,7 @@ void HideDropDownMenu(Window *pw)
 

	
 
		if (pw->window_class == WP(*wz, dropdown_d).parent_wnd_class &&
 
				pw->window_number == WP(*wz, dropdown_d).parent_wnd_num) {
 
			DeleteWindow(*wz);
 
			delete *wz;
 
			break;
 
		}
 
	}
src/window.cpp
Show inline comments
 
@@ -170,7 +170,7 @@ static void DispatchLeftClickEvent(Windo
 

	
 
		if (w->desc_flags & WDF_STD_BTN) {
 
			if (e.we.click.widget == 0) { /* 'X' */
 
				DeleteWindow(w);
 
				delete w;
 
				return;
 
			}
 

	
 
@@ -369,10 +369,19 @@ void CallWindowEventNP(Window *w, int ev
 
 * @param w Window to redraw
 
 * @ingroup dirty
 
 */
 
void Window::SetDirty() const
 
{
 
	SetDirtyBlocks(this->left, this->top, this->left + this->width, this->top + this->height);
 
}
 

	
 
/**
 
 * Mark entire window as dirty (in need of re-paint)
 
 * @param w Window to redraw
 
 * @ingroup dirty
 
 */
 
void SetWindowDirty(const Window *w)
 
{
 
	if (w == NULL) return;
 
	SetDirtyBlocks(w->left, w->top, w->left + w->width, w->top + w->height);
 
	if (w != NULL) w->SetDirty();
 
}
 

	
 
/** Find the Window whose parent pointer points to this window
 
@@ -410,44 +419,35 @@ Window **FindWindowZPosition(const Windo
 

	
 
/**
 
 * Remove window and all its child windows from the window stack.
 
 * @param w Window to delete
 
 */
 
void DeleteWindow(Window *w)
 
Window::~Window()
 
{
 
	if (w == NULL) return;
 

	
 
	if (_thd.place_mode != VHM_NONE &&
 
			_thd.window_class == w->window_class &&
 
			_thd.window_number == w->window_number) {
 
			_thd.window_class == this->window_class &&
 
			_thd.window_number == this->window_number) {
 
		ResetObjectToPlace();
 
	}
 

	
 
	/* Prevent Mouseover() from resetting mouse-over coordinates on a non-existing window */
 
	if (_mouseover_last_w == w) _mouseover_last_w = NULL;
 
	if (_mouseover_last_w == this) _mouseover_last_w = NULL;
 

	
 
	/* Find the window in the z-array, and effectively remove it
 
	 * by moving all windows after it one to the left. This must be
 
	 * done before removing the child so we cannot cause recursion
 
	 * between the deletion of the parent and the child. */
 
	Window **wz = FindWindowZPosition(w);
 
	Window **wz = FindWindowZPosition(this);
 
	if (wz == NULL) return;
 
	memmove(wz, wz + 1, (byte*)_last_z_window - (byte*)wz);
 
	_last_z_window--;
 

	
 
	/* Delete any children a window might have in a head-recursive manner */
 
	Window *v = FindChildWindow(w);
 
	if (v != NULL) DeleteWindow(v);
 

	
 
	CallWindowEventNP(w, WE_DESTROY);
 
	if (w->viewport != NULL) DeleteWindowViewport(w);
 
	delete FindChildWindow(this);
 

	
 
	SetWindowDirty(w);
 
	free(w->widget);
 
	w->widget = NULL;
 
	w->widget_count = 0;
 
	w->parent = NULL;
 
	CallWindowEventNP(this, WE_DESTROY);
 
	if (this->viewport != NULL) DeleteWindowViewport(this);
 

	
 
	delete w;
 
	this->SetDirty();
 
	free(this->widget);
 
}
 

	
 
/**
 
@@ -475,7 +475,7 @@ Window *FindWindowById(WindowClass cls, 
 
 */
 
void DeleteWindowById(WindowClass cls, WindowNumber number)
 
{
 
	DeleteWindow(FindWindowById(cls, number));
 
	delete FindWindowById(cls, number);
 
}
 

	
 
/**
 
@@ -493,7 +493,7 @@ restart_search:
 
	FOR_ALL_WINDOWS(wz) {
 
		Window *w = *wz;
 
		if (w->window_class == cls) {
 
			DeleteWindow(w);
 
			delete w;
 
			goto restart_search;
 
		}
 
	}
 
@@ -514,7 +514,7 @@ restart_search:
 
	FOR_ALL_WINDOWS(wz) {
 
		Window *w = *wz;
 
		if (w->caption_color == id) {
 
			DeleteWindow(w);
 
			delete w;
 
			goto restart_search;
 
		}
 
	}
 
@@ -696,7 +696,7 @@ static Window *LocalAllocateWindow(int x
 
	if (_last_z_window == endof(_z_windows)) {
 
		w = FindDeletableWindow();
 
		if (w == NULL) w = ForceFindDeletableWindow();
 
		DeleteWindow(w);
 
		delete w;
 
	}
 

	
 
	w = new Window(proc);
 
@@ -1087,7 +1087,7 @@ restart_search:
 
	 * anywhere in the z-array. We call DeleteWindow() so that it can properly
 
	 * release own alloc'd memory, which otherwise could result in memleaks */
 
	FOR_ALL_WINDOWS(wz) {
 
		DeleteWindow(*wz);
 
		delete *wz;
 
		goto restart_search;
 
	}
 

	
 
@@ -2212,7 +2212,7 @@ restart_search:
 
				w->window_class != WC_TOOLTIPS &&
 
				(w->flags4 & WF_STICKY) == 0) { // do not delete windows which are 'pinned'
 

	
 
			DeleteWindow(w);
 
			delete w;
 
			goto restart_search;
 
		}
 
	}
 
@@ -2236,7 +2236,7 @@ restart_search:
 
	 * anywhere in the z-array */
 
	FOR_ALL_WINDOWS(wz) {
 
		if ((*wz)->flags4 & WF_STICKY) {
 
			DeleteWindow(*wz);
 
			delete *wz;
 
			goto restart_search;
 
		}
 
	}
src/window_func.h
Show inline comments
 
@@ -13,7 +13,6 @@ void SendWindowMessage(WindowClass wnd_c
 
void SendWindowMessageClass(WindowClass wnd_class, int msg, int wparam, int lparam);
 

	
 
Window *FindWindowById(WindowClass cls, WindowNumber number);
 
void DeleteWindow(Window *w);
 
void ChangeWindowOwner(PlayerID old_player, PlayerID new_player);
 

	
 
void ResizeWindow(Window *w, int x, int y);
src/window_gui.h
Show inline comments
 
@@ -296,6 +296,7 @@ private:
 

	
 
public:
 
	Window(WindowProc *proc) : wndproc(proc) {}
 
	virtual ~Window();
 

	
 
	uint16 flags4;              ///< Window flags, @see WindowFlags
 
	WindowClass window_class;   ///< Window class
 
@@ -345,6 +346,8 @@ public:
 
	void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...);
 
	void InvalidateWidget(byte widget_index) const;
 

	
 
	void SetDirty() const;
 

	
 
	virtual void HandleWindowEvent(WindowEvent *e);
 
};
 

	
 
@@ -548,7 +551,6 @@ void SendWindowMessage(WindowClass wnd_c
 
void SendWindowMessageClass(WindowClass wnd_class, int msg, int wparam, int lparam);
 

	
 
Window *FindWindowById(WindowClass cls, WindowNumber number);
 
void DeleteWindow(Window *w);
 
void DeletePlayerWindows(PlayerID pi);
 
void ChangeWindowOwner(PlayerID old_player, PlayerID new_player);
 
Window *BringWindowToFrontById(WindowClass cls, WindowNumber number);
0 comments (0 inline, 0 general)