Skip to content

Commit

Permalink
fixing gui glitches (caused by button with NULL target) introduced in…
Browse files Browse the repository at this point in the history
… [15971] refs #36

git-svn-id: file:///home/behr_mi/git/sumo_synched/trunk@15981 afbd958f-9f77-42d5-a016-97a22340ccf4
  • Loading branch information
namdre committed Mar 20, 2014
1 parent fe92759 commit 04f843d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
33 changes: 11 additions & 22 deletions sumo/src/gui/GUIApplicationWindow.cpp
Expand Up @@ -275,6 +275,11 @@ GUIApplicationWindow::create() {
myMenuBarDrag->create();
myToolBarDrag1->create();
myToolBarDrag2->create();
myToolBarDrag3->create();
myToolBarDrag4->create();
myToolBarDrag5->create();
myToolBarDrag6->create();
myToolBarDrag7->create();
myFileMenu->create();
mySelectByPermissions->create();
myEditMenu->create();
Expand Down Expand Up @@ -606,12 +611,9 @@ GUIApplicationWindow::buildToolBars() {
/// game specific stuff
// total waitingTime
myToolBarDrag6 = new FXToolBarShell(this, FRAME_NORMAL);
myToolBar6 = new FXToolBar(myTopDock, myToolBarDrag6,
LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED);
new FXToolBarGrip(myToolBar6, myToolBar6, FXToolBar::ID_TOOLBARGRIP,
TOOLBARGRIP_DOUBLE);
new FXButton(myToolBar6, "Waiting Time:\t\tTime spent waiting accumulated for all vehicles", 0, this, 0,
BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
myToolBar6 = new FXToolBar(myTopDock, myToolBarDrag6, LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED);
new FXToolBarGrip(myToolBar6, myToolBar6, FXToolBar::ID_TOOLBARGRIP, TOOLBARGRIP_DOUBLE);
new FXLabel(myToolBar6, "Waiting Time:\t\tTime spent waiting accumulated for all vehicles", 0, LAYOUT_TOP | LAYOUT_LEFT);
myWaitingTimeLabel = new FXEX::FXLCDLabel(myToolBar6, 13, 0, 0, JUSTIFY_RIGHT);
myWaitingTimeLabel->setHorizontal(2);
myWaitingTimeLabel->setVertical(6);
Expand All @@ -621,12 +623,9 @@ GUIApplicationWindow::buildToolBars() {

// idealistic time loss
myToolBarDrag7 = new FXToolBarShell(this, FRAME_NORMAL);
myToolBar7 = new FXToolBar(myTopDock, myToolBarDrag7,
LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED);
new FXToolBarGrip(myToolBar7, myToolBar7, FXToolBar::ID_TOOLBARGRIP,
TOOLBARGRIP_DOUBLE);
new FXButton(myToolBar7, "Time Loss:\t\tTime lost due to being unable to drive with maximum speed for all vehicles", 0, this, 0,
BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
myToolBar7 = new FXToolBar(myTopDock, myToolBarDrag7, LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED);
new FXToolBarGrip(myToolBar7, myToolBar7, FXToolBar::ID_TOOLBARGRIP, TOOLBARGRIP_DOUBLE);
new FXLabel(myToolBar7, "Time Loss:\t\tTime lost due to being unable to drive with maximum speed for all vehicles", 0, LAYOUT_TOP | LAYOUT_LEFT);
myTimeLossLabel = new FXEX::FXLCDLabel(myToolBar7, 13, 0, 0, JUSTIFY_RIGHT);
myTimeLossLabel->setHorizontal(2);
myTimeLossLabel->setVertical(6);
Expand Down Expand Up @@ -954,16 +953,6 @@ GUIApplicationWindow::onCmdGaming(FXObject*, FXSelector, void*) {
myMessageWindow->show();
myLCDLabel->setFgColor(MFXUtils::getFXColor(RGBColor::GREEN));
}
if (myMDIClient->numChildren() > 0) {
w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
if (w != 0) {
// need to restore size (don't know why)
const FXint width = getWidth();
const FXint height = getHeight();
w->toggleGaming();
resize(width, height);
}
}
update();
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions sumo/src/gui/GUIApplicationWindow.h
Expand Up @@ -291,7 +291,7 @@ class GUIApplicationWindow :

/// for some menu detaching fun
FXToolBarShell* myToolBarDrag1, *myToolBarDrag2, *myToolBarDrag3,
*myToolBarDrag4, *myToolBarDrag5, *myToolBarDrag6;
*myToolBarDrag4, *myToolBarDrag5, *myMenuBarDrag;

///
FXRealSpinDial* mySimDelayTarget;
Expand Down Expand Up @@ -349,7 +349,7 @@ class GUIApplicationWindow :
SUMOTime myWaitingTime;
SUMOTime myTimeLoss;
FXToolBar *myToolBar6, *myToolBar7;
FXToolBarShell *myToolBarDrag7, *myMenuBarDrag;
FXToolBarShell *myToolBarDrag6, *myToolBarDrag7;
////}

};
Expand Down

0 comments on commit 04f843d

Please sign in to comment.