From 8bb536de73cdf6b733c91ffccaef7a07feeb83b5 Mon Sep 17 00:00:00 2001 From: Steve Greedy Date: Tue, 14 Aug 2018 08:14:08 +0100 Subject: [PATCH] Resolved issue re-selected MOD --- GUI/SW1/SRC/SW1_GUIMain.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/GUI/SW1/SRC/SW1_GUIMain.cpp b/GUI/SW1/SRC/SW1_GUIMain.cpp index 419f8d1..1a624d3 100644 --- a/GUI/SW1/SRC/SW1_GUIMain.cpp +++ b/GUI/SW1/SRC/SW1_GUIMain.cpp @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2018 University of Nottingham +// Copyright (C) 2015 - 2017 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -215,6 +215,7 @@ SW1_GUIFrame::SW1_GUIFrame(wxWindow* parent,wxWindowID id) Connect(idMenuAbout,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SW1_GUIFrame::OnAbout); //*) + // Set frame icon here wxIcon FrameIcon; FrameIcon.CopyFromBitmap(wxBitmap(wxImage(_T("resources/spacewire_schematic_64x64.ico")))); @@ -335,16 +336,23 @@ void SW1_GUIFrame::OnCreateMOD(wxCommandEvent& event) void SW1_GUIFrame::PopulateTheDirectoryTree ( wxString RootFolder) { int size_h, size_v; - Panel1->GetSize(&size_h, &size_v ); if (tree != NULL) - tree->Destroy(); + { + Disconnect(tree->GetTreeCtrl()->GetId(),wxEVT_COMMAND_TREE_SEL_CHANGED , (wxObjectEventFunction) (wxEventFunction)(wxCommandEventFunction) &SW1_GUIFrame::OnTreeSelection); + Disconnect(tree->GetTreeCtrl()->GetId(),wxEVT_COMMAND_TREE_ITEM_ACTIVATED, (wxObjectEventFunction) (wxEventFunction)(wxCommandEventFunction) &SW1_GUIFrame::OnTreeSelectionChanged); + tree -> Close(); + tree -> Destroy(); + } + tree = (wxSpecificDirCtrl *) NULL; + Panel1->GetSize(&size_h, &size_v ); + tree = new wxSpecificDirCtrl (Panel1, -1, RootFolder, wxDefaultPosition, - wxSize(size_h,size_v), + wxSize(-1,-1), wxSIMPLE_BORDER, "*.cable_spec;*.bundle_spec;*.spice_model_spec", 0, _T("Directory Listing")); -- libgit2 0.21.2