summaryrefslogtreecommitdiffstats
path: root/Project/MainFrame.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Project/MainFrame.cpp')
-rw-r--r--Project/MainFrame.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Project/MainFrame.cpp b/Project/MainFrame.cpp
index 76c7b6f..ef9f327 100644
--- a/Project/MainFrame.cpp
+++ b/Project/MainFrame.cpp
@@ -170,11 +170,11 @@ void MainFrame::OnMoveClick(wxRibbonButtonBarEvent& event)
{
Workspace* workspace = static_cast<Workspace*>(m_auiNotebook->GetCurrentPage());
if(workspace) {
- auto elementList = workspace->GetElementList();
+ auto elementList = workspace->GetAllElements();
// Calculate the average position of selected elements.
wxPoint2DDouble averagePos(0, 0);
int numSelElements = 0;
- for(auto it = elementList.begin(); it != elementList.end(); it++) {
+ for(auto it = elementList.begin(), itEnd = elementList.end(); it != itEnd; ++it) {
Element* element = *it;
if(element->IsSelected()) {
averagePos += element->GetPosition();
@@ -183,7 +183,7 @@ void MainFrame::OnMoveClick(wxRibbonButtonBarEvent& event)
}
averagePos = wxPoint2DDouble(averagePos.m_x / double(numSelElements), averagePos.m_y / double(numSelElements));
// Set the move position to the average of selected elements.
- for(auto it = elementList.begin(); it != elementList.end(); it++) {
+ for(auto it = elementList.begin(), itEnd = elementList.end(); it != itEnd; ++it) {
Element* element = *it;
if(element->IsSelected()) {
element->StartMove(averagePos);
@@ -218,7 +218,9 @@ void MainFrame::OnOpenClick(wxRibbonButtonBarEvent& event)
newWorkspace->SetJustOpened(true);
m_projectNumber++;
} else {
- // TODO: fail message.
+ wxMessageDialog msgDialog(
+ this, _("It was not possible to open the selected file."), _("Error"), wxOK | wxCENTRE | wxICON_ERROR);
+ msgDialog.ShowModal();
delete newWorkspace;
}
}