group_gui.cpp File Reference

GUI for the group window. More...

#include "stdafx.h"
#include "openttd.h"
#include "window_gui.h"
#include "textbuf_gui.h"
#include "command_func.h"
#include "vehicle_gui.h"
#include "vehicle_gui_base.h"
#include "vehicle_base.h"
#include "group.h"
#include "strings_func.h"
#include "window_func.h"
#include "vehicle_func.h"
#include "autoreplace_gui.h"
#include "gfx_func.h"
#include "company_func.h"
#include "widgets/dropdown_type.h"
#include "widgets/dropdown_func.h"
#include "tilehighlight_func.h"
#include "table/strings.h"
#include "table/sprites.h"

Go to the source code of this file.

Data Structures

class  VehicleGroupWindow

Typedefs

typedef GUIList< const Group * > GUIGroupList

Enumerations

enum  GroupListWidgets {
  GRP_WIDGET_CLOSEBOX = 0, GRP_WIDGET_CAPTION, GRP_WIDGET_STICKY, GRP_WIDGET_SORT_BY_ORDER,
  GRP_WIDGET_SORT_BY_DROPDOWN, GRP_WIDGET_EMPTY_TOP_RIGHT, GRP_WIDGET_LIST_VEHICLE, GRP_WIDGET_LIST_VEHICLE_SCROLLBAR,
  GRP_WIDGET_EMPTY2, GRP_WIDGET_AVAILABLE_VEHICLES, GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN, GRP_WIDGET_STOP_ALL,
  GRP_WIDGET_START_ALL, GRP_WIDGET_EMPTY_BOTTOM_RIGHT, GRP_WIDGET_RESIZE, GRP_WIDGET_EMPTY_TOP_LEFT,
  GRP_WIDGET_ALL_VEHICLES, GRP_WIDGET_DEFAULT_VEHICLES, GRP_WIDGET_LIST_GROUP, GRP_WIDGET_LIST_GROUP_SCROLLBAR,
  GRP_WIDGET_CREATE_GROUP, GRP_WIDGET_DELETE_GROUP, GRP_WIDGET_RENAME_GROUP, GRP_WIDGET_EMPTY1,
  GRP_WIDGET_REPLACE_PROTECTION
}
enum  GroupActionListFunction {
  GALF_REPLACE, GALF_SERVICE, GALF_DEPOT, GALF_ADD_SHARED,
  GALF_REMOVE_ALL
}

Functions

static void ShowGroupActionDropdown (Window *w, GroupID gid)
 Update/redraw the group action dropdown.
void ShowCompanyGroup (CompanyID company, VehicleType vehicle_type)
void DeleteGroupHighlightOfVehicle (const Vehicle *v)
 Removes the highlight of a vehicle in a group window.

Variables

static const Widget _group_widgets []
static WindowDesc _group_desc (WDP_AUTO, WDP_AUTO, 460, 194, 460, 246, WC_INVALID, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_UNCLICK_BUTTONS|WDF_STICKY_BUTTON|WDF_RESIZABLE, _group_widgets)


Detailed Description

GUI for the group window.

Definition in file group_gui.cpp.


Function Documentation

void DeleteGroupHighlightOfVehicle ( const Vehicle *  v  ) 

Removes the highlight of a vehicle in a group window.

Parameters:
*v Vehicle to remove all highlights from

Definition at line 723 of file group_gui.cpp.

References FindWindowById(), and GetWindowClassForVehicleType().

static void ShowGroupActionDropdown ( Window w,
GroupID  gid 
) [static]

Update/redraw the group action dropdown.

Parameters:
w the window the dropdown belongs to
gid the currently selected group in the window

Definition at line 71 of file group_gui.cpp.

References ShowDropDownList().


Variable Documentation

const Widget _group_widgets[] [static]

Initial value:

 {
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,             STR_018B_CLOSE_WINDOW},             
{    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_GREY,    11,   447,     0,    13, 0x0,                  STR_018C_WINDOW_TITLE_DRAG_THIS},   
{  WWT_STICKYBOX,     RESIZE_LR,  COLOUR_GREY,   448,   459,     0,    13, 0x0,                  STR_STICKY_BUTTON},                 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   200,   280,    14,    25, STR_SORT_BY,          STR_SORT_ORDER_TIP},                
{   WWT_DROPDOWN,   RESIZE_NONE,  COLOUR_GREY,   281,   447,    14,    25, 0x0,                  STR_SORT_CRITERIA_TIP},             
{      WWT_PANEL,  RESIZE_RIGHT,  COLOUR_GREY,   448,   459,    14,    25, 0x0,                  STR_NULL},                          
{     WWT_MATRIX,     RESIZE_RB,  COLOUR_GREY,   200,   447,    26,   181, 0x701,                STR_NULL},                          
{  WWT_SCROLLBAR,    RESIZE_LRB,  COLOUR_GREY,   448,   459,    26,   181, 0x0,                  STR_0190_SCROLL_BAR_SCROLLS_LIST},  
{      WWT_PANEL,     RESIZE_TB,  COLOUR_GREY,   188,   199,   169,   193, 0x0,                  STR_NULL},                          
{ WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_GREY,   200,   305,   182,   193, 0x0,                  STR_AVAILABLE_ENGINES_TIP},         
{   WWT_DROPDOWN,     RESIZE_TB,  COLOUR_GREY,   306,   423,   182,   193, STR_MANAGE_LIST,      STR_MANAGE_LIST_TIP},               
{ WWT_PUSHIMGBTN,     RESIZE_TB,  COLOUR_GREY,   424,   435,   182,   193, SPR_FLAG_VEH_STOPPED, STR_MASS_STOP_LIST_TIP},            
{ WWT_PUSHIMGBTN,     RESIZE_TB,  COLOUR_GREY,   436,   447,   182,   193, SPR_FLAG_VEH_RUNNING, STR_MASS_START_LIST_TIP},           
{      WWT_PANEL,    RESIZE_RTB,  COLOUR_GREY,   448,   447,   182,   193, 0x0,                  STR_NULL},                          
{  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_GREY,   448,   459,   182,   193, 0x0,                  STR_RESIZE_BUTTON},                 

{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   199,    14,    25, 0x0,                  STR_NULL},                          
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   199,    26,    38, 0x0,                  STR_NULL},                          
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   199,    39,    51, 0x0,                  STR_NULL},                          
{     WWT_MATRIX, RESIZE_BOTTOM,  COLOUR_GREY,     0,   187,    52,   168, 0x701,                STR_GROUPS_CLICK_ON_GROUP_FOR_TIP}, 
{ WWT_SCROLL2BAR, RESIZE_BOTTOM,  COLOUR_GREY,   188,   199,    52,   168, 0x0,                  STR_0190_SCROLL_BAR_SCROLLS_LIST},  
{ WWT_PUSHIMGBTN,     RESIZE_TB,  COLOUR_GREY,     0,    23,   169,   193, 0x0,                  STR_GROUP_CREATE_TIP},              
{ WWT_PUSHIMGBTN,     RESIZE_TB,  COLOUR_GREY,    24,    47,   169,   193, 0x0,                  STR_GROUP_DELETE_TIP},              
{ WWT_PUSHIMGBTN,     RESIZE_TB,  COLOUR_GREY,    48,    71,   169,   193, 0x0,                  STR_GROUP_RENAME_TIP},              
{      WWT_PANEL,     RESIZE_TB,  COLOUR_GREY,    72,   163,   169,   193, 0x0,                  STR_NULL},                          
{ WWT_PUSHIMGBTN,     RESIZE_TB,  COLOUR_GREY,   164,   187,   169,   193, 0x0,                  STR_GROUP_REPLACE_PROTECTION_TIP},  
{   WIDGETS_END},
}

Definition at line 88 of file group_gui.cpp.


Generated on Mon May 11 15:48:11 2009 for OpenTTD by  doxygen 1.5.6