]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/wxCDMProjectHelpDialog.cpp
Fixes:
[crea.git] / lib / creaDevManagerLib / wxCDMProjectHelpDialog.cpp
index e676a5503f46bfe287982c556778aac618ee2cc3..9a3a0b5b9c4261d4252c997313cfda04cdbc91d4 100644 (file)
 
 #include "wxCDMProjectHelpDialog.h"
 
-#include "wxCDMMainFrame.h"
+#include "wxCDMProjectDescriptionPanel.h"
 
 #include "creaDevManagerIds.h"
 
 BEGIN_EVENT_TABLE(wxCDMProjectHelpDialog, wxDialog)
 EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMProjectHelpDialog::OnFinish)
-EVT_BUTTON(ID_BUTTON_GOTO_PACKAGE_MANAGER, wxCDMProjectHelpDialog::OnManagePackages)
-EVT_BUTTON(ID_BUTTON_GOTO_LIB_MANAGER, wxCDMProjectHelpDialog::OnManageLibraries)
-EVT_BUTTON(ID_BUTTON_GOTO_APPLI_MANAGER, wxCDMProjectHelpDialog::OnManageApplications)
 EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMProjectHelpDialog::OnDisableHelp)
 END_EVENT_TABLE()
 
 wxCDMProjectHelpDialog::wxCDMProjectHelpDialog(
     wxWindow* parent,
+    modelCDMProject* project,
     wxWindowID id,
     const wxString& caption,
     const wxPoint& position,
@@ -57,6 +55,7 @@ wxCDMProjectHelpDialog::wxCDMProjectHelpDialog(
 )
 {
   wxCDMProjectHelpDialog::Create(parent, id, caption, position, size, style);
+  this->project = project;
 }
 
 wxCDMProjectHelpDialog::~wxCDMProjectHelpDialog()
@@ -81,6 +80,7 @@ bool wxCDMProjectHelpDialog::Create(
 
 void wxCDMProjectHelpDialog::CreateControls()
 {
+
   wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
 
 
@@ -90,40 +90,31 @@ void wxCDMProjectHelpDialog::CreateControls()
   wxStaticText* instruction = new wxStaticText(
       this,
       wxID_ANY,
-      crea::std2wx("When you create a project it comes with a default package. If you need to work in it or you want to create more "
-          "packages you can do it by clicking the \"Manage Packages\" button bellow. You can also work with Libraries and "
-          "Applications, just click in the \"Manage Libraries\" button or \"Manage Applications\" button to start working "
-          "with them.\n"
+      crea::std2wx(
+          "A project has four main elements:\n"
+          "- Packages: Host the black boxes you make.\n"
+          "- Libraries: Contain the core functions of your programs, they are called by the black boxes and applications you make.\n"
+          "- Applications: Stand alone programs that use the functions available on your libraries.\n"
+          "- Configuration file: Contains the information of what should or shouldn't be compiled from this project.\n"
           "\n"
-          "Select an action or click Finish to continue working on the project."),
+          "The Panel on the left is called \"Description Panel\" and show the details of the project item you are currently working on.\n"
+          "To the right of the description panel you will find a tree with the project structure and it's actual content.\n"
+          "Below the description panel you will find a panel with the project's main actions when you're ready to compile "
+          "the project. you can hover on this buttons to see more information about what they do. They must be executed in the displayed "
+          "order.\n"
+          "When you create a project it comes with a default package. If you need to work on it or if you want to create more "
+          "packages you can do it by clicking the \"Package Manager\" button below. You can also work with Libraries and "
+          "Applications. Just click in the \"Library Manager\" button or \"Application manager\" button to start working "
+          "with them.\n"),
           wxDefaultPosition,
           wxDefaultSize,
           wxALIGN_LEFT
   );
   v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
 
-  wxFlexGridSizer* formItems = new wxFlexGridSizer(2,2,9,15);
-
-  wxButton* managePackagesBtn = new wxButton(this, ID_BUTTON_GOTO_PACKAGE_MANAGER, wxT("Manage Packages"));
-  wxButton* manageLibrariesBtn = new wxButton(this, ID_BUTTON_GOTO_LIB_MANAGER, wxT("Manage Libraries"));
-  manageLibrariesBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectHelpDialog::OnLibMouseEnter,NULL,this);
-  manageLibrariesBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectHelpDialog::OnLibMouseExit,NULL,this);
-  wxButton* manageApplicationsBtn = new wxButton(this, ID_BUTTON_GOTO_APPLI_MANAGER, wxT("Manage Applications"));
-  manageApplicationsBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectHelpDialog::OnAppliMouseEnter,NULL,this);
-  manageApplicationsBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectHelpDialog::OnAppliMouseExit,NULL,this);
-
-  formItems->Add(managePackagesBtn, 1, wxALIGN_CENTER_VERTICAL);
-  formItems->Add(manageLibrariesBtn, 1, wxALIGN_CENTER_VERTICAL);
-  formItems->Add(manageApplicationsBtn, 1, wxALIGN_CENTER_VERTICAL);
-
-  formItems->AddGrowableCol(0,1);
-  formItems->AddGrowableCol(1,1);
-
-  v_sizer1->Add(formItems, 1, wxEXPAND | wxALL, 15);
-
   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();
@@ -134,118 +125,6 @@ void wxCDMProjectHelpDialog::OnFinish(wxCommandEvent& event)
   this->EndDialog(wxID_CANCEL);
 }
 
-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());
-  wxPostEvent(this->GetParent(), *newEvent);
-  event.Skip();
-
-  this->EndDialog(wxID_OK);
-}
-
-void wxCDMProjectHelpDialog::OnManageLibraries(wxCommandEvent& event)
-{
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-  newEvent->SetId(1);
-  newEvent->SetString(wxT("manage_libraries"));
-  wxPostEvent(this->GetParent(), *newEvent);
-
-  wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
-
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib() != NULL)
-    {
-      int CMId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib()->GetId();
-      newEvent1->SetInt(CMId);
-      newEvent1->SetId(0);
-      wxPostEvent(this->GetParent(), *newEvent1);
-    }
-
-  event.Skip();
-
-  this->EndDialog(wxID_OK);
-}
-
-void wxCDMProjectHelpDialog::OnManageApplications(wxCommandEvent& event)
-{
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-  newEvent->SetId(1);
-  newEvent->SetString(wxT("manage_applications"));
-  wxPostEvent(this->GetParent(), *newEvent);
-
-  wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
-
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli() != NULL)
-    {
-      int CMId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli()->GetId();
-      newEvent1->SetInt(CMId);
-      newEvent1->SetId(0);
-      wxPostEvent(this->GetParent(), *newEvent1);
-    }
-
-  event.Skip();
-
-  this->EndDialog(wxID_OK);
-}
-
-void wxCDMProjectHelpDialog::OnAppliMouseEnter(wxMouseEvent& event)
-{
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
-
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli() != NULL)
-    {
-      int AppId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli()->GetId();
-      newEvent->SetInt(AppId);
-      newEvent->SetId(0);
-      wxPostEvent(this->GetParent(), *newEvent);
-    }
-  event.Skip();
-}
-
-void wxCDMProjectHelpDialog::OnAppliMouseExit(wxMouseEvent& event)
-{
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
-
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli() != NULL)
-    {
-      int AppId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli()->GetId();
-      newEvent->SetInt(AppId);
-      newEvent->SetId(0);
-      wxPostEvent(this->GetParent(), *newEvent);
-    }
-  event.Skip();
-}
-
-void wxCDMProjectHelpDialog::OnLibMouseEnter(wxMouseEvent& event)
-{
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
-
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib() != NULL)
-    {
-      int LbId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib()->GetId();
-      newEvent->SetInt(LbId);
-      newEvent->SetId(0);
-      wxPostEvent(this->GetParent(), *newEvent);
-    }
-  event.Skip();
-}
-
-void wxCDMProjectHelpDialog::OnLibMouseExit(wxMouseEvent& event)
-{
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
-
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib() != NULL)
-    {
-      int LbId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib()->GetId();
-      newEvent->SetInt(LbId);
-      newEvent->SetId(0);
-      wxPostEvent(this->GetParent(), *newEvent);
-    }
-  event.Skip();
-}
-
 void wxCDMProjectHelpDialog::OnDisableHelp(wxCommandEvent& event)
 {
   wxPostEvent(this->GetParent(), event);