X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FwxCDMMainFrame.cpp;h=ab6e16af43d0418e790435f5e525035e3f9e9f10;hb=b5874457abda388b3501cdfa57476de7c006c4ea;hp=6b8536a194ad31f50ae33ba5c4e592886a430173;hpb=f5cd0d2ab363ef8d6fd89d547ace70ca31d2bf3e;p=crea.git diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.cpp b/lib/creaDevManagerLib/wxCDMMainFrame.cpp index 6b8536a..ab6e16a 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.cpp +++ b/lib/creaDevManagerLib/wxCDMMainFrame.cpp @@ -51,6 +51,9 @@ #include "wxCDMLibraryDescriptionPanel.h" #include "wxCDMPackageDescriptionPanel.h" #include "wxCDMBlackBoxDescriptionPanel.h" +#include "wxCDMBBSFileDescriptionPanel.h" +#include "wxCDMBBGFileDescriptionPanel.h" +#include "wxCDMCodeFileDescriptionPanel.h" #include "wxCDMCMakeListsDescriptionPanel.h" #include "wxCDMFolderDescriptionPanel.h" #include "wxCDMFileDescriptionPanel.h" @@ -268,14 +271,25 @@ void wxCDMMainFrame::CreateControls() auiManager.SetManagedWindow(this); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 tree_Projects = new wxCDMProjectsTreeCtrl( this, ID_TREE_PROJECTS, wxDefaultPosition, wxSize(200,400), - wxTR_HAS_BUTTONS | wxTR_AQUA_BUTTONS - ); + wxTR_HAS_BUTTONS | wxTR_AQUA_BUTTONS ); this->actualTreeItem.Unset(); +#else + tree_Projects = new wxCDMProjectsTreeCtrl( + this, + ID_TREE_PROJECTS, + wxDefaultPosition, + wxSize(200,400), + wxTR_HAS_BUTTONS ); + this->actualTreeItem.Unset(); +#endif + panel_Properties = new wxCDMMainDescriptionPanel( this, @@ -409,7 +423,12 @@ void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event) wxT("Project Actions Panel"), wxDefaultPosition, wxSize(800,200), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); auiManager.AddPane(panel_ProjectActions, wxAuiPaneInfo().Bottom().MinSize(800,50).Name(wxT("panel_ProjectActions")).Caption(wxT("General Project Actions")).BestSize(800,70).CloseButton(false)); @@ -511,7 +530,12 @@ void wxCDMMainFrame::OnMenuOpenRecent(wxCommandEvent& event) wxT("Project Actions Panel"), wxDefaultPosition, wxSize(800,200), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); panel_ProjectActions->SetMinSize(wxSize(500, 100)); @@ -603,7 +627,12 @@ void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event) wxT("Project Actions Panel"), wxDefaultPosition, wxSize(800,200), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); panel_ProjectActions->SetMinSize(wxSize(500, 100)); @@ -878,12 +907,15 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) wxT("Description Panel"), wxDefaultPosition, wxSize(600, 400), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); - } - else - { + } else { //appli modelCDMAppli* elementAppli = dynamic_cast(element); if(elementAppli != NULL) @@ -896,12 +928,15 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) wxT("Description Panel"), wxDefaultPosition, wxSize(600, 400), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); - } - else - { + } else { //application modelCDMApplication* elementApplication = dynamic_cast(element); if(elementApplication != NULL) @@ -914,11 +949,14 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) wxT("Description Panel"), wxDefaultPosition, wxSize(600, 400), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); - } - else - { + } else { //lib modelCDMLib* elementLib = dynamic_cast(element); if(elementLib != NULL) @@ -931,11 +969,14 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) wxT("Description Panel"), wxDefaultPosition, wxSize(600, 400), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); - } - else - { + } else { //library modelCDMLibrary* elementLibrary = dynamic_cast(element); if(elementLibrary != NULL) @@ -948,11 +989,14 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) wxT("Description Panel"), wxDefaultPosition, wxSize(600, 400), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); - } - else - { + } else { //package modelCDMPackage* elementPackage = dynamic_cast(element); if(elementPackage != NULL) @@ -964,12 +1008,17 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) ID_WINDOW_PROPERTIES, wxT("Description Panel"), wxDefaultPosition, - wxSize(600, 400), - 0 + wxSize(600, 100), +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); - } - else - { + + + } else { //black box modelCDMBlackBox* elementBlackBox = dynamic_cast(element); if(elementBlackBox != NULL) @@ -982,11 +1031,14 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) wxT("Description Panel"), wxDefaultPosition, wxSize(600, 400), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); - } - else - { + } else { //CMakeLists modelCDMCMakeListsFile* elementCMakeLists = dynamic_cast(element); if(elementCMakeLists != NULL) @@ -999,56 +1051,132 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) wxT("Description Panel"), wxDefaultPosition, wxSize(600, 400), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); - } - else - { - //folder - modelCDMFolder* elementFolder = dynamic_cast(element); - if(elementFolder != NULL) + } else { + //CodeFile + modelCDMCodeFile* elementCodeFile = dynamic_cast(element); + if(elementCodeFile != NULL) { //create element description - description = new wxCDMFolderDescriptionPanel( + description = new wxCDMCodeFileDescriptionPanel( this, - elementFolder, + elementCodeFile, ID_WINDOW_PROPERTIES, wxT("Description Panel"), wxDefaultPosition, wxSize(600, 400), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); - } - else - { - //file - modelCDMFile* elementFile = dynamic_cast(element); - if(elementFile != NULL) + } else { + //BBSFile + modelCDMBBSFile* elementBBSFile = dynamic_cast(element); + if(elementBBSFile != NULL) { //create element description - description = new wxCDMFileDescriptionPanel( + description = new wxCDMBBSFileDescriptionPanel( this, - elementFile, + elementBBSFile, ID_WINDOW_PROPERTIES, wxT("Description Panel"), wxDefaultPosition, wxSize(600, 400), - 0 - ); - } - else - { - - //main if not any - //create element description - description = new wxCDMMainDescriptionPanel( - this, - ID_WINDOW_PROPERTIES, - wxT("Description Panel"), - wxDefaultPosition, - wxSize(600, 400), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); + } else { + //BBSFile + modelCDMBBGFile* elementBBGFile = dynamic_cast(element); + if(elementBBGFile != NULL) + { + //create element description + description = new wxCDMBBGFileDescriptionPanel( + this, + elementBBGFile, + ID_WINDOW_PROPERTIES, + wxT("Description Panel"), + wxDefaultPosition, + wxSize(600, 400), +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif + ); + } else { + //folder + modelCDMFolder* elementFolder = dynamic_cast(element); + if(elementFolder != NULL) + { + //create element description + description = new wxCDMFolderDescriptionPanel( + this, + elementFolder, + ID_WINDOW_PROPERTIES, + wxT("Description Panel"), + wxDefaultPosition, + wxSize(600, 400), +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif + ); + } else { + //file + modelCDMFile* elementFile = dynamic_cast(element); + if(elementFile != NULL) + { + //create element description + description = new wxCDMFileDescriptionPanel( + this, + elementFile, + ID_WINDOW_PROPERTIES, + wxT("Description Panel"), + wxDefaultPosition, + wxSize(600, 400), +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif + ); + } else { + //main if not any + //create element description + description = new wxCDMMainDescriptionPanel( + this, + ID_WINDOW_PROPERTIES, + wxT("Description Panel"), + wxDefaultPosition, + wxSize(600, 400), +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif + ); + } + } + } } } } @@ -1073,9 +1201,7 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) this->panel_Properties = description; auiManager.Update(); - } - else - { + } else { event.Skip(); } @@ -1110,7 +1236,12 @@ void wxCDMMainFrame::OnChangeView(wxCommandEvent& event) wxT("Description Panel"), wxDefaultPosition, wxSize(600, 400), - 0 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + 0 +#else + wxSHOW_SB_ALWAYS | wxVSCROLL +#endif ); } else if(event.GetString() == wxT("manage_libraries"))