Changeset - r886:20dc750321ef
[Not reviewed]
master
0 4 0
truelight - 20 years ago 2005-01-04 15:49:30
truelight@openttd.org
(svn r1372) -Fix: fixed some GUI glitches introduced with resize-buttons
4 files changed with 19 insertions and 4 deletions:
0 comments (0 inline, 0 general)
aircraft_gui.c
Show inline comments
 
@@ -932,25 +932,25 @@ static const Widget _player_aircraft_wid
 
};
 

	
 
static const Widget _other_player_aircraft_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,							STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,  RESIZE_RIGHT,    14,    11,   247,     0,    13, STR_A009_AIRCRAFT,			STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{  WWT_STICKYBOX,     RESIZE_LR,    14,   248,   259,     0,    13, 0x0,                   STR_STICKY_BUTTON},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,     0,    80,    14,    25, SRT_SORT_BY,						STR_SORT_ORDER_TIP},
 
{      WWT_PANEL,   RESIZE_NONE,    14,    81,   232,    14,    25, 0x0,										STR_SORT_CRITERIA_TIP},
 
{   WWT_CLOSEBOX,   RESIZE_NONE,    14,   233,   243,    14,    25, STR_0225,							STR_SORT_CRITERIA_TIP},
 
{      WWT_PANEL,  RESIZE_RIGHT,    14,   244,   259,    14,    25, 0x0,										STR_NULL},
 
{     WWT_MATRIX,     RESIZE_RB,    14,     0,   248,    26,   169, 0x401,									STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT},
 
{  WWT_SCROLLBAR,    RESIZE_LRB,    14,   249,   259,    26,   169, 0x0,										STR_0190_SCROLL_BAR_SCROLLS_LIST},
 
{      WWT_PANEL,    RESIZE_RTB,    14,   249,   248,   170,   181, 0x0,											STR_NULL},
 
{      WWT_PANEL,    RESIZE_RTB,    14,     0,   248,   170,   181, 0x0,											STR_NULL},
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,    14,   249,   259,   170,   181, 0x0,											STR_RESIZE_BUTTON},
 
{   WIDGETS_END},
 
};
 

	
 
static void PlayerAircraftWndProc(Window *w, WindowEvent *e)
 
{
 
	int station = (int)w->window_number >> 16;
 
	int owner = w->window_number & 0xff;
 
	vehiclelist_d *vl = &WP(w, vehiclelist_d);
 

	
 
	switch(e->event) {
 
	case WE_PAINT: {
 
@@ -1049,39 +1049,45 @@ static void PlayerAircraftWndProc(Window
 

	
 
				v	= DEREF_VEHICLE(vl->sort_list[id_v].index);
 

	
 
				assert(v->type == VEH_Aircraft && v->subtype <= 2);
 

	
 
				ShowAircraftViewWindow(v);
 
			}
 
		} break;
 

	
 
		case 9: { /* Build new Vehicle */
 
			uint tile;
 

	
 
			if (!IsWindowOfPrototype(w, _player_aircraft_widgets))
 
				break;
 

	
 
			tile = _last_built_aircraft_depot_tile;
 
			do {
 
				if (_map_owner[tile] == _local_player && IsAircraftHangarTile(tile)) {
 
					ShowAircraftDepotWindow(tile);
 
					ShowBuildAircraftWindow(tile);
 
					return;
 
				}
 

	
 
				tile = TILE_MASK(tile + 1);
 
			} while(tile != _last_built_aircraft_depot_tile);
 

	
 
			ShowBuildAircraftWindow(0);
 
		} break;
 

	
 
		case 10:
 
			if (!IsWindowOfPrototype(w, _player_aircraft_widgets))
 
				break;
 

	
 
			ShowReplaceVehicleWindow(VEH_Aircraft);
 
			break;
 

	
 
		}
 
	}	break;
 

	
 
	case WE_DROPDOWN_SELECT: /* we have selected a dropdown item in the list */
 
		if (vl->sort_type != e->dropdown.index) {
 
			// value has changed -> resort
 
			vl->flags |= VL_RESORT;
 
			vl->sort_type = e->dropdown.index;
 

	
roadveh_gui.c
Show inline comments
 
@@ -753,25 +753,25 @@ static const Widget _player_roadveh_widg
 
};
 

	
 
static const Widget _other_player_roadveh_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,								STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,  RESIZE_RIGHT,    14,    11,   247,     0,    13, STR_9001_ROAD_VEHICLES,	STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{  WWT_STICKYBOX,     RESIZE_LR,    14,   248,   259,     0,    13, 0x0,                     STR_STICKY_BUTTON},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,     0,    80,    14,    25, SRT_SORT_BY,							STR_SORT_ORDER_TIP},
 
{      WWT_PANEL,   RESIZE_NONE,    14,    81,   232,    14,    25, 0x0,											STR_SORT_CRITERIA_TIP},
 
{   WWT_CLOSEBOX,   RESIZE_NONE,    14,   233,   243,    14,    25, STR_0225,								STR_SORT_CRITERIA_TIP},
 
{      WWT_PANEL,  RESIZE_RIGHT,    14,   244,   259,    14,    25, 0x0,											STR_NULL},
 
{     WWT_MATRIX,     RESIZE_RB,    14,     0,   248,    26,   207, 0x701,										STR_901A_ROAD_VEHICLES_CLICK_ON},
 
{  WWT_SCROLLBAR,    RESIZE_LRB,    14,   249,   259,    26,   207, 0x0,											STR_0190_SCROLL_BAR_SCROLLS_LIST},
 
{      WWT_PANEL,    RESIZE_RTB,    14,     0,   247,   208,   219, 0x0,											STR_NULL},
 
{      WWT_PANEL,    RESIZE_RTB,    14,     0,   248,   208,   219, 0x0,											STR_NULL},
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,    14,   249,   259,   208,   219, 0x0,											STR_RESIZE_BUTTON},
 
{   WIDGETS_END},
 
};
 

	
 
static void PlayerRoadVehWndProc(Window *w, WindowEvent *e)
 
{
 
	int station = (int)w->window_number >> 16;
 
	int owner = w->window_number & 0xff;
 
	vehiclelist_d *vl = &WP(w, vehiclelist_d);
 

	
 
	switch(e->event) {
 
	case WE_PAINT: {
 
@@ -884,24 +884,27 @@ static void PlayerRoadVehWndProc(Window 
 
				if (_map_owner[tile] == _local_player && IsRoadDepotTile(tile)) {
 
					ShowRoadDepotWindow(tile);
 
					ShowBuildRoadVehWindow(tile);
 
					return;
 
				}
 

	
 
				tile = TILE_MASK(tile + 1);
 
			} while(tile != _last_built_road_depot_tile);
 

	
 
			ShowBuildRoadVehWindow(0);
 
		} break;
 
		case 10: {
 
			if (!IsWindowOfPrototype(w, _player_roadveh_widgets))
 
				break;
 

	
 
			ShowReplaceVehicleWindow(VEH_Road);
 
			break;
 
		}
 
		}
 
	}	break;
 

	
 
	case WE_DROPDOWN_SELECT: /* we have selected a dropdown item in the list */
 
		if (vl->sort_type != e->dropdown.index) {
 
			// value has changed -> resort
 
			vl->flags |= VL_RESORT;
 
			vl->sort_type = e->dropdown.index;
 

	
ship_gui.c
Show inline comments
 
@@ -915,25 +915,25 @@ static const Widget _player_ships_widget
 
};
 

	
 
static const Widget _other_player_ships_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,							STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,  RESIZE_RIGHT,    14,    11,   247,     0,    13, STR_9805_SHIPS,				STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{  WWT_STICKYBOX,     RESIZE_LR,    14,   248,   259,     0,    13, 0x0,                   STR_STICKY_BUTTON},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,     0,    80,    14,    25, SRT_SORT_BY,						STR_SORT_ORDER_TIP},
 
{      WWT_PANEL,   RESIZE_NONE,    14,    81,   232,    14,    25, 0x0,										STR_SORT_CRITERIA_TIP},
 
{   WWT_CLOSEBOX,   RESIZE_NONE,    14,   233,   243,    14,    25, STR_0225,							STR_SORT_CRITERIA_TIP},
 
{      WWT_PANEL,  RESIZE_RIGHT,    14,   244,   259,    14,    25, 0x0,										STR_NULL},
 
{     WWT_MATRIX,     RESIZE_RB,    14,     0,   248,    26,   169, 0x401,									STR_9823_SHIPS_CLICK_ON_SHIP_FOR},
 
{  WWT_SCROLLBAR,    RESIZE_LRB,    14,   249,   259,    26,   169, 0x0,										STR_0190_SCROLL_BAR_SCROLLS_LIST},
 
{      WWT_PANEL,    RESIZE_RTB,    14,   249,   248,   170,   181, 0x0,											STR_NULL},
 
{      WWT_PANEL,    RESIZE_RTB,    14,     0,   248,   170,   181, 0x0,											STR_NULL},
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,    14,   249,   259,   170,   181, 0x0,											STR_RESIZE_BUTTON},
 
{   WIDGETS_END},
 
};
 

	
 
static void PlayerShipsWndProc(Window *w, WindowEvent *e)
 
{
 
	int station = (int)w->window_number >> 16;
 
	int owner = w->window_number & 0xff;
 
	vehiclelist_d *vl = &WP(w, vehiclelist_d);
 

	
 
	switch(e->event) {
 
	case WE_PAINT: {
 
@@ -1049,24 +1049,27 @@ static void PlayerShipsWndProc(Window *w
 
					ShowShipDepotWindow(tile);
 
					ShowBuildShipWindow(tile);
 
					return;
 
				}
 

	
 
				tile = TILE_MASK(tile + 1);
 
			} while(tile != _last_built_ship_depot_tile);
 

	
 
			ShowBuildShipWindow(0);
 
		} break;
 

	
 
		case 10: {
 
			if (!IsWindowOfPrototype(w, _player_ships_widgets))
 
				break;
 

	
 
			ShowReplaceVehicleWindow(VEH_Ship);
 
			break;
 
		}
 
	}
 
	}	break;
 

	
 
	case WE_DROPDOWN_SELECT: /* we have selected a dropdown item in the list */
 
		if (vl->sort_type != e->dropdown.index) {
 
			// value has changed -> resort
 
			vl->flags |= VL_RESORT;
 
			vl->sort_type = e->dropdown.index;
 

	
train_gui.c
Show inline comments
 
@@ -1225,25 +1225,25 @@ static const Widget _player_trains_widge
 
};
 

	
 
static const Widget _other_player_trains_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,							STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,  RESIZE_RIGHT,    14,    11,   312,     0,    13, STR_881B_TRAINS,				STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{  WWT_STICKYBOX,     RESIZE_LR,    14,   313,   324,     0,    13, 0x0,										STR_STICKY_BUTTON},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,     0,    80,    14,    25, SRT_SORT_BY,						STR_SORT_ORDER_TIP},
 
{      WWT_PANEL,   RESIZE_NONE,    14,    81,   232,    14,    25, 0x0,										STR_SORT_CRITERIA_TIP},
 
{   WWT_CLOSEBOX,   RESIZE_NONE,    14,   233,   243,    14,    25, STR_0225,							STR_SORT_CRITERIA_TIP},
 
{      WWT_PANEL,  RESIZE_RIGHT,    14,   244,   324,    14,    25, 0x0,										STR_NULL},
 
{     WWT_MATRIX,     RESIZE_RB,    14,     0,   313,    26,   207, 0x701,									STR_883D_TRAINS_CLICK_ON_TRAIN_FOR},
 
{  WWT_SCROLLBAR,    RESIZE_LRB,    14,   314,   324,    26,   207, 0x0,										STR_0190_SCROLL_BAR_SCROLLS_LIST},
 
{      WWT_PANEL,     RESIZE_TB,    14,     0,   312,   208,   219, 0x0,										STR_NULL},
 
{      WWT_PANEL,    RESIZE_RTB,    14,     0,   313,   208,   219, 0x0,										STR_NULL},
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,    14,   314,   324,   208,   219, 0x0,										STR_RESIZE_BUTTON},
 
{   WIDGETS_END},
 
};
 

	
 
static void PlayerTrainsWndProc(Window *w, WindowEvent *e)
 
{
 
	int station = (int)w->window_number >> 16;
 
	int owner = w->window_number & 0xff;
 
	vehiclelist_d *vl = &WP(w, vehiclelist_d);
 

	
 
	switch(e->event) {
 
	case WE_PAINT: {
 
@@ -1359,24 +1359,27 @@ static void PlayerTrainsWndProc(Window *
 
				if (_map_owner[tile] == _local_player && IsTrainDepotTile(tile)) {
 
					ShowTrainDepotWindow(tile);
 
					ShowBuildTrainWindow(tile);
 
					return;
 
				}
 

	
 
				tile = TILE_MASK(tile + 1);
 
			} while(tile != _last_built_train_depot_tile);
 

	
 
			ShowBuildTrainWindow(0);
 
		} break;
 
		case 10: {
 
			if (!IsWindowOfPrototype(w, _player_trains_widgets))
 
				break;
 

	
 
			ShowReplaceVehicleWindow(VEH_Train);
 
			break;
 
 		}
 

	
 
		}
 
	}	break;
 

	
 
	case WE_DROPDOWN_SELECT: /* we have selected a dropdown item in the list */
 
		if (vl->sort_type != e->dropdown.index) {
 
			// value has changed -> resort
 
			vl->flags |= VL_RESORT;
 
			vl->sort_type = e->dropdown.index;
0 comments (0 inline, 0 general)