@ -314,7 +314,7 @@ protected:
this - > last_station = NULL ;
/* Set the modified widget dirty */
this - > SetWidgetDirty ( SLW _LIST) ;
this - > SetWidgetDirty ( WID_ SL_LIST) ;
}
public :
@ -327,23 +327,23 @@ public:
this - > SortStationsList ( ) ;
this - > CreateNestedTree ( desc ) ;
this - > vscroll = this - > GetScrollbar ( SLW _SCROLLBAR) ;
this - > vscroll = this - > GetScrollbar ( WID_ SL_SCROLLBAR) ;
this - > FinishInitNested ( desc , window_number ) ;
this - > owner = ( Owner ) this - > window_number ;
CargoID cid ;
FOR_EACH_SET_CARGO_ID ( cid , this - > cargo_filter ) {
if ( CargoSpec : : Get ( cid ) - > IsValid ( ) ) this - > LowerWidget ( SLW _CARGOSTART + cid ) ;
if ( CargoSpec : : Get ( cid ) - > IsValid ( ) ) this - > LowerWidget ( WID_ SL_CARGOSTART + cid ) ;
}
if ( this - > cargo_filter = = this - > cargo_filter_max ) this - > cargo_filter = _cargo_mask ;
for ( uint i = 0 ; i < 5 ; i + + ) {
if ( HasBit ( this - > facilities , i ) ) this - > LowerWidget ( i + SLW _TRAIN) ;
if ( HasBit ( this - > facilities , i ) ) this - > LowerWidget ( i + WID_ SL_TRAIN) ;
}
this - > SetWidgetLoweredState ( SLW _NOCARGOWAITING, this - > include_empty ) ;
this - > SetWidgetLoweredState ( WID_ SL_NOCARGOWAITING, this - > include_empty ) ;
this - > GetWidget < NWidgetCore > ( SLW _SORTDROPBTN) - > widget_data = this - > sorter_names [ this - > stations . SortType ( ) ] ;
this - > GetWidget < NWidgetCore > ( WID_ SL_SORTDROPBTN) - > widget_data = this - > sorter_names [ this - > stations . SortType ( ) ] ;
}
~ CompanyStationsWindow ( )
@ -354,7 +354,7 @@ public:
virtual void UpdateWidgetSize ( int widget , Dimension * size , const Dimension & padding , Dimension * fill , Dimension * resize )
{
switch ( widget ) {
case SLW _SORTBY: {
case WID_ SL_SORTBY: {
Dimension d = GetStringBoundingBox ( this - > GetWidget < NWidgetCore > ( widget ) - > widget_data ) ;
d . width + = padding . width + WD_SORTBUTTON_ARROW_WIDTH * 2 ; // Doubled since the string is centred and it also looks better.
d . height + = padding . height ;
@ -362,7 +362,7 @@ public:
break ;
}
case SLW _SORTDROPBTN: {
case WID_ SL_SORTDROPBTN: {
Dimension d = { 0 , 0 } ;
for ( int i = 0 ; this - > sorter_names [ i ] ! = INVALID_STRING_ID ; i + + ) {
d = maxdim ( d , GetStringBoundingBox ( this - > sorter_names [ i ] ) ) ;
@ -373,23 +373,23 @@ public:
break ;
}
case SLW _LIST:
case WID_ SL_LIST:
resize - > height = FONT_HEIGHT_NORMAL ;
size - > height = WD_FRAMERECT_TOP + 5 * resize - > height + WD_FRAMERECT_BOTTOM ;
break ;
case SLW _TRAIN:
case SLW _TRUCK:
case SLW _BUS:
case SLW _AIRPLANE:
case SLW _SHIP:
case WID_ SL_TRAIN:
case WID_ SL_TRUCK:
case WID_ SL_BUS:
case WID_ SL_AIRPLANE:
case WID_ SL_SHIP:
size - > height = max < uint > ( FONT_HEIGHT_SMALL , 10 ) + padding . height ;
break ;
case SLW _CARGOALL:
case SLW _FACILALL:
case SLW _NOCARGOWAITING: {
Dimension d = GetStringBoundingBox ( widget = = SLW _NOCARGOWAITING ? STR_ABBREV_NONE : STR_ABBREV_ALL ) ;
case WID_ SL_CARGOALL:
case WID_ SL_FACILALL:
case WID_ SL_NOCARGOWAITING: {
Dimension d = GetStringBoundingBox ( widget = = WID_ SL_NOCARGOWAITING ? STR_ABBREV_NONE : STR_ABBREV_ALL ) ;
d . width + = padding . width + 2 ;
d . height + = padding . height ;
* size = maxdim ( * size , d ) ;
@ -397,8 +397,8 @@ public:
}
default :
if ( widget > = SLW _CARGOSTART) {
const CargoSpec * cs = CargoSpec : : Get ( widget - SLW _CARGOSTART) ;
if ( widget > = WID_ SL_CARGOSTART) {
const CargoSpec * cs = CargoSpec : : Get ( widget - WID_ SL_CARGOSTART) ;
if ( cs - > IsValid ( ) ) {
Dimension d = GetStringBoundingBox ( cs - > abbrev ) ;
d . width + = padding . width + 2 ;
@ -421,12 +421,12 @@ public:
virtual void DrawWidget ( const Rect & r , int widget ) const
{
switch ( widget ) {
case SLW _SORTBY:
case WID_ SL_SORTBY:
/* draw arrow pointing up/down for ascending/descending sorting */
this - > DrawSortButtonState ( SLW _SORTBY, this - > stations . IsDescSortOrder ( ) ? SBS_DOWN : SBS_UP ) ;
this - > DrawSortButtonState ( WID_ SL_SORTBY, this - > stations . IsDescSortOrder ( ) ? SBS_DOWN : SBS_UP ) ;
break ;
case SLW _LIST: {
case WID_ SL_LIST: {
bool rtl = _current_text_dir = = TD_RTL ;
int max = min ( this - > vscroll - > GetPosition ( ) + this - > vscroll - > GetCapacity ( ) , this - > stations . Length ( ) ) ;
int y = r . top + WD_FRAMERECT_TOP ;
@ -471,27 +471,27 @@ public:
break ;
}
case SLW _NOCARGOWAITING: {
case WID_ SL_NOCARGOWAITING: {
int cg_ofst = this - > IsWidgetLowered ( widget ) ? 2 : 1 ;
DrawString ( r . left + cg_ofst , r . right + cg_ofst , r . top + cg_ofst , STR_ABBREV_NONE , TC_BLACK , SA_HOR_CENTER ) ;
break ;
}
case SLW _CARGOALL: {
case WID_ SL_CARGOALL: {
int cg_ofst = this - > IsWidgetLowered ( widget ) ? 2 : 1 ;
DrawString ( r . left + cg_ofst , r . right + cg_ofst , r . top + cg_ofst , STR_ABBREV_ALL , TC_BLACK , SA_HOR_CENTER ) ;
break ;
}
case SLW _FACILALL: {
case WID_ SL_FACILALL: {
int cg_ofst = this - > IsWidgetLowered ( widget ) ? 2 : 1 ;
DrawString ( r . left + cg_ofst , r . right + cg_ofst , r . top + cg_ofst , STR_ABBREV_ALL , TC_BLACK ) ;
break ;
}
default :
if ( widget > = SLW _CARGOSTART) {
const CargoSpec * cs = CargoSpec : : Get ( widget - SLW _CARGOSTART) ;
if ( widget > = WID_ SL_CARGOSTART) {
const CargoSpec * cs = CargoSpec : : Get ( widget - WID_ SL_CARGOSTART) ;
if ( cs - > IsValid ( ) ) {
int cg_ofst = HasBit ( this - > cargo_filter , cs - > Index ( ) ) ? 2 : 1 ;
GfxFillRect ( r . left + cg_ofst , r . top + cg_ofst , r . right - 2 + cg_ofst , r . bottom - 2 + cg_ofst , cs - > rating_colour ) ;
@ -504,7 +504,7 @@ public:
virtual void SetStringParameters ( int widget ) const
{
if ( widget = = SLW _CAPTION) {
if ( widget = = WID_ SL_CAPTION) {
SetDParam ( 0 , this - > window_number ) ;
SetDParam ( 1 , this - > vscroll - > GetCount ( ) ) ;
}
@ -513,8 +513,8 @@ public:
virtual void OnClick ( Point pt , int widget , int click_count )
{
switch ( widget ) {
case SLW _LIST: {
uint id_v = this - > vscroll - > GetScrolledRowFromWidget ( pt . y , this , SLW _LIST, 0 , FONT_HEIGHT_NORMAL ) ;
case WID_ SL_LIST: {
uint id_v = this - > vscroll - > GetScrolledRowFromWidget ( pt . y , this , WID_ SL_LIST, 0 , FONT_HEIGHT_NORMAL ) ;
if ( id_v > = this - > stations . Length ( ) ) return ; // click out of list bound
const Station * st = this - > stations [ id_v ] ;
@ -529,28 +529,28 @@ public:
break ;
}
case SLW _TRAIN:
case SLW _TRUCK:
case SLW _BUS:
case SLW _AIRPLANE:
case SLW _SHIP:
case WID_ SL_TRAIN:
case WID_ SL_TRUCK:
case WID_ SL_BUS:
case WID_ SL_AIRPLANE:
case WID_ SL_SHIP:
if ( _ctrl_pressed ) {
ToggleBit ( this - > facilities , widget - SLW _TRAIN) ;
ToggleBit ( this - > facilities , widget - WID_ SL_TRAIN) ;
this - > ToggleWidgetLoweredState ( widget ) ;
} else {
uint i ;
FOR_EACH_SET_BIT ( i , this - > facilities ) {
this - > RaiseWidget ( i + SLW _TRAIN) ;
this - > RaiseWidget ( i + WID_ SL_TRAIN) ;
}
this - > facilities = 1 < < ( widget - SLW _TRAIN) ;
this - > facilities = 1 < < ( widget - WID_ SL_TRAIN) ;
this - > LowerWidget ( widget ) ;
}
this - > stations . ForceRebuild ( ) ;
this - > SetDirty ( ) ;
break ;
case SLW _FACILALL:
for ( uint i = SLW _TRAIN; i < = SLW _SHIP; i + + ) {
case WID_ SL_FACILALL:
for ( uint i = WID_ SL_TRAIN; i < = WID_ SL_SHIP; i + + ) {
this - > LowerWidget ( i ) ;
}
@ -559,12 +559,12 @@ public:
this - > SetDirty ( ) ;
break ;
case SLW _CARGOALL: {
case WID_ SL_CARGOALL: {
for ( uint i = 0 ; i < NUM_CARGO ; i + + ) {
const CargoSpec * cs = CargoSpec : : Get ( i ) ;
if ( cs - > IsValid ( ) ) this - > LowerWidget ( SLW _CARGOSTART + i ) ;
if ( cs - > IsValid ( ) ) this - > LowerWidget ( WID_ SL_CARGOSTART + i ) ;
}
this - > LowerWidget ( SLW _NOCARGOWAITING) ;
this - > LowerWidget ( WID_ SL_NOCARGOWAITING) ;
this - > cargo_filter = _cargo_mask ;
this - > include_empty = true ;
@ -573,40 +573,40 @@ public:
break ;
}
case SLW _SORTBY: // flip sorting method asc/desc
case WID_ SL_SORTBY: // flip sorting method asc/desc
this - > stations . ToggleSortOrder ( ) ;
this - > SetTimeout ( ) ;
this - > LowerWidget ( SLW _SORTBY) ;
this - > LowerWidget ( WID_ SL_SORTBY) ;
this - > SetDirty ( ) ;
break ;
case SLW _SORTDROPBTN: // select sorting criteria dropdown menu
ShowDropDownMenu ( this , this - > sorter_names , this - > stations . SortType ( ) , SLW _SORTDROPBTN, 0 , 0 ) ;
case WID_ SL_SORTDROPBTN: // select sorting criteria dropdown menu
ShowDropDownMenu ( this , this - > sorter_names , this - > stations . SortType ( ) , WID_ SL_SORTDROPBTN, 0 , 0 ) ;
break ;
case SLW _NOCARGOWAITING:
case WID_ SL_NOCARGOWAITING:
if ( _ctrl_pressed ) {
this - > include_empty = ! this - > include_empty ;
this - > ToggleWidgetLoweredState ( SLW _NOCARGOWAITING) ;
this - > ToggleWidgetLoweredState ( WID_ SL_NOCARGOWAITING) ;
} else {
for ( uint i = 0 ; i < NUM_CARGO ; i + + ) {
const CargoSpec * cs = CargoSpec : : Get ( i ) ;
if ( cs - > IsValid ( ) ) this - > RaiseWidget ( SLW _CARGOSTART + i ) ;
if ( cs - > IsValid ( ) ) this - > RaiseWidget ( WID_ SL_CARGOSTART + i ) ;
}
this - > cargo_filter = 0 ;
this - > include_empty = true ;
this - > LowerWidget ( SLW _NOCARGOWAITING) ;
this - > LowerWidget ( WID_ SL_NOCARGOWAITING) ;
}
this - > stations . ForceRebuild ( ) ;
this - > SetDirty ( ) ;
break ;
default :
if ( widget > = SLW _CARGOSTART) { // change cargo_filter
if ( widget > = WID_ SL_CARGOSTART) { // change cargo_filter
/* Determine the selected cargo type */
const CargoSpec * cs = CargoSpec : : Get ( widget - SLW _CARGOSTART) ;
const CargoSpec * cs = CargoSpec : : Get ( widget - WID_ SL_CARGOSTART) ;
if ( ! cs - > IsValid ( ) ) break ;
if ( _ctrl_pressed ) {
@ -615,9 +615,9 @@ public:
} else {
for ( uint i = 0 ; i < NUM_CARGO ; i + + ) {
const CargoSpec * cs = CargoSpec : : Get ( i ) ;
if ( cs - > IsValid ( ) ) this - > RaiseWidget ( SLW _CARGOSTART + i ) ;
if ( cs - > IsValid ( ) ) this - > RaiseWidget ( WID_ SL_CARGOSTART + i ) ;
}
this - > RaiseWidget ( SLW _NOCARGOWAITING) ;
this - > RaiseWidget ( WID_ SL_NOCARGOWAITING) ;
this - > cargo_filter = 0 ;
this - > include_empty = false ;
@ -638,7 +638,7 @@ public:
this - > stations . SetSortType ( index ) ;
/* Display the current sort variant */
this - > GetWidget < NWidgetCore > ( SLW _SORTDROPBTN) - > widget_data = this - > sorter_names [ this - > stations . SortType ( ) ] ;
this - > GetWidget < NWidgetCore > ( WID_ SL_SORTDROPBTN) - > widget_data = this - > sorter_names [ this - > stations . SortType ( ) ] ;
this - > SetDirty ( ) ;
}
@ -655,13 +655,13 @@ public:
virtual void OnTimeout ( )
{
this - > RaiseWidget ( SLW _SORTBY) ;
this - > RaiseWidget ( WID_ SL_SORTBY) ;
this - > SetDirty ( ) ;
}
virtual void OnResize ( )
{
this - > vscroll - > SetCapacityFromWidget ( this , SLW _LIST, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM ) ;
this - > vscroll - > SetCapacityFromWidget ( this , WID_ SL_LIST, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM ) ;
}
/**
@ -707,7 +707,7 @@ const StringID CompanyStationsWindow::sorter_names[] = {
} ;
/**
* Make a horizontal row of cargo buttons , starting at widget # SLW _CARGOSTART.
* Make a horizontal row of cargo buttons , starting at widget # WID_ SL_CARGOSTART.
* @ param biggest_index Pointer to store biggest used widget number of the buttons .
* @ return Horizontal row .
*/
@ -718,53 +718,53 @@ static NWidgetBase *CargoWidgets(int *biggest_index)
for ( uint i = 0 ; i < NUM_CARGO ; i + + ) {
const CargoSpec * cs = CargoSpec : : Get ( i ) ;
if ( cs - > IsValid ( ) ) {
NWidgetBackground * panel = new NWidgetBackground ( WWT_PANEL , COLOUR_GREY , SLW _CARGOSTART + i ) ;
NWidgetBackground * panel = new NWidgetBackground ( WWT_PANEL , COLOUR_GREY , WID_ SL_CARGOSTART + i ) ;
panel - > SetMinimalSize ( 14 , 11 ) ;
panel - > SetResize ( 0 , 0 ) ;
panel - > SetFill ( 0 , 1 ) ;
panel - > SetDataTip ( 0 , STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE ) ;
container - > Add ( panel ) ;
} else {
NWidgetLeaf * nwi = new NWidgetLeaf ( WWT_EMPTY , COLOUR_GREY , SLW _CARGOSTART + i , 0x0 , STR_NULL ) ;
NWidgetLeaf * nwi = new NWidgetLeaf ( WWT_EMPTY , COLOUR_GREY , WID_ SL_CARGOSTART + i , 0x0 , STR_NULL ) ;
nwi - > SetMinimalSize ( 0 , 11 ) ;
nwi - > SetResize ( 0 , 0 ) ;
nwi - > SetFill ( 0 , 1 ) ;
container - > Add ( nwi ) ;
}
}
* biggest_index = SLW _CARGOSTART + NUM_CARGO ;
* biggest_index = WID_ SL_CARGOSTART + NUM_CARGO ;
return container ;
}
static const NWidgetPart _nested_company_stations_widgets [ ] = {
NWidget ( NWID_HORIZONTAL ) ,
NWidget ( WWT_CLOSEBOX , COLOUR_GREY ) ,
NWidget ( WWT_CAPTION , COLOUR_GREY , SLW _CAPTION) , SetDataTip ( STR_STATION_LIST_CAPTION , STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS ) ,
NWidget ( WWT_CAPTION , COLOUR_GREY , WID_ SL_CAPTION) , SetDataTip ( STR_STATION_LIST_CAPTION , STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS ) ,
NWidget ( WWT_SHADEBOX , COLOUR_GREY ) ,
NWidget ( WWT_STICKYBOX , COLOUR_GREY ) ,
EndContainer ( ) ,
NWidget ( NWID_HORIZONTAL ) ,
NWidget ( WWT_TEXTBTN , COLOUR_GREY , SLW _TRAIN) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( STR_TRAIN , STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_TEXTBTN , COLOUR_GREY , SLW _TRUCK) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( STR_LORRY , STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_TEXTBTN , COLOUR_GREY , SLW _BUS) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( STR_BUS , STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_TEXTBTN , COLOUR_GREY , SLW _SHIP) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( STR_SHIP , STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_TEXTBTN , COLOUR_GREY , SLW _AIRPLANE) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( STR_PLANE , STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_PUSHBTN , COLOUR_GREY , SLW _FACILALL) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( 0x0 , STR_STATION_LIST_SELECT_ALL_FACILITIES ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_TEXTBTN , COLOUR_GREY , WID_ SL_TRAIN) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( STR_TRAIN , STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_TEXTBTN , COLOUR_GREY , WID_ SL_TRUCK) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( STR_LORRY , STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_TEXTBTN , COLOUR_GREY , WID_ SL_BUS) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( STR_BUS , STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_TEXTBTN , COLOUR_GREY , WID_ SL_SHIP) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( STR_SHIP , STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_TEXTBTN , COLOUR_GREY , WID_ SL_AIRPLANE) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( STR_PLANE , STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_PUSHBTN , COLOUR_GREY , WID_ SL_FACILALL) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( 0x0 , STR_STATION_LIST_SELECT_ALL_FACILITIES ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_PANEL , COLOUR_GREY ) , SetMinimalSize ( 5 , 11 ) , SetFill ( 0 , 1 ) , EndContainer ( ) ,
NWidgetFunction ( CargoWidgets ) ,
NWidget ( WWT_PANEL , COLOUR_GREY , SLW _NOCARGOWAITING) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( 0x0 , STR_STATION_LIST_NO_WAITING_CARGO ) , SetFill ( 0 , 1 ) , EndContainer ( ) ,
NWidget ( WWT_PUSHBTN , COLOUR_GREY , SLW _CARGOALL) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( 0x0 , STR_STATION_LIST_SELECT_ALL_TYPES ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_PANEL , COLOUR_GREY , WID_ SL_NOCARGOWAITING) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( 0x0 , STR_STATION_LIST_NO_WAITING_CARGO ) , SetFill ( 0 , 1 ) , EndContainer ( ) ,
NWidget ( WWT_PUSHBTN , COLOUR_GREY , WID_ SL_CARGOALL) , SetMinimalSize ( 14 , 11 ) , SetDataTip ( 0x0 , STR_STATION_LIST_SELECT_ALL_TYPES ) , SetFill ( 0 , 1 ) ,
NWidget ( WWT_PANEL , COLOUR_GREY ) , SetDataTip ( 0x0 , STR_NULL ) , SetResize ( 1 , 0 ) , SetFill ( 1 , 1 ) , EndContainer ( ) ,
EndContainer ( ) ,
NWidget ( NWID_HORIZONTAL ) ,
NWidget ( WWT_TEXTBTN , COLOUR_GREY , SLW _SORTBY) , SetMinimalSize ( 81 , 12 ) , SetDataTip ( STR_BUTTON_SORT_BY , STR_TOOLTIP_SORT_ORDER ) ,
NWidget ( WWT_DROPDOWN , COLOUR_GREY , SLW _SORTDROPBTN) , SetMinimalSize ( 163 , 12 ) , SetDataTip ( STR_SORT_BY_NAME , STR_TOOLTIP_SORT_CRITERIA ) , // widget_data gets overwritten.
NWidget ( WWT_TEXTBTN , COLOUR_GREY , WID_ SL_SORTBY) , SetMinimalSize ( 81 , 12 ) , SetDataTip ( STR_BUTTON_SORT_BY , STR_TOOLTIP_SORT_ORDER ) ,
NWidget ( WWT_DROPDOWN , COLOUR_GREY , WID_ SL_SORTDROPBTN) , SetMinimalSize ( 163 , 12 ) , SetDataTip ( STR_SORT_BY_NAME , STR_TOOLTIP_SORT_CRITERIA ) , // widget_data gets overwritten.
NWidget ( WWT_PANEL , COLOUR_GREY ) , SetDataTip ( 0x0 , STR_NULL ) , SetResize ( 1 , 0 ) , SetFill ( 1 , 1 ) , EndContainer ( ) ,
EndContainer ( ) ,
NWidget ( NWID_HORIZONTAL ) ,
NWidget ( WWT_PANEL , COLOUR_GREY , SLW _LIST) , SetMinimalSize ( 346 , 125 ) , SetResize ( 1 , 10 ) , SetDataTip ( 0x0 , STR_STATION_LIST_TOOLTIP ) , SetScrollbar ( SLW _SCROLLBAR) , EndContainer ( ) ,
NWidget ( WWT_PANEL , COLOUR_GREY , WID_ SL_LIST) , SetMinimalSize ( 346 , 125 ) , SetResize ( 1 , 10 ) , SetDataTip ( 0x0 , STR_STATION_LIST_TOOLTIP ) , SetScrollbar ( WID_ SL_SCROLLBAR) , EndContainer ( ) ,
NWidget ( NWID_VERTICAL ) ,
NWidget ( NWID_VSCROLLBAR , COLOUR_GREY , SLW _SCROLLBAR) ,
NWidget ( NWID_VSCROLLBAR , COLOUR_GREY , WID_ SL_SCROLLBAR) ,
NWidget ( WWT_RESIZEBOX , COLOUR_GREY ) ,
EndContainer ( ) ,
EndContainer ( ) ,
@ -792,26 +792,26 @@ void ShowCompanyStations(CompanyID company)
static const NWidgetPart _nested_station_view_widgets [ ] = {
NWidget ( NWID_HORIZONTAL ) ,
NWidget ( WWT_CLOSEBOX , COLOUR_GREY ) ,
NWidget ( WWT_CAPTION , COLOUR_GREY , SVW _CAPTION) , SetDataTip ( STR_STATION_VIEW_CAPTION , STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS ) ,
NWidget ( WWT_CAPTION , COLOUR_GREY , WID_ SV_CAPTION) , SetDataTip ( STR_STATION_VIEW_CAPTION , STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS ) ,
NWidget ( WWT_SHADEBOX , COLOUR_GREY ) ,
NWidget ( WWT_STICKYBOX , COLOUR_GREY ) ,
EndContainer ( ) ,
NWidget ( NWID_HORIZONTAL ) ,
NWidget ( WWT_PANEL , COLOUR_GREY , SVW _WAITING) , SetMinimalSize ( 237 , 52 ) , SetResize ( 1 , 10 ) , SetScrollbar ( SVW _SCROLLBAR) , EndContainer ( ) ,
NWidget ( NWID_VSCROLLBAR , COLOUR_GREY , SVW _SCROLLBAR) ,
NWidget ( WWT_PANEL , COLOUR_GREY , WID_ SV_WAITING) , SetMinimalSize ( 237 , 52 ) , SetResize ( 1 , 10 ) , SetScrollbar ( WID_ SV_SCROLLBAR) , EndContainer ( ) ,
NWidget ( NWID_VSCROLLBAR , COLOUR_GREY , WID_ SV_SCROLLBAR) ,
EndContainer ( ) ,
NWidget ( WWT_PANEL , COLOUR_GREY , SVW _ACCEPTLIST) , SetMinimalSize ( 249 , 32 ) , SetResize ( 1 , 0 ) , EndContainer ( ) ,
NWidget ( WWT_PANEL , COLOUR_GREY , WID_ SV_ACCEPT_RATING_ LIST) , SetMinimalSize ( 249 , 32 ) , SetResize ( 1 , 0 ) , EndContainer ( ) ,
NWidget ( NWID_HORIZONTAL , NC_EQUALSIZE ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , SVW _LOCATION) , SetMinimalSize ( 60 , 12 ) , SetResize ( 1 , 0 ) , SetFill ( 1 , 1 ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , WID_ SV_LOCATION) , SetMinimalSize ( 60 , 12 ) , SetResize ( 1 , 0 ) , SetFill ( 1 , 1 ) ,
SetDataTip ( STR_BUTTON_LOCATION , STR_STATION_VIEW_CENTER_TOOLTIP ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , SVW _ACCEPTS) , SetMinimalSize ( 61 , 12 ) , SetResize ( 1 , 0 ) , SetFill ( 1 , 1 ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , WID_ SV_ACCEPTS_RATING S) , SetMinimalSize ( 61 , 12 ) , SetResize ( 1 , 0 ) , SetFill ( 1 , 1 ) ,
SetDataTip ( STR_STATION_VIEW_RATINGS_BUTTON , STR_STATION_VIEW_RATINGS_TOOLTIP ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , SVW _RENAME) , SetMinimalSize ( 60 , 12 ) , SetResize ( 1 , 0 ) , SetFill ( 1 , 1 ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , WID_ SV_RENAME) , SetMinimalSize ( 60 , 12 ) , SetResize ( 1 , 0 ) , SetFill ( 1 , 1 ) ,
SetDataTip ( STR_BUTTON_RENAME , STR_STATION_VIEW_RENAME_TOOLTIP ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , SVW _TRAINS) , SetMinimalSize ( 14 , 12 ) , SetFill ( 0 , 1 ) , SetDataTip ( STR_TRAIN , STR_STATION_VIEW_SCHEDULED_TRAINS_TOOLTIP ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , SVW _ROADVEHS) , SetMinimalSize ( 14 , 12 ) , SetFill ( 0 , 1 ) , SetDataTip ( STR_LORRY , STR_STATION_VIEW_SCHEDULED_ROAD_VEHICLES_TOOLTIP ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , SVW _SHIPS) , SetMinimalSize ( 14 , 12 ) , SetFill ( 0 , 1 ) , SetDataTip ( STR_SHIP , STR_STATION_VIEW_SCHEDULED_SHIPS_TOOLTIP ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , SVW _PLANES) , SetMinimalSize ( 14 , 12 ) , SetFill ( 0 , 1 ) , SetDataTip ( STR_PLANE , STR_STATION_VIEW_SCHEDULED_AIRCRAFT_TOOLTIP ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , WID_ SV_TRAINS) , SetMinimalSize ( 14 , 12 ) , SetFill ( 0 , 1 ) , SetDataTip ( STR_TRAIN , STR_STATION_VIEW_SCHEDULED_TRAINS_TOOLTIP ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , WID_ SV_ROADVEHS) , SetMinimalSize ( 14 , 12 ) , SetFill ( 0 , 1 ) , SetDataTip ( STR_LORRY , STR_STATION_VIEW_SCHEDULED_ROAD_VEHICLES_TOOLTIP ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , WID_ SV_SHIPS) , SetMinimalSize ( 14 , 12 ) , SetFill ( 0 , 1 ) , SetDataTip ( STR_SHIP , STR_STATION_VIEW_SCHEDULED_SHIPS_TOOLTIP ) ,
NWidget ( WWT_PUSHTXTBTN , COLOUR_GREY , WID_ SV_PLANES) , SetMinimalSize ( 14 , 12 ) , SetFill ( 0 , 1 ) , SetDataTip ( STR_PLANE , STR_STATION_VIEW_SCHEDULED_AIRCRAFT_TOOLTIP ) ,
NWidget ( WWT_RESIZEBOX , COLOUR_GREY ) ,
EndContainer ( ) ,
} ;
@ -865,7 +865,7 @@ struct StationViewWindow : public Window {
int accepts_lines ; ///< Number of lines in the accepted cargo view.
Scrollbar * vscroll ;
/** Height of the # SVW _ACCEPTLIST widget for different views. */
/** Height of the # WID_ SV_ACCEPT_RATING_ LIST widget for different views. */
enum AcceptListHeight {
ALH_RATING = 13 , ///< Height of the cargo ratings view.
ALH_ACCEPTS = 3 , ///< Height of the accepted cargo view.
@ -877,8 +877,8 @@ struct StationViewWindow : public Window {
this - > accepts_lines = ALH_ACCEPTS ;
this - > CreateNestedTree ( desc ) ;
this - > vscroll = this - > GetScrollbar ( SVW _SCROLLBAR) ;
/* Nested widget tree creation is done in two steps to ensure that this->GetWidget<NWidgetCore>( SVW _ACCEPTS) exists in UpdateWidgetSize(). */
this - > vscroll = this - > GetScrollbar ( WID_ SV_SCROLLBAR) ;
/* Nested widget tree creation is done in two steps to ensure that this->GetWidget<NWidgetCore>( WID_ SV_ACCEPTS_RATING S) exists in UpdateWidgetSize(). */
this - > FinishInitNested ( desc , window_number ) ;
Owner owner = Station : : Get ( window_number ) - > owner ;
@ -899,14 +899,14 @@ struct StationViewWindow : public Window {
virtual void UpdateWidgetSize ( int widget , Dimension * size , const Dimension & padding , Dimension * fill , Dimension * resize )
{
switch ( widget ) {
case SVW _WAITING:
case WID_ SV_WAITING:
resize - > height = FONT_HEIGHT_NORMAL ;
size - > height = WD_FRAMERECT_TOP + 5 * resize - > height + WD_FRAMERECT_BOTTOM ;
this - > expand_shrink_width = max ( GetStringBoundingBox ( " - " ) . width , GetStringBoundingBox ( " + " ) . width ) + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT ;
break ;
case SVW _ACCEPTLIST:
size - > height = WD_FRAMERECT_TOP + ( ( this - > GetWidget < NWidgetCore > ( SVW _ACCEPTS) - > widget_data = = STR_STATION_VIEW_RATINGS_BUTTON ) ? this - > accepts_lines : this - > rating_lines ) * FONT_HEIGHT_NORMAL + WD_FRAMERECT_BOTTOM ;
case WID_ SV_ACCEPT_RATING_ LIST:
size - > height = WD_FRAMERECT_TOP + ( ( this - > GetWidget < NWidgetCore > ( WID_ SV_ACCEPTS_RATING S) - > widget_data = = STR_STATION_VIEW_RATINGS_BUTTON ) ? this - > accepts_lines : this - > rating_lines ) * FONT_HEIGHT_NORMAL + WD_FRAMERECT_BOTTOM ;
break ;
}
}
@ -921,19 +921,19 @@ struct StationViewWindow : public Window {
/* disable some buttons */
const Station * st = Station : : Get ( this - > window_number ) ;
this - > SetWidgetDisabledState ( SVW _RENAME, st - > owner ! = _local_company ) ;
this - > SetWidgetDisabledState ( SVW _TRAINS, ! ( st - > facilities & FACIL_TRAIN ) ) ;
this - > SetWidgetDisabledState ( SVW _ROADVEHS, ! ( st - > facilities & FACIL_TRUCK_STOP ) & & ! ( st - > facilities & FACIL_BUS_STOP ) ) ;
this - > SetWidgetDisabledState ( SVW _SHIPS, ! ( st - > facilities & FACIL_DOCK ) ) ;
this - > SetWidgetDisabledState ( SVW _PLANES, ! ( st - > facilities & FACIL_AIRPORT ) ) ;
this - > SetWidgetDisabledState ( WID_ SV_RENAME, st - > owner ! = _local_company ) ;
this - > SetWidgetDisabledState ( WID_ SV_TRAINS, ! ( st - > facilities & FACIL_TRAIN ) ) ;
this - > SetWidgetDisabledState ( WID_ SV_ROADVEHS, ! ( st - > facilities & FACIL_TRUCK_STOP ) & & ! ( st - > facilities & FACIL_BUS_STOP ) ) ;
this - > SetWidgetDisabledState ( WID_ SV_SHIPS, ! ( st - > facilities & FACIL_DOCK ) ) ;
this - > SetWidgetDisabledState ( WID_ SV_PLANES, ! ( st - > facilities & FACIL_AIRPORT ) ) ;
this - > DrawWidgets ( ) ;
if ( ! this - > IsShaded ( ) ) {
/* Draw 'accepted cargo' or 'cargo ratings'. */
const NWidgetBase * wid = this - > GetWidget < NWidgetBase > ( SVW _ACCEPTLIST) ;
const NWidgetBase * wid = this - > GetWidget < NWidgetBase > ( WID_ SV_ACCEPT_RATING_ LIST) ;
const Rect r = { wid - > pos_x , wid - > pos_y , wid - > pos_x + wid - > current_x - 1 , wid - > pos_y + wid - > current_y - 1 } ;
if ( this - > GetWidget < NWidgetCore > ( SVW _ACCEPTS) - > widget_data = = STR_STATION_VIEW_RATINGS_BUTTON ) {
if ( this - > GetWidget < NWidgetCore > ( WID_ SV_ACCEPTS_RATING S) - > widget_data = = STR_STATION_VIEW_RATINGS_BUTTON ) {
int lines = this - > DrawAcceptedCargo ( r ) ;
if ( lines > this - > accepts_lines ) { // Resize the widget, and perform re-initialization of the window.
this - > accepts_lines = lines ;
@ -950,7 +950,7 @@ struct StationViewWindow : public Window {
}
/* Draw waiting cargo. */
NWidgetBase * nwi = this - > GetWidget < NWidgetBase > ( SVW _WAITING) ;
NWidgetBase * nwi = this - > GetWidget < NWidgetBase > ( WID_ SV_WAITING) ;
Rect waiting_rect = { nwi - > pos_x , nwi - > pos_y , nwi - > pos_x + nwi - > current_x - 1 , nwi - > pos_y + nwi - > current_y - 1 } ;
this - > DrawWaitingCargo ( waiting_rect , cargolist , transfers ) ;
}
@ -958,7 +958,7 @@ struct StationViewWindow : public Window {
virtual void SetStringParameters ( int widget ) const
{
if ( widget = = SVW _CAPTION) {
if ( widget = = WID_ SV_CAPTION) {
const Station * st = Station : : Get ( this - > window_number ) ;
SetDParam ( 0 , st - > index ) ;
SetDParam ( 1 , st - > facilities ) ;
@ -1079,7 +1079,7 @@ struct StationViewWindow : public Window {
}
/**
* Draw accepted cargo in the # SVW _ACCEPTLIST widget .
* Draw accepted cargo in the # WID_ SV_ACCEPT_RATING_ LIST widget .
* @ param r Rectangle of the widget .
* @ return Number of lines needed for drawing the accepted cargo .
*/
@ -1097,7 +1097,7 @@ struct StationViewWindow : public Window {
}
/**
* Draw cargo ratings in the # SVW _ACCEPTLIST widget .
* Draw cargo ratings in the # WID_ SV_ACCEPT_RATING_ LIST widget .
* @ param r Rectangle of the widget .
* @ return Number of lines needed for drawing the cargo ratings .
*/
@ -1130,7 +1130,7 @@ struct StationViewWindow : public Window {
for ( CargoID c = 0 ; c < NUM_CARGO ; c + + ) {
if ( this - > cargo_rows [ c ] = = row ) {
ToggleBit ( this - > cargo , c ) ;
this - > SetWidgetDirty ( SVW _WAITING) ;
this - > SetWidgetDirty ( WID_ SV_WAITING) ;
break ;
}
}
@ -1139,11 +1139,11 @@ struct StationViewWindow : public Window {
virtual void OnClick ( Point pt , int widget , int click_count )
{
switch ( widget ) {
case SVW _WAITING:
this - > HandleCargoWaitingClick ( this - > vscroll - > GetScrolledRowFromWidget ( pt . y , this , SVW _WAITING, WD_FRAMERECT_TOP , FONT_HEIGHT_NORMAL ) ) ;
case WID_ SV_WAITING:
this - > HandleCargoWaitingClick ( this - > vscroll - > GetScrolledRowFromWidget ( pt . y , this , WID_ SV_WAITING, WD_FRAMERECT_TOP , FONT_HEIGHT_NORMAL ) ) ;
break ;
case SVW _LOCATION:
case WID_ SV_LOCATION:
if ( _ctrl_pressed ) {
ShowExtraViewPortWindow ( Station : : Get ( this - > window_number ) - > xy ) ;
} else {
@ -1151,11 +1151,11 @@ struct StationViewWindow : public Window {
}
break ;
case SVW _RATINGS: {
case WID_SV_ACCEPTS _RATINGS: {
/* Swap between 'accepts' and 'ratings' view. */
int height_change ;
NWidgetCore * nwi = this - > GetWidget < NWidgetCore > ( SVW _RATINGS) ;
if ( this - > GetWidget < NWidgetCore > ( SVW _RATINGS) - > widget_data = = STR_STATION_VIEW_RATINGS_BUTTON ) {
NWidgetCore * nwi = this - > GetWidget < NWidgetCore > ( WID_SV_ACCEPTS _RATINGS) ;
if ( this - > GetWidget < NWidgetCore > ( WID_SV_ACCEPTS _RATINGS) - > widget_data = = STR_STATION_VIEW_RATINGS_BUTTON ) {
nwi - > SetDataTip ( STR_STATION_VIEW_ACCEPTS_BUTTON , STR_STATION_VIEW_ACCEPTS_TOOLTIP ) ; // Switch to accepts view.
height_change = this - > rating_lines - this - > accepts_lines ;
} else {
@ -1166,17 +1166,17 @@ struct StationViewWindow : public Window {
break ;
}
case SVW _RENAME:
case WID_ SV_RENAME:
SetDParam ( 0 , this - > window_number ) ;
ShowQueryString ( STR_STATION_NAME , STR_STATION_VIEW_RENAME_STATION_CAPTION , MAX_LENGTH_STATION_NAME_CHARS ,
this , CS_ALPHANUMERAL , QSF_ENABLE_DEFAULT | QSF_LEN_IN_CHARS ) ;
break ;
case SVW _TRAINS: // Show list of scheduled trains to this station
case SVW _ROADVEHS: // Show list of scheduled road-vehicles to this station
case SVW _SHIPS: // Show list of scheduled ships to this station
case SVW _PLANES: // Show list of scheduled aircraft to this station
ShowVehicleListWindow ( this - > owner , ( VehicleType ) ( widget - SVW _TRAINS) , ( StationID ) this - > window_number ) ;
case WID_ SV_TRAINS: // Show list of scheduled trains to this station
case WID_ SV_ROADVEHS: // Show list of scheduled road-vehicles to this station
case WID_ SV_SHIPS: // Show list of scheduled ships to this station
case WID_ SV_PLANES: // Show list of scheduled aircraft to this station
ShowVehicleListWindow ( this - > owner , ( VehicleType ) ( widget - WID_ SV_TRAINS) , ( StationID ) this - > window_number ) ;
break ;
}
}
@ -1190,7 +1190,7 @@ struct StationViewWindow : public Window {
virtual void OnResize ( )
{
this - > vscroll - > SetCapacityFromWidget ( this , SVW _WAITING, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM ) ;
this - > vscroll - > SetCapacityFromWidget ( this , WID_ SV_WAITING, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM ) ;
}
} ;
@ -1317,12 +1317,12 @@ static const T *FindStationsNearby(TileArea ta, bool distant_join)
static const NWidgetPart _nested_select_station_widgets [ ] = {
NWidget ( NWID_HORIZONTAL ) ,
NWidget ( WWT_CLOSEBOX , COLOUR_DARK_GREEN ) ,
NWidget ( WWT_CAPTION , COLOUR_DARK_GREEN , JSW_WIDGET _CAPTION) , SetDataTip ( STR_JOIN_STATION_CAPTION , STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS ) ,
NWidget ( WWT_CAPTION , COLOUR_DARK_GREEN , WID_JS _CAPTION) , SetDataTip ( STR_JOIN_STATION_CAPTION , STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS ) ,
EndContainer ( ) ,
NWidget ( NWID_HORIZONTAL ) ,
NWidget ( WWT_PANEL , COLOUR_DARK_GREEN , JSW _PANEL) , SetResize ( 1 , 0 ) , SetScrollbar ( JSW _SCROLLBAR) , EndContainer ( ) ,
NWidget ( WWT_PANEL , COLOUR_DARK_GREEN , WID_ JS_PANEL) , SetResize ( 1 , 0 ) , SetScrollbar ( WID_ JS_SCROLLBAR) , EndContainer ( ) ,
NWidget ( NWID_VERTICAL ) ,
NWidget ( NWID_VSCROLLBAR , COLOUR_DARK_GREEN , JSW _SCROLLBAR) ,
NWidget ( NWID_VSCROLLBAR , COLOUR_DARK_GREEN , WID_ JS_SCROLLBAR) ,
NWidget ( WWT_RESIZEBOX , COLOUR_DARK_GREEN ) ,
EndContainer ( ) ,
EndContainer ( ) ,
@ -1344,15 +1344,15 @@ struct SelectStationWindow : Window {
area ( ta )
{
this - > CreateNestedTree ( desc ) ;
this - > vscroll = this - > GetScrollbar ( JSW _SCROLLBAR) ;
this - > GetWidget < NWidgetCore > ( JSW_WIDGET _CAPTION) - > widget_data = T : : EXPECTED_FACIL = = FACIL_WAYPOINT ? STR_JOIN_WAYPOINT_CAPTION : STR_JOIN_STATION_CAPTION ;
this - > vscroll = this - > GetScrollbar ( WID_ JS_SCROLLBAR) ;
this - > GetWidget < NWidgetCore > ( WID_JS _CAPTION) - > widget_data = T : : EXPECTED_FACIL = = FACIL_WAYPOINT ? STR_JOIN_WAYPOINT_CAPTION : STR_JOIN_STATION_CAPTION ;
this - > FinishInitNested ( desc , 0 ) ;
this - > OnInvalidateData ( 0 ) ;
}
virtual void UpdateWidgetSize ( int widget , Dimension * size , const Dimension & padding , Dimension * fill , Dimension * resize )
{
if ( widget ! = JSW _PANEL) return ;
if ( widget ! = WID_ JS_PANEL) return ;
/* Determine the widest string */
Dimension d = GetStringBoundingBox ( T : : EXPECTED_FACIL = = FACIL_WAYPOINT ? STR_JOIN_WAYPOINT_CREATE_SPLITTED_WAYPOINT : STR_JOIN_STATION_CREATE_SPLITTED_STATION ) ;
@ -1372,7 +1372,7 @@ struct SelectStationWindow : Window {
virtual void DrawWidget ( const Rect & r , int widget ) const
{
if ( widget ! = JSW _PANEL) return ;
if ( widget ! = WID_ JS_PANEL) return ;
uint y = r . top + WD_FRAMERECT_TOP ;
if ( this - > vscroll - > GetPosition ( ) = = 0 ) {
@ -1393,9 +1393,9 @@ struct SelectStationWindow : Window {
virtual void OnClick ( Point pt , int widget , int click_count )
{
if ( widget ! = JSW _PANEL) return ;
if ( widget ! = WID_ JS_PANEL) return ;
uint st_index = this - > vscroll - > GetScrolledRowFromWidget ( pt . y , this , JSW _PANEL, WD_FRAMERECT_TOP ) ;
uint st_index = this - > vscroll - > GetScrolledRowFromWidget ( pt . y , this , WID_ JS_PANEL, WD_FRAMERECT_TOP ) ;
bool distant_join = ( st_index > 0 ) ;
if ( distant_join ) st_index - - ;
@ -1422,7 +1422,7 @@ struct SelectStationWindow : Window {
virtual void OnResize ( )
{
this - > vscroll - > SetCapacityFromWidget ( this , JSW _PANEL, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM ) ;
this - > vscroll - > SetCapacityFromWidget ( this , WID_ JS_PANEL, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM ) ;
}
/**