#include <creaWx.h>
#include "wx/treectrl.h"
#include "wx/treebase.h"
+#include "wx/tooltip.h"
#include "CDMUtilities.h"
#include "creaDevManagerIds.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)
END_EVENT_TABLE()
return TRUE;
}
+modelCDMMain* wxCDMMainFrame::GetModel() const
+{
+ return this->model;
+}
+
void wxCDMMainFrame::RefreshProject()
{
std::string* result;
- auiManager.AddPane(panel_Properties, wxAuiPaneInfo().BestSize(600,400).CenterPane().Name(wxT("panel_Properties")).Caption(wxT("Properties")));
- auiManager.AddPane(tree_Projects, wxAuiPaneInfo().Left().MinSize(300,300).BestSize(300,400).CloseButton(false).Name(wxT("tree_Projects")).Caption(wxT("Projects Tree")));
+ auiManager.AddPane(panel_Properties, wxAuiPaneInfo().BestSize(600,400).CenterPane().Name(wxT("panel_Properties")).Caption(wxT("")).CloseButton(false));
+ auiManager.AddPane(tree_Projects, wxAuiPaneInfo().Left().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.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(
{
auiManager.DetachPane(this->panel_Properties);
this->panel_ProjectActions->Destroy();
+ this->panel_ProjectActions = NULL;
}
panel_ProjectActions = new wxCDMProjectActionsPanel(
panel_ProjectActions->SetMinSize(wxSize(500, 100));
- auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400));
- auiManager.AddPane(panel_ProjectActions, wxAuiPaneInfo().Bottom().MinSize(800,50).Name(wxT("panel_ProjectActions")).Caption(wxT("Project Actions")).BestSize(800,70).CloseButton(false));
+ 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(
{
auiManager.DetachPane(this->panel_ProjectActions);
this->panel_ProjectActions->Destroy();
+ this->panel_ProjectActions = NULL;
}
panel_ProjectActions = new wxCDMProjectActionsPanel(
this,
panel_ProjectActions->SetMinSize(wxSize(500, 100));
- auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400));
- auiManager.AddPane(panel_ProjectActions, wxAuiPaneInfo().Bottom().MinSize(800,50).Name(wxT("panel_ProjectActions")).Caption(wxT("Project Actions")).BestSize(800,70).CloseButton(false));
+ 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;
}
if(this->panel_ProjectActions != NULL)
{
auiManager.DetachPane(this->panel_ProjectActions);
this->panel_ProjectActions->Destroy();
+ this->panel_ProjectActions = NULL;
}
this->panel_Properties = new wxCDMMainDescriptionPanel(
0
);
- auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400));
+ 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(
0
);
- auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400));
+ 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(600, 400),
- 0
- );
Close();
event.Skip();
}
void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
{
- std::cout << "New Tree Selection" << std::endl;
//get selected element
wxTreeItemId elementId = event.GetItem();
}
}
}
- description->Hide();
+
+ 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();
- 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, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400));
+ //auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400).CloseButton(false));
auiManager.Update();
- this->panel_Properties->Show(true);
event.Skip();
return;
void wxCDMMainFrame::OnCreationComplete(wxCommandEvent& event)
{
- std::cout << "inMainFrame " << event.GetInt() << std::endl;
- this->tree_Projects->SelectItem(event.GetInt());
+ switch(event.GetId() != 0)
+ {
+ case 0:
+ //select out old one to generate selection event
+ this->tree_Projects->SelectItem(event.GetInt(), true);
+ break;
+ case 1:
+ wxPanel* description = NULL;
+ if(event.GetString() == wxT("manage_packages"))
+ {
+ this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
+ 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);
+ break;
+ }
+ else if(event.GetString() == wxT("manage_applications"))
+ {
+ this->tree_Projects->SelectItem(this->model->GetProject()->GetAppli()->GetId(), true);
+ break;
+ }
+
+ 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();
}