From 52931022eb25080e33f2362c3b0bd4361f0cdb0b Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 12 Apr 2017 18:57:10 -0300 Subject: Open control implementation --- Project/ControlEditor.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Project/ControlEditor.cpp') diff --git a/Project/ControlEditor.cpp b/Project/ControlEditor.cpp index 4fedfa3..cb0edf3 100644 --- a/Project/ControlEditor.cpp +++ b/Project/ControlEditor.cpp @@ -718,3 +718,19 @@ void ControlEditor::OnExportClick(wxCommandEvent& event) fileHandling.SaveControl(saveFileDialog.GetPath()); wxFileName fileName(saveFileDialog.GetPath()); } + +void ControlEditor::OnImportClick(wxCommandEvent& event) +{ + wxFileDialog openFileDialog(this, _("Open CTL file"), "", "", "CTL files (*.ctl)|*.ctl", + wxFD_OPEN | wxFD_FILE_MUST_EXIST); + if(openFileDialog.ShowModal() == wxID_CANCEL) return; + + wxFileName fileName(openFileDialog.GetPath()); + + FileHanding fileHandling(this); + if(!fileHandling.OpenControl(fileName)) { + wxMessageDialog msgDialog(this, _("It was not possible to open the selected file."), _("Error"), + wxOK | wxCENTRE | wxICON_ERROR); + msgDialog.ShowModal(); + } +} \ No newline at end of file -- cgit