From 5ff0bb2664c3cd508c1dd438666a71b8a96459c3 Mon Sep 17 00:00:00 2001 From: Daniel Gonzalez Date: Mon, 21 Jan 2013 19:03:59 +0100 Subject: [PATCH] Feature #1711 CreaDevManager application implementation - Changes for windows compatibility (wxTreeItemId conversions). --- .../wxCDMAppliDescriptionPanel.cpp | 33 +++++++++---------- .../wxCDMAppliHelpDialog.cpp | 9 ++--- .../wxCDMApplicationDescriptionPanel.cpp | 24 +++++--------- .../wxCDMApplicationHelpDialog.cpp | 18 ++++------ .../wxCDMBlackBoxDescriptionPanel.cpp | 20 ++++------- .../wxCDMBlackBoxHelpDialog.cpp | 18 ++++------ .../wxCDMCMakeListsDescriptionPanel.cpp | 2 +- .../wxCDMFileDescriptionPanel.cpp | 2 +- .../wxCDMFolderDescriptionPanel.cpp | 15 ++++----- .../wxCDMLibDescriptionPanel.cpp | 33 +++++++++---------- lib/creaDevManagerLib/wxCDMLibHelpDialog.cpp | 9 ++--- .../wxCDMLibraryDescriptionPanel.cpp | 15 ++++----- .../wxCDMLibraryHelpDialog.cpp | 18 ++++------ lib/creaDevManagerLib/wxCDMMainFrame.cpp | 24 ++++++++------ .../wxCDMPackageDescriptionPanel.cpp | 29 +++++++--------- .../wxCDMPackageHelpDialog.cpp | 18 ++++------ .../wxCDMPackageManagerHelpDialog.cpp | 6 ++-- .../wxCDMPackageManagerPanel.cpp | 33 +++++++++---------- .../wxCDMProjectDescriptionPanel.cpp | 29 ++++++---------- 19 files changed, 143 insertions(+), 212 deletions(-) diff --git a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp index 3cbe28d..7d59be0 100644 --- a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp @@ -209,7 +209,7 @@ void wxCDMAppliDescriptionPanel::OnBtnCreateApplication(wxCommandEvent& event) ((wxCDMMainFrame*)this->GetParent())->RefreshProject(); wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(application->GetId()); + newEvent->SetClientData(application); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); } @@ -225,8 +225,7 @@ void wxCDMAppliDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) if(this->appli->GetCMakeLists() != NULL) { - int CMId = this->appli->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->appli->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -234,23 +233,23 @@ void wxCDMAppliDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) void wxCDMAppliDescriptionPanel::OnLnkApplicationSelect(wxHyperlinkEvent& event) { - int applicationId = 0; + modelCDMApplication* applicationFound = NULL; std::vector applications = this->appli->GetApplications(); for (int i = 0; i < applications.size(); i++) { if(applications[i]->GetName() == crea::wx2std(event.GetURL())) { - applicationId = applications[i]->GetId(); + applicationFound = applications[i]; break; } } wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED); - newEvent1->SetInt(applicationId); + newEvent1->SetClientData(applicationFound); newEvent1->SetId(0); wxPostEvent(this->GetParent(), *newEvent1); wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(applicationId); + newEvent->SetClientData(applicationFound); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -265,7 +264,7 @@ void wxCDMAppliDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event) if (parents[i]->GetPath() == parentURL) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(parents[i]->GetId()); + newEvent->SetClientData(parents[i]); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -283,17 +282,17 @@ void wxCDMAppliDescriptionPanel::OnMouseEnter(wxMouseEvent& event) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED); std::string AppName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL()); - int appId = 0; + modelCDMApplication* theApp = NULL; std::vector applications = this->appli->GetApplications(); for (int i = 0; i < applications.size(); i++) { if(applications[i]->GetName() == AppName) { - appId = applications[i]->GetId(); + theApp = applications[i]; break; } } - newEvent->SetInt(appId); + newEvent->SetClientData(theApp); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); @@ -303,17 +302,17 @@ void wxCDMAppliDescriptionPanel::OnMouseExit(wxMouseEvent& event) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED); std::string AppName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL()); - int appId = 0; + modelCDMApplication* theApp = NULL; std::vector applications = this->appli->GetApplications(); for (int i = 0; i < applications.size(); i++) { if(applications[i]->GetName() == AppName) { - appId = applications[i]->GetId(); + theApp = applications[i]; break; } } - newEvent->SetInt(appId); + newEvent->SetClientData(theApp); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); @@ -325,8 +324,7 @@ void wxCDMAppliDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event) if(this->appli->GetCMakeLists() != NULL) { - int CMId = this->appli->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->appli->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -339,8 +337,7 @@ void wxCDMAppliDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event) if(this->appli->GetCMakeLists() != NULL) { - int CMId = this->appli->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->appli->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMAppliHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMAppliHelpDialog.cpp index 446c651..ec93c10 100644 --- a/lib/creaDevManagerLib/wxCDMAppliHelpDialog.cpp +++ b/lib/creaDevManagerLib/wxCDMAppliHelpDialog.cpp @@ -133,8 +133,7 @@ void wxCDMAppliHelpDialog::OnEditCMake(wxCommandEvent& event) if(this->appli->GetCMakeLists() != NULL) { - int CMId = this->appli->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->appli->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -147,8 +146,7 @@ void wxCDMAppliHelpDialog::OnCMakeListsEnter(wxMouseEvent& event) if(this->appli->GetCMakeLists() != NULL) { - int CMId = this->appli->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->appli->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -161,8 +159,7 @@ void wxCDMAppliHelpDialog::OnCMakeListsExit(wxMouseEvent& event) if(this->appli->GetCMakeLists() != NULL) { - int CMId = this->appli->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->appli->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp index 7e8c6dc..1ccf435 100644 --- a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp @@ -208,7 +208,7 @@ void wxCDMApplicationDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event) if (parents[i]->GetPath() == parentURL) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(parents[i]->GetId()); + newEvent->SetClientData(parents[i]); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -264,7 +264,7 @@ void wxCDMApplicationDescriptionPanel::OnBtnCreateClass(wxCommandEvent& event) wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); newEvent->SetId(0); - newEvent->SetInt(this->application->GetId()); + newEvent->SetClientData(this->application); wxPostEvent(this->GetParent(), *newEvent); wxMessageBox(crea::std2wx("The class has been created successfully."),_T("New Class - Success"),wxOK | wxICON_INFORMATION); @@ -297,7 +297,7 @@ void wxCDMApplicationDescriptionPanel::OnBtnCreateFolder(wxCommandEvent& event) } ((wxCDMMainFrame*)this->GetParent())->RefreshProject(); wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(folderC->GetId()); + newEvent->SetClientData(folderC); wxPostEvent(this->GetParent(), *newEvent); wxMessageBox(crea::std2wx("The folder was successfully created"),_T("Create Folder - Success"),wxOK | wxICON_INFORMATION); } @@ -317,8 +317,7 @@ void wxCDMApplicationDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event if(this->application->GetCMakeLists() != NULL) { - int CMId = this->application->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->application->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -339,8 +338,7 @@ void wxCDMApplicationDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event) if(this->application->GetCMakeLists() != NULL) { - int CMId = this->application->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->application->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -353,8 +351,7 @@ void wxCDMApplicationDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event) if(this->application->GetCMakeLists() != NULL) { - int CMId = this->application->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->application->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -372,8 +369,7 @@ void wxCDMApplicationDescriptionPanel::OnBtnOpenMain(wxCommandEvent& event) wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED); - int MId = this->application->GetMainFile()->GetId(); - newEvent->SetInt(MId); + newEvent->SetClientData(this->application->GetMainFile()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); @@ -391,8 +387,7 @@ void wxCDMApplicationDescriptionPanel::OnMainMouseEnter(wxMouseEvent& event) if(this->application->GetMainFile() != NULL) { - int MId = this->application->GetMainFile()->GetId(); - newEvent->SetInt(MId); + newEvent->SetClientData(this->application->GetMainFile()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -405,8 +400,7 @@ void wxCDMApplicationDescriptionPanel::OnMainMouseExit(wxMouseEvent& event) if(this->application->GetMainFile() != NULL) { - int MId = this->application->GetMainFile()->GetId(); - newEvent->SetInt(MId); + newEvent->SetClientData(this->application->GetMainFile()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMApplicationHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMApplicationHelpDialog.cpp index 8601b02..d4aa18d 100644 --- a/lib/creaDevManagerLib/wxCDMApplicationHelpDialog.cpp +++ b/lib/creaDevManagerLib/wxCDMApplicationHelpDialog.cpp @@ -150,8 +150,7 @@ void wxCDMApplicationHelpDialog::OnCMakeLists(wxCommandEvent& event) if(this->application->GetCMakeLists() != NULL) { - int CMId = this->application->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->application->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -172,8 +171,7 @@ void wxCDMApplicationHelpDialog::OnCMakeLists(wxCommandEvent& event) if(((modelCDMAppli*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMAppli*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMAppli*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -193,8 +191,7 @@ void wxCDMApplicationHelpDialog::OnCMakeListsEnter(wxMouseEvent& event) if(this->application->GetCMakeLists() != NULL) { - int CMId = this->application->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->application->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -212,8 +209,7 @@ void wxCDMApplicationHelpDialog::OnCMakeListsEnter(wxMouseEvent& event) if(((modelCDMAppli*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMAppli*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMAppli*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -230,8 +226,7 @@ void wxCDMApplicationHelpDialog::OnCMakeListsExit(wxMouseEvent& event) if(this->application->GetCMakeLists() != NULL) { - int CMId = this->application->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->application->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -249,8 +244,7 @@ void wxCDMApplicationHelpDialog::OnCMakeListsExit(wxMouseEvent& event) if(((modelCDMAppli*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMAppli*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMAppli*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp index 22a8f87..19385fe 100644 --- a/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp @@ -219,7 +219,7 @@ void wxCDMBlackBoxDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event) if (parents[i]->GetPath() == parentURL) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(parents[i]->GetId()); + newEvent->SetClientData(parents[i]); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -318,8 +318,7 @@ void wxCDMBlackBoxDescriptionPanel::OnBtnOpenCxx(wxCommandEvent& event) if(this->blackBox->GetSourceFile() != NULL) { - int CMId = this->blackBox->GetSourceFile()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->blackBox->GetSourceFile()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -337,8 +336,7 @@ void wxCDMBlackBoxDescriptionPanel::OnBtnOpenHxx(wxCommandEvent& event) if(this->blackBox->GetHeaderFile() != NULL) { - int CMId = this->blackBox->GetHeaderFile()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->blackBox->GetHeaderFile()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -359,8 +357,7 @@ void wxCDMBlackBoxDescriptionPanel::OnCxxMouseEnter(wxMouseEvent& event) if(this->blackBox->GetSourceFile() != NULL) { - int CMId = this->blackBox->GetSourceFile()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->blackBox->GetSourceFile()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -373,8 +370,7 @@ void wxCDMBlackBoxDescriptionPanel::OnCxxMouseExit(wxMouseEvent& event) if(this->blackBox->GetSourceFile() != NULL) { - int CMId = this->blackBox->GetSourceFile()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->blackBox->GetSourceFile()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -387,8 +383,7 @@ void wxCDMBlackBoxDescriptionPanel::OnHxxMouseEnter(wxMouseEvent& event) if(this->blackBox->GetHeaderFile() != NULL) { - int CMId = this->blackBox->GetHeaderFile()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->blackBox->GetHeaderFile()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -401,8 +396,7 @@ void wxCDMBlackBoxDescriptionPanel::OnHxxMouseExit(wxMouseEvent& event) if(this->blackBox->GetHeaderFile() != NULL) { - int CMId = this->blackBox->GetHeaderFile()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->blackBox->GetHeaderFile()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.cpp index e08ba65..d8f0c9e 100644 --- a/lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.cpp +++ b/lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.cpp @@ -159,8 +159,7 @@ void wxCDMBlackBoxHelpDialog::OnCMakeLists(wxCommandEvent& event) if(((modelCDMPackage*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMPackage*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMPackage*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -186,8 +185,7 @@ void wxCDMBlackBoxHelpDialog::OnCMakeLists(wxCommandEvent& event) if(((modelCDMProject*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMProject*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMProject*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -214,8 +212,7 @@ void wxCDMBlackBoxHelpDialog::OnCMakeListsEnter(wxMouseEvent& event) if(((modelCDMPackage*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMPackage*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMPackage*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -234,8 +231,7 @@ void wxCDMBlackBoxHelpDialog::OnCMakeListsEnter(wxMouseEvent& event) if(((modelCDMProject*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMProject*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMProject*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -259,8 +255,7 @@ void wxCDMBlackBoxHelpDialog::OnCMakeListsExit(wxMouseEvent& event) if(((modelCDMPackage*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMPackage*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMPackage*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -279,8 +274,7 @@ void wxCDMBlackBoxHelpDialog::OnCMakeListsExit(wxMouseEvent& event) if(((modelCDMProject*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMProject*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMProject*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp index b5ee362..6fd19d5 100644 --- a/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp @@ -149,7 +149,7 @@ void wxCDMCMakeListsDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event) if (parents[i]->GetPath() == parentURL) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(parents[i]->GetId()); + newEvent->SetClientData(parents[i]); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp index dad7ea8..990f3ec 100644 --- a/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp @@ -183,7 +183,7 @@ void wxCDMFileDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event) if (parents[i]->GetPath() == parentURL) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(parents[i]->GetId()); + newEvent->SetClientData(parents[i]); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp index 0168340..61a98cb 100644 --- a/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp @@ -166,7 +166,7 @@ void wxCDMFolderDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event) if (parents[i]->GetPath() == parentURL) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(parents[i]->GetId()); + newEvent->SetClientData(parents[i]); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -190,8 +190,7 @@ void wxCDMFolderDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) if(this->folder->GetCMakeLists() != NULL) { - int CMId = this->folder->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->folder->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -221,7 +220,7 @@ void wxCDMFolderDescriptionPanel::OnBtnCreateClass(wxCommandEvent& event) wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); newEvent->SetId(0); - newEvent->SetInt(folder->GetId()); + newEvent->SetClientData(folder); wxPostEvent(this->GetParent(), *newEvent); wxMessageBox(crea::std2wx("The class has been created successfully."),_T("New Class - Success"),wxOK | wxICON_INFORMATION); @@ -254,7 +253,7 @@ void wxCDMFolderDescriptionPanel::OnBtnCreateFolder(wxCommandEvent& event) } ((wxCDMMainFrame*)this->GetParent())->RefreshProject(); wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(folderC->GetId()); + newEvent->SetClientData(folderC); wxPostEvent(this->GetParent(), *newEvent); wxMessageBox(crea::std2wx("The folder was successfully created"),_T("Create Folder - Success"),wxOK | wxICON_INFORMATION); } @@ -270,8 +269,7 @@ void wxCDMFolderDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event) if(this->folder->GetCMakeLists() != NULL) { - int CMId = this->folder->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->folder->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -284,8 +282,7 @@ void wxCDMFolderDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event) if(this->folder->GetCMakeLists() != NULL) { - int CMId = this->folder->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->folder->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp index d05245b..551d12c 100644 --- a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp @@ -207,7 +207,7 @@ void wxCDMLibDescriptionPanel::OnBtnCreateLibrary(wxCommandEvent& event) ((wxCDMMainFrame*)this->GetParent())->RefreshProject(); wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(library->GetId()); + newEvent->SetClientData(library); wxPostEvent(this->GetParent(), *newEvent); } } @@ -222,8 +222,7 @@ void wxCDMLibDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) if(this->lib->GetCMakeLists() != NULL) { - int CMId = this->lib->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->lib->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -231,24 +230,24 @@ void wxCDMLibDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) void wxCDMLibDescriptionPanel::OnLnkLibrarySelect(wxHyperlinkEvent& event) { - int libraryId = 0; + modelCDMLibrary* theLibrary = NULL; std::vector libraries = this->lib->GetLibraries(); for (int i = 0; i < libraries.size(); i++) { if(libraries[i]->GetName() == crea::wx2std(event.GetURL())) { - libraryId = libraries[i]->GetId(); + theLibrary = libraries[i]; break; } } wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(libraryId); + newEvent->SetClientData(theLibrary); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED); - newEvent1->SetInt(libraryId); + newEvent1->SetClientData(theLibrary); newEvent1->SetId(0); wxPostEvent(this->GetParent(), *newEvent1); @@ -264,7 +263,7 @@ void wxCDMLibDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event) if (parents[i]->GetPath() == parentURL) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(parents[i]->GetId()); + newEvent->SetClientData(parents[i]); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -282,17 +281,17 @@ void wxCDMLibDescriptionPanel::OnMouseEnter(wxMouseEvent& event) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED); std::string LibName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL()); - int lbId = 0; + modelCDMLibrary* theLibrary = NULL; std::vector libraries = this->lib->GetLibraries(); for (int i = 0; i < libraries.size(); i++) { if(libraries[i]->GetName() == LibName) { - lbId = libraries[i]->GetId(); + theLibrary = libraries[i]; break; } } - newEvent->SetInt(lbId); + newEvent->SetClientData(theLibrary); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); @@ -302,17 +301,17 @@ void wxCDMLibDescriptionPanel::OnMouseExit(wxMouseEvent& event) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED); std::string LibName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL()); - int lbId = 0; + modelCDMLibrary* theLibrary = NULL; std::vector libraries = this->lib->GetLibraries(); for (int i = 0; i < libraries.size(); i++) { if(libraries[i]->GetName() == LibName) { - lbId = libraries[i]->GetId(); + theLibrary = libraries[i]; break; } } - newEvent->SetInt(lbId); + newEvent->SetClientData(theLibrary); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); @@ -324,8 +323,7 @@ void wxCDMLibDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event) if(this->lib->GetCMakeLists() != NULL) { - int CMId = this->lib->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->lib->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -338,8 +336,7 @@ void wxCDMLibDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event) if(this->lib->GetCMakeLists() != NULL) { - int CMId = this->lib->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->lib->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMLibHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMLibHelpDialog.cpp index 428e964..351406a 100644 --- a/lib/creaDevManagerLib/wxCDMLibHelpDialog.cpp +++ b/lib/creaDevManagerLib/wxCDMLibHelpDialog.cpp @@ -132,8 +132,7 @@ void wxCDMLibHelpDialog::OnEditCMake(wxCommandEvent& event) if(this->lib->GetCMakeLists() != NULL) { - int CMId = this->lib->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->lib->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -146,8 +145,7 @@ void wxCDMLibHelpDialog::OnEditCMakeMouseEnter(wxMouseEvent& event) if(this->lib->GetCMakeLists() != NULL) { - int CMId = this->lib->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->lib->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -160,8 +158,7 @@ void wxCDMLibHelpDialog::OnEditCMakeMouseExit(wxMouseEvent& event) if(this->lib->GetCMakeLists() != NULL) { - int CMId = this->lib->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->lib->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp index a164832..52d0d27 100644 --- a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp @@ -196,7 +196,7 @@ void wxCDMLibraryDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event) if (parents[i]->GetPath() == parentURL) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(parents[i]->GetId()); + newEvent->SetClientData(parents[i]); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -251,7 +251,7 @@ void wxCDMLibraryDescriptionPanel::OnBtnCreateClass(wxCommandEvent& event) wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); newEvent->SetId(0); - newEvent->SetInt(this->library->GetId()); + newEvent->SetClientData(this->library); wxPostEvent(this->GetParent(), *newEvent); wxMessageBox(crea::std2wx("The class has been created successfully."),_T("New Class - Success"),wxOK | wxICON_INFORMATION); @@ -284,7 +284,7 @@ void wxCDMLibraryDescriptionPanel::OnBtnCreateFolder(wxCommandEvent& event) } ((wxCDMMainFrame*)this->GetParent())->RefreshProject(); wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(folderC->GetId()); + newEvent->SetClientData(folderC); wxPostEvent(this->GetParent(), *newEvent); wxMessageBox(crea::std2wx("The folder was successfully created"),_T("Create Folder - Success"),wxOK | wxICON_INFORMATION); } @@ -304,8 +304,7 @@ void wxCDMLibraryDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) if(this->library->GetCMakeLists() != NULL) { - int CMId = this->library->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->library->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -326,8 +325,7 @@ void wxCDMLibraryDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event) if(this->library->GetCMakeLists() != NULL) { - int CMId = this->library->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->library->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -340,8 +338,7 @@ void wxCDMLibraryDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event) if(this->library->GetCMakeLists() != NULL) { - int CMId = this->library->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->library->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMLibraryHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMLibraryHelpDialog.cpp index 87e9974..13a7038 100644 --- a/lib/creaDevManagerLib/wxCDMLibraryHelpDialog.cpp +++ b/lib/creaDevManagerLib/wxCDMLibraryHelpDialog.cpp @@ -150,8 +150,7 @@ void wxCDMLibraryHelpDialog::OnCMakeLists(wxCommandEvent& event) if(this->library->GetCMakeLists() != NULL) { - int CMId = this->library->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->library->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -172,8 +171,7 @@ void wxCDMLibraryHelpDialog::OnCMakeLists(wxCommandEvent& event) if(((modelCDMLib*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMLib*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMLib*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -193,8 +191,7 @@ void wxCDMLibraryHelpDialog::OnCMakeListsEnter(wxMouseEvent& event) if(this->library->GetCMakeLists() != NULL) { - int CMId = this->library->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->library->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -212,8 +209,7 @@ void wxCDMLibraryHelpDialog::OnCMakeListsEnter(wxMouseEvent& event) if(((modelCDMLib*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMLib*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMLib*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -230,8 +226,7 @@ void wxCDMLibraryHelpDialog::OnCMakeListsExit(wxMouseEvent& event) if(this->library->GetCMakeLists() != NULL) { - int CMId = this->library->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->library->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -249,8 +244,7 @@ void wxCDMLibraryHelpDialog::OnCMakeListsExit(wxMouseEvent& event) if(((modelCDMLib*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMLib*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMLib*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.cpp b/lib/creaDevManagerLib/wxCDMMainFrame.cpp index 062552f..ec9543b 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.cpp +++ b/lib/creaDevManagerLib/wxCDMMainFrame.cpp @@ -790,13 +790,15 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) void wxCDMMainFrame::OnChangeView(wxCommandEvent& event) { + modelCDMIProjectTreeNode* myItem = NULL; switch(event.GetId()) { case 0: + myItem = ((modelCDMIProjectTreeNode*)event.GetClientData()); //select out old one to generate selection event - this->tree_Projects->SelectItem(event.GetInt(), false); - this->tree_Projects->SelectItem(event.GetInt(), true); - this->tree_Projects->Expand(event.GetInt()); + this->tree_Projects->SelectItem(myItem->GetId(), false); + this->tree_Projects->SelectItem(myItem->GetId(), true); + this->tree_Projects->Expand(myItem->GetId()); break; case 1: wxPanel* description = NULL; @@ -866,19 +868,21 @@ void wxCDMMainFrame::OnChangeView(wxCommandEvent& event) void wxCDMMainFrame::OnElementSelected(wxCommandEvent& event) { //std::cout << "element " << event.GetInt() << std::endl; - this->tree_Projects->EnsureVisible(event.GetInt()); - this->tree_Projects->SetItemBold(event.GetInt(), true); - this->tree_Projects->SetItemTextColour(event.GetInt(), wxColour(0,0,255)); - this->tree_Projects->SetItemBackgroundColour(event.GetInt(), wxColour(230,230,255)); + modelCDMIProjectTreeNode* item = (modelCDMIProjectTreeNode*)event.GetClientData(); + this->tree_Projects->EnsureVisible(item->GetId()); + this->tree_Projects->SetItemBold(item->GetId(), true); + this->tree_Projects->SetItemTextColour(item->GetId(), wxColour(0,0,255)); + this->tree_Projects->SetItemBackgroundColour(item->GetId(), wxColour(230,230,255)); this->tree_Projects->UpdateWindowUI(wxUPDATE_UI_RECURSE); auiManager.Update(); } void wxCDMMainFrame::OnElementDeselected(wxCommandEvent& event) { - this->tree_Projects->SetItemBold(event.GetInt(), false); - this->tree_Projects->SetItemTextColour(event.GetInt(), wxColour(0,0,0)); - this->tree_Projects->SetItemBackgroundColour(event.GetInt(), wxColour(255,255,255)); + modelCDMIProjectTreeNode* item = (modelCDMIProjectTreeNode*)event.GetClientData(); + this->tree_Projects->SetItemBold(item->GetId(), false); + this->tree_Projects->SetItemTextColour(item->GetId(), wxColour(0,0,0)); + this->tree_Projects->SetItemBackgroundColour(item->GetId(), wxColour(255,255,255)); this->tree_Projects->UpdateWindowUI(wxUPDATE_UI_RECURSE); auiManager.Update(); } diff --git a/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp index 447c5cb..bb06283 100644 --- a/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp @@ -253,7 +253,7 @@ void wxCDMPackageDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event) if (parents[i]->GetPath() == parentURL) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(parents[i]->GetId()); + newEvent->SetClientData(parents[i]); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -339,14 +339,12 @@ void wxCDMPackageDescriptionPanel::OnBtnSetDescription(wxCommandEvent& event) void wxCDMPackageDescriptionPanel::OnLnkBlackBoxSelect(wxHyperlinkEvent& event) { - int bbId = 0; modelCDMBlackBox* bb; std::vector bbs = this->package->GetSrc()->GetBlackBoxes(); for (int i = 0; i < bbs.size(); i++) { if(bbs[i]->GetName() == crea::wx2std(event.GetURL())) { - bbId = bbs[i]->GetHeaderFile()->GetId(); bb = bbs[i]; break; } @@ -359,7 +357,7 @@ void wxCDMPackageDescriptionPanel::OnLnkBlackBoxSelect(wxHyperlinkEvent& event) wxPostEvent(this->GetParent(), *newEvent); wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED); - newEvent1->SetInt(bbId); + newEvent1->SetClientData(bb); newEvent1->SetId(0); wxPostEvent(this->GetParent(), *newEvent1); @@ -401,7 +399,7 @@ void wxCDMPackageDescriptionPanel::OnBtnCreateBlackBox(wxCommandEvent& event) wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); newEvent->SetId(1); - newEvent->SetInt(blackBox->GetId()); + newEvent->SetClientData(blackBox); newEvent->SetString(wxT("blackbox")); newEvent->SetClientData(blackBox); wxPostEvent(this->GetParent(), *newEvent); @@ -418,8 +416,7 @@ void wxCDMPackageDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) if(this->package->GetCMakeLists() != NULL) { - int CMId = this->package->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->package->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -439,17 +436,17 @@ void wxCDMPackageDescriptionPanel::OnMouseEnter(wxMouseEvent& event) wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED); std::string BBName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL()); - int bbId = 0; + modelCDMFile* bbHeader = NULL; std::vector boxes = this->package->GetSrc()->GetBlackBoxes(); for (int i = 0; i < boxes.size(); i++) { if(boxes[i]->GetName() == BBName) { - bbId = boxes[i]->GetHeaderFile()->GetId(); + bbHeader = boxes[i]->GetHeaderFile(); break; } } - newEvent->SetInt(bbId); + newEvent->SetClientData(bbHeader); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); @@ -459,17 +456,17 @@ void wxCDMPackageDescriptionPanel::OnMouseExit(wxMouseEvent& event) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED); std::string BBName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL()); - int bbId = 0; + modelCDMFile* bbHeader = NULL; std::vector boxes = this->package->GetSrc()->GetBlackBoxes(); for (int i = 0; i < boxes.size(); i++) { if(boxes[i]->GetName() == BBName) { - bbId = boxes[i]->GetHeaderFile()->GetId(); + bbHeader = boxes[i]->GetHeaderFile(); break; } } - newEvent->SetInt(bbId); + newEvent->SetClientData(bbHeader); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); @@ -481,8 +478,7 @@ void wxCDMPackageDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event) if(this->package->GetCMakeLists() != NULL) { - int CMId = this->package->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->package->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -495,8 +491,7 @@ void wxCDMPackageDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event) if(this->package->GetCMakeLists() != NULL) { - int CMId = this->package->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->package->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMPackageHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMPackageHelpDialog.cpp index acd04fe..07d653a 100644 --- a/lib/creaDevManagerLib/wxCDMPackageHelpDialog.cpp +++ b/lib/creaDevManagerLib/wxCDMPackageHelpDialog.cpp @@ -141,8 +141,7 @@ void wxCDMPackageHelpDialog::OnCMakeLists(wxCommandEvent& event) if(this->package->GetCMakeLists() != NULL) { - int CMId = this->package->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->package->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -163,8 +162,7 @@ void wxCDMPackageHelpDialog::OnCMakeLists(wxCommandEvent& event) if(((modelCDMProject*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMProject*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMProject*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -184,8 +182,7 @@ void wxCDMPackageHelpDialog::OnCMakeListsEnter(wxMouseEvent& event) if(this->package->GetCMakeLists() != NULL) { - int CMId = this->package->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->package->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -203,8 +200,7 @@ void wxCDMPackageHelpDialog::OnCMakeListsEnter(wxMouseEvent& event) if(((modelCDMProject*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMProject*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMProject*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -221,8 +217,7 @@ void wxCDMPackageHelpDialog::OnCMakeListsExit(wxMouseEvent& event) if(this->package->GetCMakeLists() != NULL) { - int CMId = this->package->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->package->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -240,8 +235,7 @@ void wxCDMPackageHelpDialog::OnCMakeListsExit(wxMouseEvent& event) if(((modelCDMProject*)node)->GetCMakeLists() != NULL) { - int CMId = ((modelCDMProject*)node)->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(((modelCDMProject*)node)->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMPackageManagerHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMPackageManagerHelpDialog.cpp index a42f039..6af683d 100644 --- a/lib/creaDevManagerLib/wxCDMPackageManagerHelpDialog.cpp +++ b/lib/creaDevManagerLib/wxCDMPackageManagerHelpDialog.cpp @@ -161,8 +161,7 @@ void wxCDMPackageManagerHelpDialog::OnEditCMakeMouseEnter(wxMouseEvent& event) if(packageManager->GetProject()->GetCMakeLists() != NULL) { - int CMId = packageManager->GetProject()->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(packageManager->GetProject()->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -175,8 +174,7 @@ void wxCDMPackageManagerHelpDialog::OnEditCMakeMouseExit(wxMouseEvent& event) if(packageManager->GetProject()->GetCMakeLists() != NULL) { - int CMId = packageManager->GetProject()->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(packageManager->GetProject()->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp b/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp index 8356b65..cd3adf3 100644 --- a/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp @@ -175,31 +175,31 @@ modelCDMProject* wxCDMPackageManagerPanel::GetProject() const void wxCDMPackageManagerPanel::OnBtnReturn(wxHyperlinkEvent& event) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(project->GetId()); + newEvent->SetClientData(project); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } void wxCDMPackageManagerPanel::OnLnkPackageSelect(wxHyperlinkEvent& event) { - int packageId = 0; + modelCDMPackage* thePackage = NULL; std::vector packages = this->project->GetPackages(); for (int i = 0; i < packages.size(); i++) { if(packages[i]->GetName() == crea::wx2std(event.GetURL())) { - packageId = packages[i]->GetId(); + thePackage = packages[i]; break; } } wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(packageId); + newEvent->SetClientData(thePackage); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED); - newEvent1->SetInt(packageId); + newEvent1->SetClientData(thePackage); newEvent1->SetId(0); wxPostEvent(this->GetParent(), *newEvent1); @@ -237,7 +237,7 @@ void wxCDMPackageManagerPanel::OnBtnCreatePackage(wxCommandEvent& event) ((wxCDMMainFrame*)this->GetParent())->RefreshProject(); wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(package->GetId()); + newEvent->SetClientData(package); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); @@ -256,8 +256,7 @@ void wxCDMPackageManagerPanel::OnBtnEditCMakeLists(wxCommandEvent& event) if(this->project->GetCMakeLists() != NULL) { - int CMId = this->project->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->project->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -267,17 +266,17 @@ void wxCDMPackageManagerPanel::OnMouseEnter(wxMouseEvent& event) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED); std::string PkgName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL()); - int pkgId = 0; + modelCDMPackage* thePackage = NULL; std::vector packages = this->project->GetPackages(); for (int i = 0; i < packages.size(); i++) { if(packages[i]->GetName() == PkgName) { - pkgId = packages[i]->GetId(); + thePackage = packages[i]; break; } } - newEvent->SetInt(pkgId); + newEvent->SetClientData(thePackage); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); @@ -287,18 +286,18 @@ void wxCDMPackageManagerPanel::OnMouseExit(wxMouseEvent& event) { wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED); std::string PkgName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL()); - int pkgId = 0; + modelCDMPackage* thePackage = NULL; std::vector packages = this->project->GetPackages(); project->GetPackages(); for (int i = 0; i < packages.size(); i++) { if(packages[i]->GetName() == PkgName) { - pkgId = packages[i]->GetId(); + thePackage = packages[i]; break; } } - newEvent->SetInt(pkgId); + newEvent->SetClientData(thePackage); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); @@ -310,8 +309,7 @@ void wxCDMPackageManagerPanel::OnCMakeMouseEnter(wxMouseEvent& event) if(this->project->GetCMakeLists() != NULL) { - int CMId = this->project->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->project->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -324,8 +322,7 @@ void wxCDMPackageManagerPanel::OnCMakeMouseExit(wxMouseEvent& event) if(this->project->GetCMakeLists() != NULL) { - int CMId = this->project->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->project->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } diff --git a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp index 8a4c438..76aa9bb 100644 --- a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp @@ -244,7 +244,7 @@ void wxCDMProjectDescriptionPanel::OnBtnManagePackages(wxCommandEvent& event) wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); newEvent->SetId(1); newEvent->SetString(wxT("manage_packages")); - newEvent->SetInt(this->project->GetId()); + newEvent->SetClientData(this->project); wxPostEvent(this->GetParent(), *newEvent); event.Skip(); } @@ -260,8 +260,7 @@ void wxCDMProjectDescriptionPanel::OnBtnManageLibraries(wxCommandEvent& event) if(this->project->GetLib() != NULL) { - int CMId = this->project->GetLib()->GetId(); - newEvent1->SetInt(CMId); + newEvent1->SetClientData(this->project->GetLib()); newEvent1->SetId(0); wxPostEvent(this->GetParent(), *newEvent1); } @@ -280,8 +279,7 @@ void wxCDMProjectDescriptionPanel::OnBtnManageApplications(wxCommandEvent& event if(this->project->GetAppli() != NULL) { - int CMId = this->project->GetAppli()->GetId(); - newEvent1->SetInt(CMId); + newEvent1->SetClientData(this->project->GetAppli()); newEvent1->SetId(0); wxPostEvent(this->GetParent(), *newEvent1); } @@ -299,8 +297,7 @@ void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) if(this->project->GetCMakeLists() != NULL) { - int CMId = this->project->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->project->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -359,8 +356,7 @@ void wxCDMProjectDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event) if(this->project->GetCMakeLists() != NULL) { - int CMId = this->project->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->project->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -373,8 +369,7 @@ void wxCDMProjectDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event) if(this->project->GetCMakeLists() != NULL) { - int CMId = this->project->GetCMakeLists()->GetId(); - newEvent->SetInt(CMId); + newEvent->SetClientData(this->project->GetCMakeLists()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -387,8 +382,7 @@ void wxCDMProjectDescriptionPanel::OnAppliMouseEnter(wxMouseEvent& event) std::cout << "entra appli " << this->project->GetAppli()->GetCMakeLists(); if(this->project->GetAppli() != NULL) { - int AppId = this->project->GetAppli()->GetId(); - newEvent->SetInt(AppId); + newEvent->SetClientData(this->project->GetAppli()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -401,8 +395,7 @@ void wxCDMProjectDescriptionPanel::OnAppliMouseExit(wxMouseEvent& event) if(this->project->GetAppli() != NULL) { - int AppId = this->project->GetAppli()->GetId(); - newEvent->SetInt(AppId); + newEvent->SetClientData(this->project->GetAppli()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -415,8 +408,7 @@ void wxCDMProjectDescriptionPanel::OnLibMouseEnter(wxMouseEvent& event) if(this->project->GetLib() != NULL) { - int LbId = this->project->GetLib()->GetId(); - newEvent->SetInt(LbId); + newEvent->SetClientData(this->project->GetLib()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } @@ -429,8 +421,7 @@ void wxCDMProjectDescriptionPanel::OnLibMouseExit(wxMouseEvent& event) if(this->project->GetLib() != NULL) { - int LbId = this->project->GetLib()->GetId(); - newEvent->SetInt(LbId); + newEvent->SetClientData(this->project->GetLib()); newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } -- 2.47.1