From d5f5793ca845b49bb8ef8e7e3880f4373ce0c6bc Mon Sep 17 00:00:00 2001 From: Daniel Gonzalez Date: Mon, 10 Dec 2012 20:55:09 +0100 Subject: [PATCH] Feature #1711 CreaDevManager application implementation - Setting up tooltips and flow control with package manager, library manager and application manager - Fixed bug in Project Description view for tooltips. Still presented in other views --- .../wxCDMAppliDescriptionPanel.cpp | 12 +- .../wxCDMApplicationDescriptionPanel.cpp | 13 +- .../wxCDMLibDescriptionPanel.cpp | 12 +- lib/creaDevManagerLib/wxCDMMainFrame.cpp | 50 +++--- lib/creaDevManagerLib/wxCDMMainFrame.h | 4 +- .../wxCDMProjectActionsPanel.cpp | 4 +- .../wxCDMProjectDescriptionPanel.cpp | 142 +++++++++++------- 7 files changed, 142 insertions(+), 95 deletions(-) diff --git a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp index a7045a7..249ddfe 100644 --- a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp @@ -84,7 +84,9 @@ void wxCDMAppliDescriptionPanel::CreateControls() wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); //Link to return - sizer->Add(new wxButton(this, ID_BUTTON_PREV, wxT("Return to project")), 0, wxALIGN_CENTER | wxALL, 5); + wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project")); + returnbt->SetToolTip(wxT("Return to the active project description.")); + sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5); //Title sizer->Add(new wxStaticText(this, -1, _("Applications")),0, wxALIGN_CENTER, 0); @@ -110,8 +112,12 @@ void wxCDMAppliDescriptionPanel::CreateControls() wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL); sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20); - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_APPLICATION, _T("Create Application")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20); - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20); + wxButton* createApplicationbt = new wxButton(this, ID_BUTTON_CREATE_APPLICATION, _T("Create Application")); + createApplicationbt->SetToolTip(wxT("Create a new application for this project.")); + actionsBoxInnerSizer->Add(createApplicationbt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); + wxButton* editCMakebt = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")); + editCMakebt->SetToolTip(wxT("Open the system default text editor to edit the CMakeLists.txt file.")); + actionsBoxInnerSizer->Add(editCMakebt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); //Assign sizer actionsBoxInnerSizer->SetSizeHints(this); diff --git a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp index 23f9916..3e931b1 100644 --- a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp @@ -110,9 +110,16 @@ void wxCDMApplicationDescriptionPanel::CreateControls() wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL); sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20); - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_CLASS, _T("Create Class")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20); - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_FOLDER, _T("Create Folder")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20); - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20); + wxButton* createClassbt = new wxButton(this, ID_BUTTON_CREATE_CLASS, _T("Create Class")); + createClassbt->SetToolTip(wxT("Create a new Class (.h and .cxx files).")); + wxButton* createFolderbt = new wxButton(this, ID_BUTTON_CREATE_FOLDER, _T("Create Folder")); + createFolderbt->SetToolTip(wxT("Create a new Folder inside the application folder.")); + wxButton* editCMakebt = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")); + editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt file inside this application.")); + + actionsBoxInnerSizer->Add(createClassbt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); + actionsBoxInnerSizer->Add(createFolderbt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); + actionsBoxInnerSizer->Add(editCMakebt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); //Assign sizer actionsBoxInnerSizer->SetSizeHints(this); diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp index 653c769..f630190 100644 --- a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp @@ -84,7 +84,9 @@ void wxCDMLibDescriptionPanel::CreateControls() wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); //Link to return - sizer->Add(new wxButton(this, ID_BUTTON_PREV, wxT("Return to project")), 0, wxALIGN_CENTER | wxALL, 5); + wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project")); + returnbt->SetToolTip(wxT("Return to the active project description.")); + sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5); //Title sizer->Add(new wxStaticText(this, -1, _("Library Management")),0, wxALIGN_CENTER, 0); @@ -110,8 +112,12 @@ void wxCDMLibDescriptionPanel::CreateControls() wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL); sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20); - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_LIBRARY, _T("Create Library")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20); - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20); + wxButton* createLibrarybt = new wxButton(this, ID_BUTTON_CREATE_LIBRARY, _T("Create Library")); + createLibrarybt->SetToolTip(wxT("Create a new library for this project.")); + actionsBoxInnerSizer->Add(createLibrarybt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); + wxButton* editCMakebt = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")); + editCMakebt->SetToolTip(wxT("Open the system default text editor to edit the CMakeLists.txt file.")); + actionsBoxInnerSizer->Add(editCMakebt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); //Assign sizer actionsBoxInnerSizer->SetSizeHints(this); diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.cpp b/lib/creaDevManagerLib/wxCDMMainFrame.cpp index 98ff113..1785342 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.cpp +++ b/lib/creaDevManagerLib/wxCDMMainFrame.cpp @@ -33,6 +33,7 @@ #include #include "wx/treectrl.h" #include "wx/treebase.h" +#include "wx/tooltip.h" #include "CDMUtilities.h" #include "creaDevManagerIds.h" @@ -220,13 +221,15 @@ void wxCDMMainFrame::CreateControls() - 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 @@ -304,8 +307,8 @@ void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event) 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(); @@ -392,8 +395,8 @@ void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event) 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(); } @@ -437,7 +440,7 @@ void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event) 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(); @@ -473,7 +476,7 @@ void wxCDMMainFrame::OnMenuCloseAllProjects(wxCommandEvent& event) 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(); @@ -825,7 +828,7 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) if(this->panel_Properties!= NULL) this->panel_Properties->Hide(); - auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400)); + auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false)); auiManager.Update(); //delete old view @@ -837,7 +840,7 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) //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(); event.Skip(); return; @@ -850,6 +853,7 @@ 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(), false); this->tree_Projects->SelectItem(event.GetInt(), true); break; @@ -869,33 +873,21 @@ void wxCDMMainFrame::OnCreationComplete(wxCommandEvent& event) } else if(event.GetString() == wxT("manage_libraries")) { - description = new wxCDMLibDescriptionPanel( - this, - this->model->GetProject()->GetLib(), - ID_WINDOW_PROPERTIES, - wxT("Description Panel"), - wxDefaultPosition, - wxSize(600, 400), - 0 - ); + this->tree_Projects->SelectItem(this->model->GetProject()->GetLib()->GetId(), false); + this->tree_Projects->SelectItem(this->model->GetProject()->GetLib()->GetId(), true); + break; } else if(event.GetString() == wxT("manage_applications")) { - description = new wxCDMAppliDescriptionPanel( - this, - this->model->GetProject()->GetAppli(), - ID_WINDOW_PROPERTIES, - wxT("Description Panel"), - wxDefaultPosition, - wxSize(600, 400), - 0 - ); + this->tree_Projects->SelectItem(this->model->GetProject()->GetAppli()->GetId(), false); + 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("Properties")).BestSize(600,400)); + auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false)); auiManager.Update(); //delete old view diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.h b/lib/creaDevManagerLib/wxCDMMainFrame.h index a29fdd6..6a6b242 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.h +++ b/lib/creaDevManagerLib/wxCDMMainFrame.h @@ -42,7 +42,7 @@ class wxCDMMainFrame:public wxFrame public: wxCDMMainFrame( wxWindow* parent, - wxWindowID id = -1, + wxWindowID id = wxID_ANY, const wxString& caption = wxT("CREATIS CreaDevManager"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -53,7 +53,7 @@ public: bool Create( wxWindow* parent, - wxWindowID id = -1, + wxWindowID id = wxID_ANY, const wxString& caption = wxT("CREATIS CreaDevManager"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, diff --git a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp index ea9062f..1ad28aa 100755 --- a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp @@ -79,9 +79,9 @@ bool wxCDMProjectActionsPanel::Create( void wxCDMProjectActionsPanel::CreateControls() { wxButton* configurebt = new wxButton(this, ID_BUTTON_CONFIGURE_BUILD, _T("1. Configure Project")); - configurebt->SetToolTip(wxT("This is the first step in order to execute the project.")); + configurebt->SetToolTip(wxT("This is the first step in order to execute the project. Make sure you have selected the desired Build location.")); wxButton* compilebt = new wxButton(this, ID_BUTTON_BUILD_PROJECT, _T("2. Compile Project")); - compilebt->SetToolTip(wxT("This step should be done after configuring the project. This will create the executables")); + compilebt->SetToolTip(wxT("This step should be done after configuring the project. This will create the executables.")); wxButton* plugbt = new wxButton(this, ID_BUTTON_CONNECT_PROJECT, _T("3. Plug Packages (BBTK)")); plugbt->SetToolTip(wxT("This step should be done after compiling the project. This will allow to use the boxes in this project to be available in the bbEditor.")); this->GetSizer()->Add(configurebt, 0, wxALL, 5); diff --git a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp index e69c388..e293f8b 100644 --- a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp @@ -94,64 +94,104 @@ void wxCDMProjectDescriptionPanel::CreateControls() //Project Name sizer->Add(new wxStaticText(this, -1, crea::std2wx(this->project->GetName())),0, wxALIGN_CENTER, 0); - //Project Properties - wxStaticBox* propertiesBox = new wxStaticBox(this, -1, _T("&Properties")); - wxStaticBoxSizer* propertiesBoxInnerSizer = new wxStaticBoxSizer(propertiesBox, wxVERTICAL); - - wxFlexGridSizer* flexGridSizer = new wxFlexGridSizer(4, 2, 9, 15); - - wxStaticText* pVersion = new wxStaticText(this, -1, wxT("Version")); - wxStaticText* pVersionDate = new wxStaticText(this, -1, wxT("Version Date")); - wxStaticText* pSourceLocation = new wxStaticText(this, -1, wxT("Source Location")); - wxStaticText* pBuildLocation = new wxStaticText(this, -1, wxT("Build Location")); - - wxStaticText* pVersiontc = new wxStaticText(this, -1, crea::std2wx(this->project->GetVersion())); - wxStaticText* pVersionDatetc = new wxStaticText(this, -1, crea::std2wx(this->project->GetVersionDate())); - wxStaticText* pSourceLocationtc = new wxStaticText(this, -1, crea::std2wx(this->project->GetPath())); - wxStaticText* pBuildLocationtc = new wxStaticText(this, -1, crea::std2wx(this->project->GetBuildPath())); - - wxButton* pVersionbt = new wxButton(this, ID_BUTTON_SET_VERSION, wxT("Set")); - wxButton* pBuildLocationbt = new wxButton(this, ID_BUTTON_SET_BUILD_PATH, wxT("Choose")); - + //----------------------------------Project Properties----------------------------------- + //properties StaticBoxSizer + wxStaticBoxSizer* propertiesBox = new wxStaticBoxSizer(wxVERTICAL, this, _T("&Properties")); + //properties Panel + wxPanel* propertiesPanel = new wxPanel(this); + //properties Sizer + wxBoxSizer* propertiesPanelSizer = new wxBoxSizer(wxVERTICAL); + //propertiesGrid Sizer + wxFlexGridSizer* propertiesGridSizer = new wxFlexGridSizer(4, 2, 9, 15); + //properties elements + //labels + wxStaticText* pVersion = new wxStaticText(propertiesPanel, wxID_ANY, wxT("Version")); + wxStaticText* pVersionDate = new wxStaticText(propertiesPanel, wxID_ANY, wxT("Version Date")); + wxStaticText* pSourceLocation = new wxStaticText(propertiesPanel, wxID_ANY, wxT("Source Location")); + wxStaticText* pBuildLocation = new wxStaticText(propertiesPanel, wxID_ANY, wxT("Build Location")); + //values + // version wxBoxSizer* pVersionsz = new wxBoxSizer(wxHORIZONTAL); - wxBoxSizer* pBuildLocationsz = new wxBoxSizer(wxHORIZONTAL); - + wxStaticText* pVersiontc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->project->GetVersion())); + wxButton* pVersionbt = new wxButton(propertiesPanel, ID_BUTTON_SET_VERSION, wxT("Set")); + pVersionbt->SetToolTip(wxT("Update the version of the project.")); pVersionsz->Add(pVersiontc, 0, wxALIGN_CENTER_VERTICAL, 0); pVersionsz->Add(pVersionbt, 0, wxALIGN_CENTER | wxLEFT, 10); + // versionDate + wxStaticText* pVersionDatetc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetVersionDate())); + // sourceLocation + wxStaticText* pSourceLocationtc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetPath())); + pSourceLocationtc->SetMaxSize(wxSize(350,-1)); + // buildLocation + wxBoxSizer* pBuildLocationsz = new wxBoxSizer(wxHORIZONTAL); + wxStaticText* pBuildLocationtc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetBuildPath())); + pBuildLocationtc->SetMaxSize(wxSize(350,-1)); + wxButton* pBuildLocationbt = new wxButton(propertiesPanel, ID_BUTTON_SET_BUILD_PATH, wxT("Choose")); + pBuildLocationbt->SetToolTip(wxT("Select a new location for compiling the project.")); pBuildLocationsz->Add(pBuildLocationtc, 0, wxALIGN_CENTER, 0); pBuildLocationsz->Add(pBuildLocationbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10); - flexGridSizer->Add(pVersion, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - flexGridSizer->Add(pVersionsz, 1, wxEXPAND); - flexGridSizer->Add(pVersionDate, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - flexGridSizer->Add(pVersionDatetc, 1, wxEXPAND); - flexGridSizer->Add(pSourceLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - flexGridSizer->Add(pSourceLocationtc, 1, wxEXPAND); - flexGridSizer->Add(pBuildLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - flexGridSizer->Add(pBuildLocationsz, 1, wxEXPAND); - - flexGridSizer->AddGrowableCol(1,1); - - propertiesBoxInnerSizer -> Add(flexGridSizer, 0, wxALL | wxEXPAND, 5); - sizer -> Add(propertiesBoxInnerSizer, 0, wxEXPAND | wxALL, 10); - - //Actions - wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions")); - wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxHORIZONTAL); - sizer -> Add(actionsBoxInnerSizer, 0, wxEXPAND | wxALL, 10); + propertiesGridSizer->Add(pVersion, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + propertiesGridSizer->Add(pVersionsz, 1, wxEXPAND); + propertiesGridSizer->Add(pVersionDate, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + propertiesGridSizer->Add(pVersionDatetc, 1, wxEXPAND); + propertiesGridSizer->Add(pSourceLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + propertiesGridSizer->Add(pSourceLocationtc, 1, wxEXPAND); + propertiesGridSizer->Add(pBuildLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + propertiesGridSizer->Add(pBuildLocationsz, 1, wxEXPAND); + + propertiesGridSizer->AddGrowableCol(1,1); + + propertiesPanelSizer-> Add(propertiesGridSizer, 0, wxALL | wxEXPAND, 5); + + //SetPanel sizer and box + propertiesPanel->SetSizer(propertiesPanelSizer); + propertiesPanelSizer->Fit(propertiesPanel); + propertiesBox->Add(propertiesPanel, 1, wxEXPAND); + sizer->Add(propertiesBox, 0, wxEXPAND | wxALL, 10); + + //----------------------------------Project Actions-------------------------------------- + //actions StaticBoxSizer + wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxHORIZONTAL,this, _T("&Actions")); + //actions Panel + wxPanel* actionsPanel = new wxPanel(this); + //actions Sizer + wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL); + //buttons + // package manager + wxButton* packageMgrbt = new wxButton(actionsPanel, ID_BUTTON_GOTO_PACKAGE_MANAGER, _T("Package Manager")); + packageMgrbt->SetToolTip(wxT("Find the current available packages into this project. You can also create new Packages in this section.")); + actionsPanelSizer->Add(packageMgrbt, 0, wxALL, 5); + // lib manager + // show only if there is a lib folder + if(this->project->GetLib() != NULL) + { + wxButton* libMgrbt = new wxButton(actionsPanel, ID_BUTTON_GOTO_LIB_MANAGER, _T("Library Manager")); + libMgrbt->SetToolTip(wxT("Find the current available libraries into this project. You can also create new Libraries in this section as well as edit the lib folder's CMakeLists.txt file.")); + actionsPanelSizer->Add(libMgrbt, 0, wxALL, 5); + } + // appli manager + // show only if there is a appli folder + if(this->project->GetAppli() != NULL) + { + wxButton* appliMgrbt = new wxButton(actionsPanel, ID_BUTTON_GOTO_APPLI_MANAGER, _T("Application Manager")); + appliMgrbt->SetToolTip(wxT("Find the current available applications into this project. You can also create new Applications in this section as well as edit the appli folder's CMakeLists.txt file.")); + actionsPanelSizer->Add(appliMgrbt, 0, wxALL, 5); + } + // edit CMakeLists file + wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")); + editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt file of this project.")); + actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5); - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_GOTO_PACKAGE_MANAGER, _T("Package Manager")), 0, wxALL, 5); - //TODO: show only if there is a lib folder - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_GOTO_LIB_MANAGER, _T("Library Manager")), 0, wxALL, 5); - //TODO: show only if there is a appli folder - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_GOTO_APPLI_MANAGER, _T("Application Manager")), 0, wxALL, 5); + //SetPanel sizer and box + actionsPanel->SetSizer(actionsPanelSizer); + actionsPanelSizer->Fit(actionsPanel); + actionsBox->Add(actionsPanel, 1, wxEXPAND); + sizer->Add(actionsBox, 0, wxEXPAND | wxALL, 10); - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")), 0, wxALL, 5); //Assign sizer - actionsBoxInnerSizer->SetSizeHints(this); - - SetSizer(sizer); + this->SetSizer(sizer); sizer->SetSizeHints(this); } @@ -229,7 +269,7 @@ void wxCDMProjectDescriptionPanel::OnBtnCreateApplication(wxCommandEvent& event) void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) { //TODO: implement method - std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl; + std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl; event.Skip(); } @@ -250,8 +290,6 @@ wxCDMProjectDescriptionPanel::OnBtnManageLibraries(wxCommandEvent& event) wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); newEvent->SetId(1); newEvent->SetString(wxT("manage_libraries")); - //TODO: implement GetLib in project - //newEvent->SetInt(this->project->GetLib()->GetId()); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); } @@ -262,8 +300,6 @@ wxCDMProjectDescriptionPanel::OnBtnManageApplications(wxCommandEvent& event) wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); newEvent->SetId(1); newEvent->SetString(wxT("manage_applications")); - //TODO: implement GetAppli in project - //newEvent->SetInt(this->project->GetAppli->GetId()); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); } -- 2.45.1