#include "wxCDMMainFrame.h"
#include <iostream>
+#include <sstream>
#include <creaWx.h>
#include "creaSystem.h"
event.Skip();
return;
}
-
- //populate tree control
- tree_Projects->BuildTree(this->model->GetModelElements(),this->model->GetProject());
- tree_Projects->Unselect();
- tree_Projects->SelectItem(this->model->GetProject()->GetId());
-
-
+
//show project actions panel
if(this->panel_ProjectActions != NULL)
{
this->panel_ProjectActions->Destroy();
this->panel_ProjectActions = NULL;
}
-
+
panel_ProjectActions = new wxCDMProjectActionsPanel(
this,
this->model->GetProject(),
wxSize(800,200),
0
);
- panel_ProjectActions->SetMinSize(wxSize(500, 100));
-
-
+
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();
- //wxMessageBox(_T("New Project created!"),_T("New Project - Success!"), wxOK | wxICON_INFORMATION);
-
+ //populate tree control
+ tree_Projects->BuildTree(this->model->GetModelElements(),this->model->GetProject());
+ tree_Projects->Unselect();
+ tree_Projects->SelectItem(this->model->GetProject()->GetId());
+ wxMessageBox(wxT("ProjectSelected") ,_T("New Project - Success!"),wxOK | wxICON_ERROR);
}
-
- event.Skip();
}
void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event)
{
//populate tree control
tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
tree_Projects->Unselect();
- tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
+ tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
//get selected element
wxTreeItemId elementId = event.GetItem();
- if(this->tree_Projects->IsSelected(elementId))
+ if(elementId.IsOk() && this->tree_Projects->IsSelected(elementId))
{
std::cout << "Tree Selection id: " << elementId << std::endl;
//get element from model
modelCDMIProjectTreeNode* element = this->model->GetModelElements()[elementId];
+
if (element == NULL)
return;
std::cout << "Tree Selection: " << element->GetName() << std::endl;
-
+
//TODO get element type
//project
modelCDMProject* elementProject = dynamic_cast<modelCDMProject*>(element);
{
//application
modelCDMApplication* elementApplication = dynamic_cast<modelCDMApplication*>(element);
- if(elementApplication != NULL)
+ if(elementApplication != NULL)
{
//create element description
description = new wxCDMApplicationDescriptionPanel(