]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/wxCDMProjectHelpDialog.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / wxCDMProjectHelpDialog.cpp
index e676a5503f46bfe287982c556778aac618ee2cc3..97b925add2e9015077a50991f5fa89374a14afaf 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "wxCDMProjectHelpDialog.h"
 
-#include "wxCDMMainFrame.h"
+#include "wxCDMProjectDescriptionPanel.h"
 
 #include "creaDevManagerIds.h"
 
@@ -49,6 +49,7 @@ END_EVENT_TABLE()
 
 wxCDMProjectHelpDialog::wxCDMProjectHelpDialog(
     wxWindow* parent,
+    wxCDMProjectDescriptionPanel* projectDescription,
     wxWindowID id,
     const wxString& caption,
     const wxPoint& position,
@@ -57,6 +58,7 @@ wxCDMProjectHelpDialog::wxCDMProjectHelpDialog(
 )
 {
   wxCDMProjectHelpDialog::Create(parent, id, caption, position, size, style);
+  this->projectDescription = projectDescription;
 }
 
 wxCDMProjectHelpDialog::~wxCDMProjectHelpDialog()
@@ -95,7 +97,7 @@ void wxCDMProjectHelpDialog::CreateControls()
           "Applications, just click in the \"Manage Libraries\" button or \"Manage Applications\" button to start working "
           "with them.\n"
           "\n"
-          "Select an action or click Finish to continue working on the project."),
+          "Select an action or click Close to continue working on the project."),
           wxDefaultPosition,
           wxDefaultSize,
           wxALIGN_LEFT
@@ -123,7 +125,7 @@ void wxCDMProjectHelpDialog::CreateControls()
 
   v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10);
 
-  v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Cancel")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
+  v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
 
   SetSizer(v_sizer1);
   //v_sizer1->RecalcSizes();
@@ -139,7 +141,7 @@ void wxCDMProjectHelpDialog::OnManagePackages(wxCommandEvent& event)
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
   newEvent->SetId(1);
   newEvent->SetString(wxT("manage_packages"));
-  newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId());
+  newEvent->SetInt(this->projectDescription->GetProject()->GetId());
   wxPostEvent(this->GetParent(), *newEvent);
   event.Skip();
 
@@ -155,9 +157,9 @@ void wxCDMProjectHelpDialog::OnManageLibraries(wxCommandEvent& event)
 
   wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
 
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib() != NULL)
+  if(this->projectDescription->GetProject()->GetLib() != NULL)
     {
-      int CMId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib()->GetId();
+      int CMId = this->projectDescription->GetProject()->GetLib()->GetId();
       newEvent1->SetInt(CMId);
       newEvent1->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent1);
@@ -177,9 +179,9 @@ void wxCDMProjectHelpDialog::OnManageApplications(wxCommandEvent& event)
 
   wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
 
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli() != NULL)
+  if(this->projectDescription->GetProject()->GetAppli() != NULL)
     {
-      int CMId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli()->GetId();
+      int CMId = this->projectDescription->GetProject()->GetAppli()->GetId();
       newEvent1->SetInt(CMId);
       newEvent1->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent1);
@@ -194,9 +196,9 @@ void wxCDMProjectHelpDialog::OnAppliMouseEnter(wxMouseEvent& event)
 {
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
 
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli() != NULL)
+  if(this->projectDescription->GetProject()->GetAppli() != NULL)
     {
-      int AppId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli()->GetId();
+      int AppId = this->projectDescription->GetProject()->GetAppli()->GetId();
       newEvent->SetInt(AppId);
       newEvent->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent);
@@ -208,9 +210,9 @@ void wxCDMProjectHelpDialog::OnAppliMouseExit(wxMouseEvent& event)
 {
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
 
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli() != NULL)
+  if(this->projectDescription->GetProject()->GetAppli() != NULL)
     {
-      int AppId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli()->GetId();
+      int AppId = this->projectDescription->GetProject()->GetAppli()->GetId();
       newEvent->SetInt(AppId);
       newEvent->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent);
@@ -222,9 +224,9 @@ void wxCDMProjectHelpDialog::OnLibMouseEnter(wxMouseEvent& event)
 {
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
 
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib() != NULL)
+  if(this->projectDescription->GetProject()->GetLib() != NULL)
     {
-      int LbId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib()->GetId();
+      int LbId = this->projectDescription->GetProject()->GetLib()->GetId();
       newEvent->SetInt(LbId);
       newEvent->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent);
@@ -236,9 +238,9 @@ void wxCDMProjectHelpDialog::OnLibMouseExit(wxMouseEvent& event)
 {
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
 
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib() != NULL)
+  if(this->projectDescription->GetProject()->GetLib() != NULL)
     {
-      int LbId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib()->GetId();
+      int LbId = this->projectDescription->GetProject()->GetLib()->GetId();
       newEvent->SetInt(LbId);
       newEvent->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent);