|
@@ -30,6 +30,8 @@ DialogEditLane::DialogEditLane(Road * pRoad,QWidget *parent) :
|
|
|
}
|
|
|
if(nsection > 0)on_comboBox_LaneSection_currentIndexChanged(0);
|
|
|
|
|
|
+ setWindowTitle("Edit Lane");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
DialogEditLane::~DialogEditLane()
|
|
@@ -39,6 +41,7 @@ DialogEditLane::~DialogEditLane()
|
|
|
|
|
|
void DialogEditLane::on_comboBox_LaneSection_currentIndexChanged(int index)
|
|
|
{
|
|
|
+ int indexold = ui->comboBox_Lane->currentIndex();
|
|
|
if(mpRoad == 0)return;
|
|
|
LaneSection * pLS = mpRoad->GetLaneSection(index);
|
|
|
ui->comboBox_Lane->clear();
|
|
@@ -54,7 +57,17 @@ void DialogEditLane::on_comboBox_LaneSection_currentIndexChanged(int index)
|
|
|
ui->comboBox_Lane->addItem(stritemname);
|
|
|
}
|
|
|
|
|
|
- if(nLaneCount > 0)on_comboBox_Lane_currentIndexChanged(0);
|
|
|
+ int indexnew = 0;
|
|
|
+ if((indexold>=0)&&(indexold<nLaneCount))
|
|
|
+ {
|
|
|
+ indexnew = indexold;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(nLaneCount > 0)
|
|
|
+ {
|
|
|
+ ui->comboBox_Lane->setCurrentIndex(indexnew);
|
|
|
+// on_comboBox_Lane_currentIndexChanged(indexnew);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
@@ -158,6 +171,8 @@ void DialogEditLane::on_pushButton_DeleteLane_clicked()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
if(mpCurLS == 0)return;
|
|
|
int nlanecount = mpCurLS->GetLaneCount();
|
|
|
int i;
|
|
@@ -172,6 +187,23 @@ void DialogEditLane::on_pushButton_DeleteLane_clicked()
|
|
|
}
|
|
|
mpCurLS->DeleteLane(i);
|
|
|
|
|
|
+ nlanecount = mpCurLS->GetLaneCount();
|
|
|
+ for(i=0;i<nlanecount;i++)
|
|
|
+ {
|
|
|
+ Lane * pLane = mpCurLS->GetLane(i);
|
|
|
+ if(((pLane->GetId() * index)>0)&&(abs(pLane->GetId())>abs(index)))
|
|
|
+ {
|
|
|
+ if(pLane->GetId()>0)
|
|
|
+ {
|
|
|
+ pLane->SetId(pLane->GetId()-1);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ pLane->SetId(pLane->GetId()+1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
on_comboBox_LaneSection_currentIndexChanged(ui->comboBox_LaneSection->currentIndex());
|
|
|
}
|
|
|
|