@ -691,10 +691,11 @@ public:
break ;
case WID_GL_LIST_GROUP : { // Matrix Group
uint id_g = this - > group_sb - > GetScrolled RowFromWidget( pt . y , this , WID_GL_LIST_GROUP ) ;
if ( i d_g > = this - > groups . siz e( ) ) return ;
auto it = this - > group_sb - > GetScrolled ItemFromWidget( this - > groups , pt . y , this , WID_GL_LIST_GROUP ) ;
if ( i t = = this - > groups . end ( ) ) return ;
if ( groups [ id_g ] - > folded | | ( id_g + 1 < this - > groups . size ( ) & & this - > indents [ id_g + 1 ] > this - > indents [ id_g ] ) ) {
size_t id_g = it - this - > groups . begin ( ) ;
if ( ( * it ) - > folded | | ( id_g + 1 < this - > groups . size ( ) & & this - > indents [ id_g + 1 ] > this - > indents [ id_g ] ) ) {
/* The group has children, check if the user clicked the fold / unfold button. */
NWidgetCore * group_display = this - > GetWidget < NWidgetCore > ( widget ) ;
int x = _current_text_dir = = TD_RTL ?
@ -731,10 +732,10 @@ public:
}
case WID_GL_LIST_VEHICLE : { // Matrix Vehicle
uint id_v = this - > vscroll - > GetScrolledRowFromWidget ( pt . y , this , WID_GL_LIST_VEHICLE ) ;
if ( i d_v > = this - > vehgroups . siz e( ) ) return ; // click out of list bound
auto it = this - > vscroll - > GetScrolledItemFromWidget ( this - > vehgroups , pt . y , this , WID_GL_LIST_VEHICLE ) ;
if ( i t = = this - > vehgroups . end ( ) ) return ; // click out of list bound
const GUIVehicleGroup & vehgroup = this - > vehgroups [ id_v ] ;
const GUIVehicleGroup & vehgroup = * it ;
const Vehicle * v = nullptr ;
@ -845,8 +846,8 @@ public:
break ;
case WID_GL_LIST_GROUP : { // Matrix group
uint id_g = this - > group_sb - > GetScrolled RowFromWidget( pt . y , this , WID_GL_LIST_GROUP ) ;
GroupID new_g = i d_g > = this - > groups . siz e( ) ? INVALID_GROUP : this - > groups [ id_g ] - > index ;
auto it = this - > group_sb - > GetScrolled ItemFromWidget( this - > groups , pt . y , this , WID_GL_LIST_GROUP ) ;
GroupID new_g = i t = = this - > groups . end ( ) ? INVALID_GROUP : ( * it ) - > index ;
if ( this - > group_sel ! = new_g & & g - > parent ! = new_g ) {
Command < CMD_ALTER_GROUP > : : Post ( STR_ERROR_GROUP_CAN_T_SET_PARENT , AlterGroupMode : : SetParent , this - > group_sel , new_g , { } ) ;
@ -878,8 +879,8 @@ public:
this - > group_over = INVALID_GROUP ;
this - > SetDirty ( ) ;
uint id_g = this - > group_sb - > GetScrolled RowFromWidget( pt . y , this , WID_GL_LIST_GROUP ) ;
GroupID new_g = i d_g > = this - > groups . siz e( ) ? NEW_GROUP : this - > groups [ id_g ] - > index ;
auto it = this - > group_sb - > GetScrolled ItemFromWidget( this - > groups , pt . y , this , WID_GL_LIST_GROUP ) ;
GroupID new_g = i t = = this - > groups . end ( ) ? NEW_GROUP : ( * it ) - > index ;
Command < CMD_ADD_VEHICLE_GROUP > : : Post ( STR_ERROR_GROUP_CAN_T_ADD_VEHICLE , new_g = = NEW_GROUP ? CcAddVehicleNewGroup : nullptr , new_g , vindex , _ctrl_pressed | | this - > grouping = = GB_SHARED_ORDERS ) ;
break ;
@ -891,10 +892,10 @@ public:
this - > group_over = INVALID_GROUP ;
this - > SetDirty ( ) ;
uint id_v = this - > vscroll - > GetScrolledRowFromWidget ( pt . y , this , WID_GL_LIST_VEHICLE ) ;
if ( i d_v > = this - > vehgroups . siz e( ) ) return ; // click out of list bound
auto it = this - > vscroll - > GetScrolledItemFromWidget ( this - > vehgroups , pt . y , this , WID_GL_LIST_VEHICLE ) ;
if ( i t = = this - > vehgroups . end ( ) ) return ; // click out of list bound
const GUIVehicleGroup & vehgroup = this - > vehgroups [ id_v ] ;
const GUIVehicleGroup & vehgroup = * it ;
switch ( this - > grouping ) {
case GB_NONE : {
const Vehicle * v = vehgroup . GetSingleVehicle ( ) ;
@ -1023,8 +1024,8 @@ public:
break ;
case WID_GL_LIST_GROUP : { // ... the list of custom groups.
uint id_g = this - > group_sb - > GetScrolled RowFromWidget( pt . y , this , WID_GL_LIST_GROUP ) ;
new_group_over = i d_g > = this - > groups . siz e( ) ? NEW_GROUP : this - > groups [ id_g ] - > index ;
auto it = this - > group_sb - > GetScrolled ItemFromWidget( this - > groups , pt . y , this , WID_GL_LIST_GROUP ) ;
new_group_over = i t = = this - > groups . end ( ) ? NEW_GROUP : ( * it ) - > index ;
break ;
}
}