From 94511d0d24fe76a082b14afeab79bcaf0d1ecf13 Mon Sep 17 00:00:00 2001 From: Daniel Felipe Gonzalez Date: Tue, 29 Jan 2013 18:15:03 +0100 Subject: [PATCH] Feature #1711 CreaDevManager application implementation - Changes for windows compatibility. Fixed change selection in treectrl and details show. --- .../wxCDMAppliDescriptionPanel.cpp | 7 ++- .../wxCDMApplicationDescriptionPanel.cpp | 3 +- .../wxCDMBlackBoxDescriptionPanel.cpp | 3 +- .../wxCDMCMakeListsDescriptionPanel.cpp | 3 +- .../wxCDMFileDescriptionPanel.cpp | 3 +- .../wxCDMFolderDescriptionPanel.cpp | 3 +- .../wxCDMLibDescriptionPanel.cpp | 9 +-- .../wxCDMLibraryDescriptionPanel.cpp | 5 +- lib/creaDevManagerLib/wxCDMMainFrame.cpp | 62 +++++++++++-------- lib/creaDevManagerLib/wxCDMMainFrame.h | 4 ++ .../wxCDMPackageDescriptionPanel.cpp | 9 +-- .../wxCDMPackageManagerPanel.cpp | 7 ++- .../wxCDMProjectsTreeCtrl.cxx | 1 + 13 files changed, 73 insertions(+), 46 deletions(-) diff --git a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp index 7c087cb..1378f60 100644 --- a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp @@ -93,7 +93,8 @@ void wxCDMAppliDescriptionPanel::CreateControls() std::vector parents = this->appli->GetParents(); for (int i = 0; i < (int)(parents.size()); i++) { - wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath())); + wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + returnLnk->SetWindowStyle(wxNO_BORDER); returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + ".")); linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5); if (i < (int)(parents.size())-1) @@ -125,8 +126,8 @@ void wxCDMAppliDescriptionPanel::CreateControls() std::vector applications = this->appli->GetApplications(); for (int i = 0; i < (int)(applications.size()); i++) { - wxHyperlinkCtrl* pApplicationlk = new wxHyperlinkCtrl(propertiesPanel,ID_LINK_SELECT_APPLICATION, crea::std2wx(applications[i]->GetName().c_str()), crea::std2wx(applications[i]->GetName().c_str())); - pApplicationlk->SetWindowStyle(wxALIGN_LEFT); + wxHyperlinkCtrl* pApplicationlk = new wxHyperlinkCtrl(propertiesPanel,ID_LINK_SELECT_APPLICATION, crea::std2wx(applications[i]->GetName().c_str()), crea::std2wx(applications[i]->GetName().c_str()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + pApplicationlk->SetWindowStyle(wxALIGN_LEFT | wxNO_BORDER); std::string tt = "Name: " + applications[i]->GetName() + "\n"; tt += "Location: " + applications[i]->GetPath(); pApplicationlk->SetToolTip(crea::std2wx(tt.c_str())); diff --git a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp index ec904c7..682236c 100644 --- a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp @@ -94,7 +94,8 @@ void wxCDMApplicationDescriptionPanel::CreateControls() std::vector parents = this->application->GetParents(); for (int i = 0; i < (int)(parents.size()); i++) { - wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath())); + wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + returnLnk->SetWindowStyle(wxNO_BORDER); returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + ".")); linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5); if (i < (int)(parents.size())-1) diff --git a/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp index 0d2eb5d..c511aff 100644 --- a/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp @@ -93,7 +93,8 @@ void wxCDMBlackBoxDescriptionPanel::CreateControls() std::vector parents = this->blackBox->GetParents(); for (int i = 0; i < (int)(parents.size()); i++) { - wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath())); + wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + returnLnk->SetWindowStyle(wxNO_BORDER); returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + ".")); linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5); if (i < (int)(parents.size())-1) diff --git a/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp index da4047d..9b61ae2 100644 --- a/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp @@ -87,7 +87,8 @@ void wxCDMCMakeListsDescriptionPanel::CreateControls() std::vector parents = this->cMakeLists->GetParents(); for (int i = 0; i < (int)(parents.size()); i++) { - wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath())); + wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + returnLnk->SetWindowStyle(wxNO_BORDER); returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + ".")); linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5); if (i < (int)(parents.size())-1) diff --git a/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp index 3f0e5f5..2c54eae 100644 --- a/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp @@ -89,7 +89,8 @@ void wxCDMFileDescriptionPanel::CreateControls() std::vector parents = this->file->GetParents(); for (int i = 0; i < (int)(parents.size()); i++) { - wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath())); + wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + returnLnk->SetWindowStyle(wxNO_BORDER); returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + ".")); linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5); if (i < (int)(parents.size())-1) diff --git a/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp index 1da28aa..69a5146 100644 --- a/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp @@ -90,7 +90,8 @@ void wxCDMFolderDescriptionPanel::CreateControls() std::vector parents = this->folder->GetParents(); for (int i = 0; i < (int)(parents.size()); i++) { - wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath())); + wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + returnLnk->SetWindowStyle(wxNO_BORDER); returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + ".")); linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5); if (i < (int)(parents.size())-1) diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp index 4cb2837..abc0a8e 100644 --- a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp @@ -91,8 +91,9 @@ void wxCDMLibDescriptionPanel::CreateControls() std::vector parents = this->lib->GetParents(); for (int i = 0; i < (int)(parents.size()); i++) { - wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath())); - returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + ".")); + wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + returnLnk->SetWindowStyle(wxNO_BORDER); + returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + ".")); linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5); if (i < (int)(parents.size())-1) { @@ -122,8 +123,8 @@ void wxCDMLibDescriptionPanel::CreateControls() std::vector libraries = this->lib->GetLibraries(); for (int i = 0; i < (int)(libraries.size()); i++) { - wxHyperlinkCtrl* pLibrarylk = new wxHyperlinkCtrl(propertiesPanel, ID_LINK_SELECT_LIBRARY, crea::std2wx(libraries[i]->GetName().c_str()), crea::std2wx(libraries[i]->GetName().c_str())); - pLibrarylk->SetWindowStyle(wxALIGN_LEFT); + wxHyperlinkCtrl* pLibrarylk = new wxHyperlinkCtrl(propertiesPanel, ID_LINK_SELECT_LIBRARY, crea::std2wx(libraries[i]->GetName().c_str()), crea::std2wx(libraries[i]->GetName().c_str()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + pLibrarylk->SetWindowStyle(wxALIGN_LEFT | wxNO_BORDER); std::string tt = "Name: " + libraries[i]->GetName() + "\n"; tt += "Location: " + libraries[i]->GetPath(); pLibrarylk->SetToolTip(crea::std2wx(tt.c_str())); diff --git a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp index 4bbf234..05ba6f3 100644 --- a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp @@ -93,8 +93,9 @@ void wxCDMLibraryDescriptionPanel::CreateControls() std::vector parents = this->library->GetParents(); for (int i = 0; i < (int)(parents.size()); i++) { - wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath())); - returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + ".")); + wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + returnLnk->SetWindowStyle(wxNO_BORDER); + returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + ".")); linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5); if (i < (int)(parents.size())-1) { diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.cpp b/lib/creaDevManagerLib/wxCDMMainFrame.cpp index 5017c44..9565b8a 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.cpp +++ b/lib/creaDevManagerLib/wxCDMMainFrame.cpp @@ -219,6 +219,7 @@ void wxCDMMainFrame::CreateControls() wxSize(200,400), wxTR_HAS_BUTTONS | wxTR_AQUA_BUTTONS ); + this->actualTreeItem.Unset(); panel_Properties = new wxCDMMainDescriptionPanel( this, @@ -298,8 +299,9 @@ void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event) auiManager.Update(); //populate tree control - tree_Projects->BuildTree(this->model->GetModelElements(),this->model->GetProject()); tree_Projects->Unselect(); + this->actualTreeItem.Unset(); + tree_Projects->BuildTree(this->model->GetModelElements(),this->model->GetProject()); tree_Projects->SelectItem(this->model->GetProject()->GetId().GetWxId()); wxMessageBox(wxT("ProjectSelected") ,_T("New Project - Success!"),wxOK | wxICON_ERROR); } @@ -344,12 +346,12 @@ void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event) std::cout << "building ui" << std::endl; //populate tree control + tree_Projects->Unselect(); + this->actualTreeItem.Unset(); tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject()); - tree_Projects->Unselect(); tree_Projects->SelectItem(this->model->GetProject()->GetId().GetWxId(), true); - //change project's actions panel if(this->panel_ProjectActions!= NULL) { @@ -374,8 +376,6 @@ void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event) auiManager.Update(); } - - event.Skip(); } void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event) @@ -389,18 +389,16 @@ void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event) } tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject()); - + this->actualTreeItem.Unset(); if(this->panel_Properties != NULL) { auiManager.DetachPane(this->panel_Properties); - this->panel_Properties->Destroy(); - this->panel_Properties = NULL; + this->panel_Properties->Hide(); } if(this->panel_ProjectActions != NULL) { auiManager.DetachPane(this->panel_ProjectActions); - this->panel_ProjectActions->Destroy(); - this->panel_ProjectActions = NULL; + this->panel_ProjectActions->Hide(); } this->panel_Properties = new wxCDMMainDescriptionPanel( @@ -415,7 +413,6 @@ void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event) auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false)); auiManager.Update(); - event.Skip(); } void wxCDMMainFrame::OnMenuExportHierarchy(wxCommandEvent& event) @@ -590,17 +587,24 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) //get selected element wxTreeItemId elementId = event.GetItem(); - if(elementId.IsOk() && this->tree_Projects->IsSelected(elementId)) + //elementId.IsOk() && this->tree_Projects->IsSelected(elementId) + if(elementId.IsOk() && this->actualTreeItem != elementId) { - std::cout << "Tree Selection id: " << elementId << std::endl; + + std::cout << "Tree Selection id: " << elementId.m_pItem << 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 + + //std::stringstream ss; + //ss << this->actualTreeItem.m_pItem << ":" << event.GetOldItem().m_pItem << " --> " << elementId.m_pItem; + //wxMessageBox( wxT("Tree Selection id: " + ss.str() + " by " + element->GetName()), wxT("Refresh Project - Error"), wxICON_ERROR); + this->actualTreeItem = elementId; + + //get element type //project modelCDMProject* elementProject = dynamic_cast(element); wxPanel* description; @@ -801,16 +805,19 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) { this->panel_Properties->Hide(); auiManager.DetachPane(this->panel_Properties); - this->panel_Properties->Destroy(); - this->panel_Properties = NULL; + //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(); - event.Skip(); } + else + { + event.Skip(); + } return; @@ -819,22 +826,24 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) void wxCDMMainFrame::OnChangeView(wxCommandEvent& event) { modelCDMIProjectTreeNode* myItem = NULL; + wxPanel* description = NULL; switch(event.GetId()) { case 0: myItem = ((modelCDMIProjectTreeNode*)event.GetClientData()); //select out old one to generate selection event this->tree_Projects->Unselect(); - this->tree_Projects->SelectItem(myItem->GetId().GetWxId(), true); + this->tree_Projects->SelectItem(myItem->GetId().GetWxId()); this->tree_Projects->Expand(myItem->GetId().GetWxId()); break; case 1: - wxPanel* description = NULL; + if(event.GetString() == wxT("manage_packages")) { //this->tree_Projects->Expand(this->model->GetProject()->GetId()); //this->tree_Projects->Unselect(); - description = new wxCDMPackageManagerPanel( + this->actualTreeItem.Unset(); + description = new wxCDMPackageManagerPanel( this, this->model->GetProject(), ID_WINDOW_PROPERTIES, @@ -846,19 +855,20 @@ void wxCDMMainFrame::OnChangeView(wxCommandEvent& event) } else if(event.GetString() == wxT("manage_libraries")) { - this->tree_Projects->SelectItem(this->model->GetProject()->GetLib()->GetId().GetWxId(), true); + this->tree_Projects->SelectItem(this->model->GetProject()->GetLib()->GetId().GetWxId()); this->tree_Projects->Expand(this->model->GetProject()->GetLib()->GetId().GetWxId()); break; } else if(event.GetString() == wxT("manage_applications")) { - this->tree_Projects->SelectItem(this->model->GetProject()->GetAppli()->GetId().GetWxId(), true); + this->tree_Projects->SelectItem(this->model->GetProject()->GetAppli()->GetId().GetWxId()); this->tree_Projects->Expand(this->model->GetProject()->GetAppli()->GetId().GetWxId()); break; } else if(event.GetString() == wxT("blackbox")) { modelCDMBlackBox* bb = (modelCDMBlackBox*)event.GetClientData(); + this->actualTreeItem.Unset(); description = new wxCDMBlackBoxDescriptionPanel( this, bb, @@ -868,6 +878,7 @@ void wxCDMMainFrame::OnChangeView(wxCommandEvent& event) wxSize(600, 400), 0 ); + } //delete old view @@ -882,10 +893,11 @@ void wxCDMMainFrame::OnChangeView(wxCommandEvent& event) auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false)); this->panel_Properties = description; auiManager.Update(); - break; + default: + event.Skip(); } - event.Skip(); + } void wxCDMMainFrame::OnElementSelected(wxCommandEvent& event) diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.h b/lib/creaDevManagerLib/wxCDMMainFrame.h index 5c440cc..9df0879 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.h +++ b/lib/creaDevManagerLib/wxCDMMainFrame.h @@ -151,6 +151,10 @@ private: * Tree control for an open project */ wxCDMProjectsTreeCtrl* tree_Projects; + /** + * Tree item for the selected item in the tree. + */ + wxTreeItemId actualTreeItem; /** * Description panel for a selected project item */ diff --git a/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp index a286867..bed6dc5 100644 --- a/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp @@ -101,8 +101,9 @@ void wxCDMPackageDescriptionPanel::CreateControls() std::vector parents = this->package->GetParents(); for (int i = 0; i < (int)(parents.size()); i++) { - wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath())); - returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + ".")); + wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + returnLnk->SetWindowStyle(wxNO_BORDER); + returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + ".")); linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5); if (i < (int)(parents.size())-1) { @@ -189,8 +190,8 @@ void wxCDMPackageDescriptionPanel::CreateControls() if(blackBoxes[i] != NULL) { - wxHyperlinkCtrl* pBBlk = new wxHyperlinkCtrl(BBPanel,ID_LINK_SELECT_BLACKBOX, crea::std2wx(blackBoxes[i]->GetName().c_str()), crea::std2wx(blackBoxes[i]->GetName().c_str())); - pBBlk->SetWindowStyle(wxALIGN_LEFT); + wxHyperlinkCtrl* pBBlk = new wxHyperlinkCtrl(BBPanel,ID_LINK_SELECT_BLACKBOX, crea::std2wx(blackBoxes[i]->GetName().c_str()), crea::std2wx(blackBoxes[i]->GetName().c_str()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + pBBlk->SetWindowStyle(wxALIGN_LEFT | wxNO_BORDER); std::string tt = "Author: " + blackBoxes[i]->GetAuthors() + "\nDescription: " + blackBoxes[i]->GetDescription() + "\nCategories: " + blackBoxes[i]->GetCategories(); pBBlk->SetToolTip(crea::std2wx(tt)); pBBlk->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageDescriptionPanel::OnMouseEnter,NULL,this); diff --git a/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp b/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp index 3176c56..543ac59 100644 --- a/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp @@ -89,7 +89,8 @@ void wxCDMPackageManagerPanel::CreateControls() wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); //Link to return - wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(this->project->GetName()), crea::std2wx(this->project->GetPath())); + wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(this->project->GetName()), crea::std2wx(this->project->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + returnLnk->SetWindowStyle(wxNO_BORDER); returnLnk->SetToolTip(wxT("Return to the active project description.")); sizer->Add(returnLnk, 0, wxALIGN_CENTER | wxALL, 5); @@ -115,8 +116,8 @@ void wxCDMPackageManagerPanel::CreateControls() std::vector packages = this->project->GetPackages(); for (int i = 0; i < (int)(packages.size()); i++) { - wxHyperlinkCtrl* pPackagelk = new wxHyperlinkCtrl(propertiesPanel,ID_LINK_SELECT_PACKAGE, crea::std2wx(packages[i]->GetName().c_str()), crea::std2wx(packages[i]->GetName().c_str())); - pPackagelk->SetWindowStyle(wxALIGN_LEFT); + wxHyperlinkCtrl* pPackagelk = new wxHyperlinkCtrl(propertiesPanel,ID_LINK_SELECT_PACKAGE, crea::std2wx(packages[i]->GetName().c_str()), crea::std2wx(packages[i]->GetName().c_str()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + pPackagelk->SetWindowStyle(wxALIGN_LEFT | wxNO_BORDER); std::string tt = "Author: " + packages[i]->GetAuthors() + "\nDescription: " + packages[i]->GetDescription(); pPackagelk->SetToolTip(crea::std2wx(tt)); propertiesPanelSizer -> Add(pPackagelk, 0, wxEXPAND | wxALL, 5); diff --git a/lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.cxx b/lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.cxx index 6f7e333..2d21718 100755 --- a/lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.cxx +++ b/lib/creaDevManagerLib/wxCDMProjectsTreeCtrl.cxx @@ -106,6 +106,7 @@ bool wxCDMProjectsTreeCtrl::Create( void wxCDMProjectsTreeCtrl::BuildTree(std::map< wxCDMTreeItemId, modelCDMIProjectTreeNode* >& modelElements, modelCDMProject* projectTree) { + this->Unselect(); std::cout << "building tree" << std::endl; this->DeleteAllItems(); modelElements.clear(); -- 2.45.0