#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->SelectItem(this->model->GetProject()->GetId(), false);
- tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
-
-
+
//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->SelectItem(this->model->GetProject()->GetId(), false);
- tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
+ tree_Projects->Unselect();
+ tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
{
std::cout << "error closing project: " << *result << std::endl;
}
- tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
+
if(this->panel_Properties != NULL)
{
auiManager.DetachPane(this->panel_Properties);
this->panel_Properties = NULL;
}
+ if(this->tree_Projects != NULL)
+ {
+ auiManager.DetachPane(this->tree_Projects);
+ this->tree_Projects->Destroy();
+ this->tree_Projects = NULL;
+ }
+
if(this->panel_ProjectActions != NULL)
{
auiManager.DetachPane(this->panel_ProjectActions);
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->Unselect();
this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
}
event.Skip();
html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
html -> SetBorders(0);
- html -> LoadPage(wxT("about.html"));
+
+ std::string content = ""
+ "<html>"
+ "<body bgcolor=\"#3333CC\">"
+ "<table cellspacing=3 cellpadding=4 width=\"100%\">"
+ " <tr>"
+ " <td bgcolor=\"#3333CC\">"
+ " <center>"
+ " <font size=+2 color=\"#FFFFFF\"><b>CREA Development Manager</b>"
+ " </font>"
+ " </center>"
+ " </td>"
+ " </tr>"
+ " <tr>"
+ " <td bgcolor=\"#FFFFFF\">"
+ " <p><b><font size=+1>Creatis 2012 - Lyon, France</font></b></p>"
+ " <font size=-1>"
+ " <table cellpadding=0 cellspacing=0 width=\"100%\">"
+ " <tr>"
+ " <td width=\"65%\">"
+ " <p>Created by Daniel González - daniel.gonzalez@creatis.insa-lyon.fr</p>"
+ " </td>"
+ " </tr>"
+ " </table>"
+ " <font size=1>"
+ " <p>This software is governed by the CeCILL-B license under French law and abiding by the rules of distribution of free software.</p>"
+ " </font>"
+ " </font>"
+ " </td>"
+ " </tr>"
+ "</table>"
+ "</body>"
+ "</html>"
+ ;
+
+ html -> SetPage(crea::std2wx(content));
html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(),
html -> GetInternalRepresentation() -> GetHeight());
//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(
}
}
- 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)
{
+ this->panel_Properties->Hide();
auiManager.DetachPane(this->panel_Properties);
this->panel_Properties->Destroy();
this->panel_Properties = NULL;
}
//set new view
-
+ auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
this->panel_Properties = description;
- //auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400).CloseButton(false));
auiManager.Update();
event.Skip();
}
case 0:
myItem = ((modelCDMIProjectTreeNode*)event.GetClientData());
//select out old one to generate selection event
- this->tree_Projects->SelectItem(myItem->GetId(), false);
+ this->tree_Projects->Unselect();
this->tree_Projects->SelectItem(myItem->GetId(), true);
this->tree_Projects->Expand(myItem->GetId());
break;
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());
+ //this->tree_Projects->Expand(this->model->GetProject()->GetId());
+ //this->tree_Projects->Unselect();
description = new wxCDMPackageManagerPanel(
this,
this->model->GetProject(),
}
else if(event.GetString() == wxT("blackbox"))
{
- this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
modelCDMBlackBox* bb = (modelCDMBlackBox*)event.GetClientData();
description = new wxCDMBlackBoxDescriptionPanel(
this,
);
}
- 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)
{
+ this->panel_Properties->Hide();
auiManager.DetachPane(this->panel_Properties);
this->panel_Properties->Destroy();
this->panel_Properties = NULL;
}
//set new view
-
+ auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
this->panel_Properties = description;
auiManager.Update();
+
break;
}
event.Skip();