#include <creaWx.h>
#include "wx/treectrl.h"
+#include "wx/treebase.h"
+#include "wx/tooltip.h"
#include "CDMUtilities.h"
#include "creaDevManagerIds.h"
#include "wxCDMLibraryDescriptionPanel.h"
#include "wxCDMPackageDescriptionPanel.h"
#include "wxCDMBlackBoxDescriptionPanel.h"
+#include "wxCDMCMakeListsDescriptionPanel.h"
+#include "wxCDMFolderDescriptionPanel.h"
+#include "wxCDMFileDescriptionPanel.h"
+#include "wxCDMPackageManagerPanel.h"
#include "wxCDMProjectActionsPanel.h"
#include "wxCDMNewProjectDialog.h"
EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCDMMainFrame::OnMenuAboutCreatis)
EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCDMMainFrame::OnMenuNewProject)
EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMMainFrame::OnMenuOpenProject)
-EVT_TREE_SEL_CHANGED(ID_TREE_PROJECTS, wxCDMMainFrame::OnTreeSelectionChanged)
+EVT_TREE_SEL_CHANGING(ID_TREE_PROJECTS, wxCDMMainFrame::OnTreeSelectionChanged)
+EVT_COMMAND(wxID_ANY, wxEVT_DISPLAY_CHANGED, wxCDMMainFrame::OnCreationComplete)
+EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_LIST_ITEM_SELECTED, wxCDMMainFrame::OnElementSelected)
+EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxCDMMainFrame::OnElementDeselected)
END_EVENT_TABLE()
wxCDMMainFrame::wxCDMMainFrame(
return TRUE;
}
+modelCDMMain* wxCDMMainFrame::GetModel() const
+{
+ return this->model;
+}
+
+void wxCDMMainFrame::RefreshProject()
+{
+ std::string* result;
+ std::cout << "refreshing project" << std::endl;
+ this->model->RefreshProject(result);
+ std::cout << "rebuilding project tree" << std::endl;
+ this->tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
+}
+
void wxCDMMainFrame::CreateMenus()
{
wxMenuBar* menuBar = new wxMenuBar;
this,
ID_TREE_PROJECTS,
wxDefaultPosition,
- wxSize(300,400),
+ wxSize(200,400),
wxTR_HAS_BUTTONS | wxTR_AQUA_BUTTONS
);
- tree_Projects->SetMinSize(wxSize(200,200));
panel_Properties = new wxCDMMainDescriptionPanel(
this,
ID_WINDOW_PROPERTIES,
wxT("Description Panel"),
wxDefaultPosition,
- wxSize(300, 400),
+ wxSize(400, 600),
0
);
- auiManager.AddPane(tree_Projects, wxLEFT, wxT("Projects Tree"));
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
+
+
+ auiManager.AddPane(panel_Properties, wxAuiPaneInfo().BestSize(600,400).CenterPane().Name(wxT("panel_Properties")).Caption(wxT("")).CloseButton(false));
+ auiManager.AddPane(tree_Projects, wxAuiPaneInfo().Right().MinSize(300,300).BestSize(300,400).CloseButton(false).Name(wxT("tree_Projects")).Caption(wxT("Project Tree")).CloseButton(false));
+
+ wxString pers = auiManager.SavePerspective();
auiManager.Update();
- auiManager.GetPane(tree_Projects).CloseButton(false).MaximizeButton(true);
+ auiManager.LoadPerspective(pers,true);
+ wxToolTip::Enable(true);
+ wxToolTip::SetDelay(0);
}
//Event Handlers
{
auiManager.DetachPane(this->panel_Properties);
this->panel_Properties->Destroy();
+ this->panel_Properties = NULL;
}
this->panel_Properties = new wxCDMProjectDescriptionPanel(
ID_WINDOW_PROPERTIES,
wxT("Description Panel"),
wxDefaultPosition,
- wxSize(300, 400),
+ wxSize(600, 400),
0);
//show projectactions panel
if(this->panel_ProjectActions != NULL)
{
auiManager.DetachPane(this->panel_Properties);
this->panel_ProjectActions->Destroy();
+ this->panel_ProjectActions = NULL;
}
panel_ProjectActions = new wxCDMProjectActionsPanel(
ID_WINDOW_PROJ_ACTIONS,
wxT("Project Actions Panel"),
wxDefaultPosition,
- wxSize(600,200),
+ wxSize(800,200),
0
);
panel_ProjectActions->SetMinSize(wxSize(500, 100));
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
- auiManager.AddPane(panel_ProjectActions, wxBOTTOM, wxT("Project Actions"));
+ auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
+ auiManager.AddPane(panel_ProjectActions, wxAuiPaneInfo().Bottom().MinSize(800,50).Name(wxT("panel_ProjectActions")).Caption(wxT("General Project Actions")).BestSize(800,70).CloseButton(false));
auiManager.Update();
{
auiManager.DetachPane(this->panel_Properties);
this->panel_Properties->Destroy();
+ this->panel_Properties = NULL;
}
this->panel_Properties = new wxCDMProjectDescriptionPanel(
ID_WINDOW_PROPERTIES,
wxT("Description Panel"),
wxDefaultPosition,
- wxSize(300, 400),
+ wxSize(600, 400),
0
);
{
auiManager.DetachPane(this->panel_ProjectActions);
this->panel_ProjectActions->Destroy();
+ this->panel_ProjectActions = NULL;
}
panel_ProjectActions = new wxCDMProjectActionsPanel(
this,
ID_WINDOW_PROJ_ACTIONS,
wxT("Project Actions Panel"),
wxDefaultPosition,
- wxSize(600,200),
+ wxSize(800,200),
0
);
panel_ProjectActions->SetMinSize(wxSize(500, 100));
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
- auiManager.AddPane(panel_ProjectActions, wxBOTTOM, wxT("Project Actions"));
+ auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
+ auiManager.AddPane(panel_ProjectActions, wxAuiPaneInfo().Bottom().MinSize(800,50).Name(wxT("panel_ProjectActions")).Caption(wxT("General Project Actions")).BestSize(800,70).CloseButton(false));
auiManager.Update();
}
}
void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event)
{
+ std::cout << "closing project" << std::endl;
std::string* result;
if(!this->model->CloseProject(result))
{
std::cout << "error closing project: " << *result << std::endl;
wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
}
+
tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
if(this->panel_Properties != NULL)
{
auiManager.DetachPane(this->panel_Properties);
this->panel_Properties->Destroy();
+ this->panel_Properties = NULL;
}
if(this->panel_ProjectActions != NULL)
{
auiManager.DetachPane(this->panel_ProjectActions);
this->panel_ProjectActions->Destroy();
+ this->panel_ProjectActions = NULL;
}
this->panel_Properties = new wxCDMMainDescriptionPanel(
ID_WINDOW_PROPERTIES,
wxT("Description Panel"),
wxDefaultPosition,
- wxSize(300, 400),
+ wxSize(600, 400),
0
);
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
+ auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
auiManager.Update();
event.Skip();
{
auiManager.DetachPane(this->panel_Properties);
this->panel_Properties->Destroy();
+ this->panel_Properties = NULL;
}
if(this->panel_ProjectActions != NULL)
{
auiManager.DetachPane(this->panel_ProjectActions);
this->panel_ProjectActions->Destroy();
+ this->panel_ProjectActions = NULL;
}
this->panel_Properties = new wxCDMMainDescriptionPanel(
ID_WINDOW_PROPERTIES,
wxT("Description Panel"),
wxDefaultPosition,
- wxSize(300, 400),
+ wxSize(600, 400),
0
);
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
+ auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400));
auiManager.Update();
event.Skip();
{
std::cout << "Closing CreaDevManager..." << std::endl;
std::string* result;
- if(!this->model->CloseProject(result))
+ if(this->model->GetProject() != NULL && !this->model->CloseProject(result))
{
std::cout << "error closing project: " << *result << std::endl;
wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
{
auiManager.DetachPane(this->panel_Properties);
this->panel_Properties->Destroy();
+ this->panel_Properties = NULL;
}
+
if(this->panel_ProjectActions != NULL)
{
auiManager.DetachPane(this->panel_ProjectActions);
this->panel_ProjectActions->Destroy();
+ this->panel_ProjectActions = NULL;
}
- this->panel_Properties = new wxCDMMainDescriptionPanel(
- this,
- ID_WINDOW_PROPERTIES,
- wxT("Description Panel"),
- wxDefaultPosition,
- wxSize(300, 400),
- 0
- );
Close();
event.Skip();
}
{
wxMessageBox( crea::std2wx(result->c_str()), wxT("Refresh Project - Error"), wxICON_ERROR);
}
+ this->tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
+
+ this->auiManager.Update();
+
+ this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
+ this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
+
//TODO: Show possible problems in CMakeLists files
event.Skip();
}
{
std::cerr << "Event OnMenuBBTKGraphicalEditor not implemented" << std::endl;
event.Skip();
+ if(CDMUtilities::openBBEditor())
+ {
+ wxMessageBox( wxT("Can't open the BB Graphical Editor. Please check your Crea Tools installation."), wxT("Refresh Project - Error"), wxICON_ERROR);
+ }
}
void wxCDMMainFrame::OnMenuMiniTools(wxCommandEvent& event)
{
- std::cerr << "Event OnMenuMiniTools not implemented" << std::endl;
- event.Skip();
+ if(CDMUtilities::openCreaToolsTools())
+ {
+ wxMessageBox( wxT("Can't open the Minitools. Please check your Crea Tools installation."), wxT("Refresh Project - Error"), wxICON_ERROR);
+ }
}
void wxCDMMainFrame::OnMenuCodeEditor(wxCommandEvent& event)
{
- std::cerr << "Event OnMenuCodeEditor not implemented" << std::endl;
- event.Skip();
+ if(CDMUtilities::openTextEditor())
+ {
+ wxMessageBox( wxT("Can't open the Text Editor. Please check the default text editor command in the Crea Development Manager settings (Edit -> Settings)."), wxT("Refresh Project - Error"), wxICON_ERROR);
+ }
}
void wxCDMMainFrame::OnMenuCommandLine(wxCommandEvent& event)
{
- std::cerr << "Event OnMenuCommandLine not implemented" << std::endl;
- event.Skip();
+ if(CDMUtilities::openTerminal())
+ {
+ wxMessageBox( wxT("Can't open Terminal. Please check the default terminal command in the Crea Development Manager settings (Edit -> Settings)."), wxT("Refresh Project - Error"), wxICON_ERROR);
+ }
}
//Help Menu
void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
{
- std::cout << "New Tree Selection" << std::endl;
//get selected element
wxTreeItemId elementId = event.GetItem();
//TODO get element type
//project
modelCDMProject* elementProject = dynamic_cast<modelCDMProject*>(element);
+ wxPanel* description;
if(elementProject != NULL)
{
-
//create element description
- wxCDMProjectDescriptionPanel* description = new wxCDMProjectDescriptionPanel(
+ description = new wxCDMProjectDescriptionPanel(
this,
elementProject,
ID_WINDOW_PROPERTIES,
wxT("Description Panel"),
wxDefaultPosition,
- wxSize(300, 400),
- 0
- );
- //delete old view
- if(this->panel_Properties!= NULL)
- {
- this->panel_Properties->Hide();
- this->panel_Properties->Destroy();
- auiManager.DetachPane(this->panel_Properties);
- }
- //set new view
- this->panel_Properties = description;
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
- auiManager.Update();
- event.Skip();
- return;
- }
- //appli
- modelCDMAppli* elementAppli = dynamic_cast<modelCDMAppli*>(element);
- if(elementAppli != NULL)
- {
- //create element description
- wxCDMAppliDescriptionPanel* description = new wxCDMAppliDescriptionPanel(
- this,
- elementAppli,
- ID_WINDOW_PROPERTIES,
- wxT("Description Panel"),
- wxDefaultPosition,
- wxSize(300, 400),
- 0
- );
- //delete old view
- if(this->panel_Properties!= NULL)
- {
- this->panel_Properties->Hide();
- this->panel_Properties->Destroy();
- auiManager.DetachPane(this->panel_Properties);
- }
- //set new view
- this->panel_Properties = description;
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
- auiManager.Update();
- event.Skip();
- return;
- }
- //application
- modelCDMApplication* elementApplication = dynamic_cast<modelCDMApplication*>(element);
- if(elementApplication != NULL)
- {
- //create element description
- wxCDMApplicationDescriptionPanel* description = new wxCDMApplicationDescriptionPanel(
- this,
- elementApplication,
- ID_WINDOW_PROPERTIES,
- wxT("Description Panel"),
- wxDefaultPosition,
- wxSize(300, 400),
+ wxSize(600, 400),
0
);
- //delete old view
- if(this->panel_Properties!= NULL)
- {
- this->panel_Properties->Hide();
- this->panel_Properties->Destroy();
- auiManager.DetachPane(this->panel_Properties);
- }
- //set new view
- this->panel_Properties = description;
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
- auiManager.Update();
- event.Skip();
- return;
}
- //lib
- modelCDMLib* elementLib = dynamic_cast<modelCDMLib*>(element);
- if(elementLib != NULL)
+ else
{
- //create element description
- wxCDMLibDescriptionPanel* description = new wxCDMLibDescriptionPanel(
- this,
- elementLib,
- ID_WINDOW_PROPERTIES,
- wxT("Description Panel"),
- wxDefaultPosition,
- wxSize(300, 400),
- 0
- );
- //delete old view
- if(this->panel_Properties!= NULL)
+ //appli
+ modelCDMAppli* elementAppli = dynamic_cast<modelCDMAppli*>(element);
+ if(elementAppli != NULL)
{
- this->panel_Properties->Hide();
- this->panel_Properties->Destroy();
- auiManager.DetachPane(this->panel_Properties);
-
+ //create element description
+ description = new wxCDMAppliDescriptionPanel(
+ this,
+ elementAppli,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
}
- //set new view
- this->panel_Properties = description;
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
- auiManager.Update();
- event.Skip();
- return;
- }
- //library
- modelCDMLibrary* elementLibrary = dynamic_cast<modelCDMLibrary*>(element);
- if(elementLibrary != NULL)
- {
- //create element description
- wxCDMLibraryDescriptionPanel* description = new wxCDMLibraryDescriptionPanel(
- this,
- elementLibrary,
- ID_WINDOW_PROPERTIES,
- wxT("Description Panel"),
- wxDefaultPosition,
- wxSize(300, 400),
- 0
- );
- //delete old view
- if(this->panel_Properties!= NULL)
+ else
{
- this->panel_Properties->Hide();
- this->panel_Properties->Destroy();
- auiManager.DetachPane(this->panel_Properties);
-
+ //application
+ modelCDMApplication* elementApplication = dynamic_cast<modelCDMApplication*>(element);
+ if(elementApplication != NULL)
+ {
+ //create element description
+ description = new wxCDMApplicationDescriptionPanel(
+ this,
+ elementApplication,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
+ else
+ {
+ //lib
+ modelCDMLib* elementLib = dynamic_cast<modelCDMLib*>(element);
+ if(elementLib != NULL)
+ {
+ //create element description
+ description = new wxCDMLibDescriptionPanel(
+ this,
+ elementLib,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
+ else
+ {
+ //library
+ modelCDMLibrary* elementLibrary = dynamic_cast<modelCDMLibrary*>(element);
+ if(elementLibrary != NULL)
+ {
+ //create element description
+ description = new wxCDMLibraryDescriptionPanel(
+ this,
+ elementLibrary,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
+ else
+ {
+ //package
+ modelCDMPackage* elementPackage = dynamic_cast<modelCDMPackage*>(element);
+ if(elementPackage != NULL)
+ {
+ //create element description
+ description = new wxCDMPackageDescriptionPanel(
+ this,
+ elementPackage,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
+ else
+ {
+ //black box
+ modelCDMBlackBox* elementBlackBox = dynamic_cast<modelCDMBlackBox*>(element);
+ if(elementBlackBox != NULL)
+ {
+ //create element description
+ description = new wxCDMBlackBoxDescriptionPanel(
+ this,
+ elementBlackBox,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
+ else
+ {
+ //CMakeLists
+ modelCDMCMakeListsFile* elementCMakeLists = dynamic_cast<modelCDMCMakeListsFile*>(element);
+ if(elementCMakeLists != NULL)
+ {
+ //create element description
+ description = new wxCDMCMakeListsDescriptionPanel(
+ this,
+ elementCMakeLists,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
+ else
+ {
+ //folder
+ modelCDMFolder* elementFolder = dynamic_cast<modelCDMFolder*>(element);
+ if(elementFolder != NULL)
+ {
+ //create element description
+ description = new wxCDMFolderDescriptionPanel(
+ this,
+ elementFolder,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
+ else
+ {
+ //file
+ modelCDMFile* elementFile = dynamic_cast<modelCDMFile*>(element);
+ if(elementFile != NULL)
+ {
+ //create element description
+ description = new wxCDMFileDescriptionPanel(
+ this,
+ elementFile,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
+ else
+ {
+
+ //main if not any
+ //create element description
+ description = new wxCDMMainDescriptionPanel(
+ this,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
- //set new view
- this->panel_Properties = description;
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
- auiManager.Update();
- event.Skip();
- return;
}
- //package
- modelCDMPackage* elementPackage = dynamic_cast<modelCDMPackage*>(element);
- if(elementPackage != NULL)
- {
- //create element description
- wxCDMPackageDescriptionPanel* description = new wxCDMPackageDescriptionPanel(
- this,
- elementPackage,
- ID_WINDOW_PROPERTIES,
- wxT("Description Panel"),
- wxDefaultPosition,
- wxSize(300, 400),
- 0
- );
- //delete old view
- if(this->panel_Properties!= NULL)
- {
- this->panel_Properties->Hide();
- this->panel_Properties->Destroy();
- auiManager.DetachPane(this->panel_Properties);
- }
- //set new view
- this->panel_Properties = description;
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
- auiManager.Update();
- event.Skip();
- return;
- }
- //black box
- modelCDMBlackBox* elementBlackBox = dynamic_cast<modelCDMBlackBox*>(element);
- if(elementBlackBox != NULL)
- {
- //create element description
- wxCDMBlackBoxDescriptionPanel* description = new wxCDMBlackBoxDescriptionPanel(
- this,
- elementBlackBox,
- ID_WINDOW_PROPERTIES,
- wxT("Description Panel"),
- wxDefaultPosition,
- wxSize(300, 400),
- 0
- );
- //delete old view
- if(this->panel_Properties!= NULL)
- {
- this->panel_Properties->Hide();
- this->panel_Properties->Destroy();
- auiManager.DetachPane(this->panel_Properties);
+ if(this->panel_Properties!= NULL)
+ this->panel_Properties->Hide();
+
+ auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
+ auiManager.Update();
- }
- //set new view
- this->panel_Properties = description;
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
- auiManager.Update();
- event.Skip();
- return;
- }
- //TODO: CMakeLists
- //TODO: folder
- //TODO: file
- //TODO: main
- //create element description
- wxCDMMainDescriptionPanel* description = new wxCDMMainDescriptionPanel(
- this,
- ID_WINDOW_PROPERTIES,
- wxT("Description Panel"),
- wxDefaultPosition,
- wxSize(300, 400),
- 0
- );
//delete old view
if(this->panel_Properties!= NULL)
{
- this->panel_Properties->Hide();
- this->panel_Properties->Destroy();
auiManager.DetachPane(this->panel_Properties);
-
+ this->panel_Properties->Destroy();
+ this->panel_Properties = NULL;
}
//set new view
+
this->panel_Properties = description;
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
+ //auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400).CloseButton(false));
auiManager.Update();
event.Skip();
return;
}
+
+void wxCDMMainFrame::OnCreationComplete(wxCommandEvent& event)
+{
+ switch(event.GetId() != 0)
+ {
+ case 0:
+ //select out old one to generate selection event
+ this->tree_Projects->SelectItem(event.GetInt(), true);
+ this->tree_Projects->Expand(event.GetInt());
+ break;
+ case 1:
+ wxPanel* description = NULL;
+ if(event.GetString() == wxT("manage_packages"))
+ {
+ this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
+ this->tree_Projects->Expand(this->model->GetProject()->GetId());
+ description = new wxCDMPackageManagerPanel(
+ this,
+ this->model->GetProject(),
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
+ else if(event.GetString() == wxT("manage_libraries"))
+ {
+ this->tree_Projects->SelectItem(this->model->GetProject()->GetLib()->GetId(), true);
+ this->tree_Projects->Expand(this->model->GetProject()->GetLib()->GetId());
+ break;
+ }
+ else if(event.GetString() == wxT("manage_applications"))
+ {
+ this->tree_Projects->SelectItem(this->model->GetProject()->GetAppli()->GetId(), true);
+ this->tree_Projects->Expand(this->model->GetProject()->GetAppli()->GetId());
+ break;
+ }
+ else if(event.GetString() == wxT("blackbox"))
+ {
+ this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
+ modelCDMBlackBox* bb = (modelCDMBlackBox*)event.GetClientData();
+ description = new wxCDMBlackBoxDescriptionPanel(
+ this,
+ bb,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
+
+ if(this->panel_Properties!= NULL)
+ this->panel_Properties->Hide();
+
+ auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
+ auiManager.Update();
+
+ //delete old view
+ if(this->panel_Properties!= NULL)
+ {
+ auiManager.DetachPane(this->panel_Properties);
+ this->panel_Properties->Destroy();
+ this->panel_Properties = NULL;
+ }
+ //set new view
+
+ this->panel_Properties = description;
+ auiManager.Update();
+ break;
+ }
+ event.Skip();
+}
+
+void wxCDMMainFrame::OnElementSelected(wxCommandEvent& event)
+{
+ //std::cout << "element " << event.GetInt() << std::endl;
+ this->tree_Projects->EnsureVisible(event.GetInt());
+ this->tree_Projects->SetItemBold(event.GetInt(), true);
+ this->tree_Projects->SetItemTextColour(event.GetInt(), wxColour(0,0,255));
+ this->tree_Projects->UpdateWindowUI(wxUPDATE_UI_RECURSE);
+ auiManager.Update();
+}
+
+void wxCDMMainFrame::OnElementDeselected(wxCommandEvent& event)
+{
+ this->tree_Projects->SetItemBold(event.GetInt(), false);
+ this->tree_Projects->SetItemTextColour(event.GetInt(), wxColour(0,0,0));
+ this->tree_Projects->UpdateWindowUI(wxUPDATE_UI_RECURSE);
+ auiManager.Update();
+}