Skip to content

Commit

Permalink
Fixed another bug in Iteration associate with all cars
Browse files Browse the repository at this point in the history
  • Loading branch information
KerryL committed May 25, 2016
1 parent bb7f765 commit 3c1448f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CarDesigner/include/gui/components/mainFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ class MainFrame : public wxFrame

bool GetUseOrtho() const { return useOrthoView; }

void SetAssociateWithAllCars();

private:
wxAuiManager manager;

Expand Down
26 changes: 26 additions & 0 deletions CarDesigner/src/gui/components/mainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3350,3 +3350,29 @@ void MainFrame::RemoveFileFromHistory(wxString pathAndFileName)
}
}
}

//==========================================================================
// Class: MainFrame
// Function: SetAssociateWithAllCars
//
// Description: Checks or unchecks the iteration menu item for associate
// with all open cars.
//
// Input Arguments:
// None
//
// Output Arguments:
// None
//
// Return Value:
// None
//
//==========================================================================
void MainFrame::SetAssociateWithAllCars()
{
if (openObjectList[activeIndex]->GetType() != GuiObject::TypeIteration)
return;

wxMenuItem *item = this->FindItemInMenuBar(IdMenuIterationAssociatedWithAllCars);
item->Check(static_cast<Iteration*>(openObjectList[activeIndex])->GetAutoAssociate());
}
4 changes: 4 additions & 0 deletions CarDesigner/src/gui/iteration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,8 @@ void Iteration::ShowAssociatedCarsDialog()
// If not all of the cars in the list are selected, make sure we're not auto-associating
if (openCars.size() != associatedCars.size())
associatedWithAllOpenCars = false;

mainFrame.SetAssociateWithAllCars();
}

// Update the analyses
Expand Down Expand Up @@ -1463,11 +1465,13 @@ void Iteration::SetYAxisType(AxisType yAxisType)
void Iteration::SetAutoAssociate(bool autoAssociate)
{
associatedWithAllOpenCars = autoAssociate;
UpdateAutoAssociate();

// Set the "this item has changed" flag
SetModified();

// Update this object
UpdateData();
UpdateDisplay();
}

Expand Down

0 comments on commit 3c1448f

Please sign in to comment.