#include "creaDevManagerIds.h"
+
BEGIN_EVENT_TABLE(wxCDMAppliHelpDialog, wxDialog)
EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMAppliHelpDialog::OnFinish)
EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMAppliHelpDialog::OnEditCMake)
);
v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
+ wxButton* editCMakeAppliBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Edit Appli's CMakeLists File"));
+ editCMakeAppliBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMAppliHelpDialog::OnCMakeListsEnter,NULL,this);
+ editCMakeAppliBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMAppliHelpDialog::OnCMakeListsExit,NULL,this);
+ v_sizer1->Add(editCMakeAppliBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 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("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
void wxCDMAppliHelpDialog::OnEditCMake(wxCommandEvent& event)
{
- //TODO: implement method
- std::cout << "OnEditCMake not implemented yet." << std::endl;
- event.Skip();
+ std::string* result;
+ if(!this->appli->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->appli->GetCMakeLists() != NULL)
+ {
+ int CMId = this->appli->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
}
-void wxCDMAppliHelpDialog::OnEditCMakeMouseEnter(wxMouseEvent& event)
+void wxCDMAppliHelpDialog::OnCMakeListsEnter(wxMouseEvent& event)
{
- //TODO: implement method
- std::cout << "OnEditCMakeEnter not implemented yet." << std::endl;
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(this->appli->GetCMakeLists() != NULL)
+ {
+ int CMId = this->appli->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
event.Skip();
}
-void wxCDMAppliHelpDialog::OnEditCMakeMouseExit(wxMouseEvent& event)
+void wxCDMAppliHelpDialog::OnCMakeListsExit(wxMouseEvent& event)
{
- //TODO: implement method
- std::cout << "OnEditCMakeExit not implemented yet." << std::endl;
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->appli->GetCMakeLists() != NULL)
+ {
+ int CMId = this->appli->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
event.Skip();
}
void OnEditCMake(wxCommandEvent& event);
- void OnEditCMakeMouseEnter(wxMouseEvent& event);
- void OnEditCMakeMouseExit(wxMouseEvent& event);
+ void OnCMakeListsEnter(wxMouseEvent& event);
+ void OnCMakeListsExit(wxMouseEvent& event);
void OnDisableHelp(wxCommandEvent& event);
};
#include "creaDevManagerIds.h"
+#include "modelCDMAppli.h"
+
BEGIN_EVENT_TABLE(wxCDMApplicationHelpDialog, wxDialog)
EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMApplicationHelpDialog::OnFinish)
EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMApplicationHelpDialog::OnCMakeLists)
);
v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
- wxButton* editCMakePKGBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Open Application's directory CMakeLists file"));
- wxButton* editCMakePRJBtn= new wxButton(this, ID_BUTTON_OPENPROJECT, wxT("Open Appli's directory CMakeLists file"));
+ wxButton* editCMakeApplicationBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Open Application's directory CMakeLists file"));
+ editCMakeApplicationBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationHelpDialog::OnCMakeListsEnter,NULL,this);
+ editCMakeApplicationBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationHelpDialog::OnCMakeListsExit,NULL,this);
+ wxButton* editCMakeAppliBtn= new wxButton(this, ID_BUTTON_OPENPROJECT, wxT("Open Appli's directory CMakeLists file"));
+ editCMakeAppliBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationHelpDialog::OnCMakeListsEnter,NULL,this);
+ editCMakeAppliBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationHelpDialog::OnCMakeListsExit,NULL,this);
- v_sizer1->Add(editCMakePKGBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
- v_sizer1->Add(editCMakePRJBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
+ v_sizer1->Add(editCMakeApplicationBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
+ v_sizer1->Add(editCMakeAppliBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10);
void wxCDMApplicationHelpDialog::OnCMakeLists(wxCommandEvent& event)
{
- //TODO: implement method
- std::cout << "OnCMakeLists not implemented yet." << std::endl;
- event.Skip();
+ std::string* result;
+
+ if((int)((wxButton*)event.GetEventObject())->GetId() == (int)ID_BUTTON_EDIT_CMAKELISTSFILE)
+ {
+
+ if(!this->application->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->application->GetCMakeLists() != NULL)
+ {
+ int CMId = this->application->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_OPENPROJECT)
+ {
+ modelCDMIProjectTreeNode* node = this->application;
+ while (node != NULL && dynamic_cast<modelCDMAppli*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ if(!((modelCDMAppli*)node)->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(((modelCDMAppli*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMAppli*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else
+ {
+ wxMessageBox(crea::std2wx("No project CMakeLists file was found."),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+ }
+ }
}
void wxCDMApplicationHelpDialog::OnCMakeListsEnter(wxMouseEvent& event)
{
- //TODO: implement method
- std::cout << "OnCMakeListsEnter not implemented yet." << std::endl;
+ if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_EDIT_CMAKELISTSFILE)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(this->application->GetCMakeLists() != NULL)
+ {
+ int CMId = this->application->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_OPENPROJECT)
+ {
+ modelCDMIProjectTreeNode* node = this->application;
+ while (node != NULL && dynamic_cast<modelCDMAppli*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(((modelCDMAppli*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMAppli*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ }
event.Skip();
}
void wxCDMApplicationHelpDialog::OnCMakeListsExit(wxMouseEvent& event)
{
- //TODO: implement method
- std::cout << "OnCMakeListsExit not implemented yet." << std::endl;
+ if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_EDIT_CMAKELISTSFILE)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->application->GetCMakeLists() != NULL)
+ {
+ int CMId = this->application->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_OPENPROJECT)
+ {
+ modelCDMIProjectTreeNode* node = this->application;
+ while (node != NULL && dynamic_cast<modelCDMAppli*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(((modelCDMAppli*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMAppli*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ }
event.Skip();
}
#include "creaDevManagerIds.h"
+#include "modelCDMProject.h"
+#include "modelCDMPackage.h"
+
BEGIN_EVENT_TABLE(wxCDMBlackBoxHelpDialog, wxDialog)
EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMBlackBoxHelpDialog::OnFinish)
EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMBlackBoxHelpDialog::OnCMakeLists)
);
v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
- wxButton* editCMakePKGBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Open Package's directory CMakeLists file"));
- wxButton* editCMakePRJBtn= new wxButton(this, ID_BUTTON_OPENPROJECT, wxT("Open Project's directory CMakeLists file"));
+ wxButton* editCMakePkgBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Open Package's directory CMakeLists file"));
+ editCMakePkgBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMBlackBoxHelpDialog::OnCMakeListsEnter,NULL,this);
+ editCMakePkgBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMBlackBoxHelpDialog::OnCMakeListsExit,NULL,this);
+ wxButton* editCMakePrjBtn= new wxButton(this, ID_BUTTON_OPENPROJECT, wxT("Open Project's directory CMakeLists file"));
+ editCMakePrjBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMBlackBoxHelpDialog::OnCMakeListsEnter,NULL,this);
+ editCMakePrjBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMBlackBoxHelpDialog::OnCMakeListsExit,NULL,this);
- v_sizer1->Add(editCMakePKGBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
- v_sizer1->Add(editCMakePRJBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
+ v_sizer1->Add(editCMakePkgBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
+ v_sizer1->Add(editCMakePrjBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10);
void wxCDMBlackBoxHelpDialog::OnCMakeLists(wxCommandEvent& event)
{
- //TODO: implement method
- std::cout << "OnCMakeLists not implemented yet." << std::endl;
- event.Skip();
+ std::string* result;
+
+ if((int)((wxButton*)event.GetEventObject())->GetId() == (int)ID_BUTTON_EDIT_CMAKELISTSFILE)
+ {
+ modelCDMIProjectTreeNode* node = this->blackBox;
+ while (node != NULL && dynamic_cast<modelCDMPackage*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ if(!((modelCDMPackage*)node)->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(((modelCDMPackage*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMPackage*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else
+ {
+ wxMessageBox(crea::std2wx("No project CMakeLists file was found."),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+ }
+ }
+ else if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_OPENPROJECT)
+ {
+ modelCDMIProjectTreeNode* node = this->blackBox;
+ while (node != NULL && dynamic_cast<modelCDMProject*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ if(!((modelCDMProject*)node)->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(((modelCDMProject*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMProject*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else
+ {
+ wxMessageBox(crea::std2wx("No project CMakeLists file was found."),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+ }
+ }
}
void wxCDMBlackBoxHelpDialog::OnCMakeListsEnter(wxMouseEvent& event)
{
- //TODO: implement method
- std::cout << "OnCMakeListsEnter not implemented yet." << std::endl;
+ if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_EDIT_CMAKELISTSFILE)
+ {
+ modelCDMIProjectTreeNode* node = this->blackBox;
+ while (node != NULL && dynamic_cast<modelCDMPackage*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(((modelCDMPackage*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMPackage*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ }
+ else if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_OPENPROJECT)
+ {
+ modelCDMIProjectTreeNode* node = this->blackBox;
+ while (node != NULL && dynamic_cast<modelCDMProject*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(((modelCDMProject*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMProject*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ }
event.Skip();
}
void wxCDMBlackBoxHelpDialog::OnCMakeListsExit(wxMouseEvent& event)
{
- //TODO: implement method
- std::cout << "OnCMakeListsExit not implemented yet." << std::endl;
- event.Skip();
+ if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_EDIT_CMAKELISTSFILE)
+ {
+ modelCDMIProjectTreeNode* node = this->blackBox;
+ while (node != NULL && dynamic_cast<modelCDMPackage*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(((modelCDMPackage*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMPackage*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ }
+ else if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_OPENPROJECT)
+ {
+ modelCDMIProjectTreeNode* node = this->blackBox;
+ while (node != NULL && dynamic_cast<modelCDMProject*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(((modelCDMProject*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMProject*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ }
+ event.Skip();
}
void wxCDMBlackBoxHelpDialog::OnDisableHelp(wxCommandEvent& event)
);
v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
+ wxButton* editCMakeLibBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Edit Lib's CMakeLists File"));
+ editCMakeLibBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibHelpDialog::OnEditCMakeMouseEnter,NULL,this);
+ editCMakeLibBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibHelpDialog::OnEditCMakeMouseExit,NULL,this);
+ v_sizer1->Add(editCMakeLibBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 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("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
void wxCDMLibHelpDialog::OnEditCMake(wxCommandEvent& event)
{
- //TODO: implement method
- std::cout << "OnEditCMake not implemented yet." << std::endl;
- event.Skip();
+ std::string* result;
+ if(!this->lib->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->lib->GetCMakeLists() != NULL)
+ {
+ int CMId = this->lib->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
}
void wxCDMLibHelpDialog::OnEditCMakeMouseEnter(wxMouseEvent& event)
{
- //TODO: implement method
- std::cout << "OnEditCMakeEnter not implemented yet." << std::endl;
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(this->lib->GetCMakeLists() != NULL)
+ {
+ int CMId = this->lib->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
event.Skip();
}
void wxCDMLibHelpDialog::OnEditCMakeMouseExit(wxMouseEvent& event)
{
- //TODO: implement method
- std::cout << "OnEditCMakeExit not implemented yet." << std::endl;
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->lib->GetCMakeLists() != NULL)
+ {
+ int CMId = this->lib->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
event.Skip();
}
#include "creaDevManagerIds.h"
+#include "modelCDMLib.h"
+
BEGIN_EVENT_TABLE(wxCDMLibraryHelpDialog, wxDialog)
EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMLibraryHelpDialog::OnFinish)
EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMLibraryHelpDialog::OnCMakeLists)
);
v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
- wxButton* editCMakePKGBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Open Library's directory CMakeLists file"));
- wxButton* editCMakePRJBtn= new wxButton(this, ID_BUTTON_OPENPROJECT, wxT("Open Lib's directory CMakeLists file"));
+ wxButton* editCMakeLibraryBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Open Library's directory CMakeLists file"));
+ editCMakeLibraryBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibraryHelpDialog::OnCMakeListsEnter,NULL,this);
+ editCMakeLibraryBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibraryHelpDialog::OnCMakeListsExit,NULL,this);
+ wxButton* editCMakeLibBtn= new wxButton(this, ID_BUTTON_OPENPROJECT, wxT("Open Lib's directory CMakeLists file"));
+ editCMakeLibBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibraryHelpDialog::OnCMakeListsEnter,NULL,this);
+ editCMakeLibBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibraryHelpDialog::OnCMakeListsExit,NULL,this);
- v_sizer1->Add(editCMakePKGBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
- v_sizer1->Add(editCMakePRJBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
+ v_sizer1->Add(editCMakeLibraryBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
+ v_sizer1->Add(editCMakeLibBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10);
void wxCDMLibraryHelpDialog::OnCMakeLists(wxCommandEvent& event)
{
- //TODO: implement method
- std::cout << "OnCMakeLists not implemented yet." << std::endl;
- event.Skip();
+ std::string* result;
+
+ if((int)((wxButton*)event.GetEventObject())->GetId() == (int)ID_BUTTON_EDIT_CMAKELISTSFILE)
+ {
+
+ if(!this->library->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->library->GetCMakeLists() != NULL)
+ {
+ int CMId = this->library->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_OPENPROJECT)
+ {
+ modelCDMIProjectTreeNode* node = this->library;
+ while (node != NULL && dynamic_cast<modelCDMLib*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ if(!((modelCDMLib*)node)->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(((modelCDMLib*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMLib*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else
+ {
+ wxMessageBox(crea::std2wx("No project CMakeLists file was found."),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+ }
+ }
}
void wxCDMLibraryHelpDialog::OnCMakeListsEnter(wxMouseEvent& event)
{
- //TODO: implement method
- std::cout << "OnCMakeListsEnter not implemented yet." << std::endl;
+ if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_EDIT_CMAKELISTSFILE)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(this->library->GetCMakeLists() != NULL)
+ {
+ int CMId = this->library->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_OPENPROJECT)
+ {
+ modelCDMIProjectTreeNode* node = this->library;
+ while (node != NULL && dynamic_cast<modelCDMLib*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(((modelCDMLib*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMLib*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ }
event.Skip();
}
void wxCDMLibraryHelpDialog::OnCMakeListsExit(wxMouseEvent& event)
{
- //TODO: implement method
- std::cout << "OnCMakeListsExit not implemented yet." << std::endl;
- event.Skip();
+ if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_EDIT_CMAKELISTSFILE)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->library->GetCMakeLists() != NULL)
+ {
+ int CMId = this->library->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_OPENPROJECT)
+ {
+ modelCDMIProjectTreeNode* node = this->library;
+ while (node != NULL && dynamic_cast<modelCDMLib*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(((modelCDMLib*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMLib*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ }
+ event.Skip();
}
void wxCDMLibraryHelpDialog::OnDisableHelp(wxCommandEvent& event)
#include "creaDevManagerIds.h"
+#include "modelCDMProject.h"
+
BEGIN_EVENT_TABLE(wxCDMPackageHelpDialog, wxDialog)
+EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMPackageHelpDialog::OnCMakeLists)
+EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMPackageHelpDialog::OnCMakeLists)
EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMPackageHelpDialog::OnFinish)
EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMPackageHelpDialog::OnDisableHelp)
END_EVENT_TABLE()
);
v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
- wxButton* editCMakePKGBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Open Package's directory CMakeLists file"));
- wxButton* editCMakePRJBtn= new wxButton(this, ID_BUTTON_OPENPROJECT, wxT("Open Project's directory CMakeLists file"));
+ wxButton* editCMakePkgBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Open Package's directory CMakeLists file"));
+ editCMakePkgBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageHelpDialog::OnCMakeListsEnter,NULL,this);
+ editCMakePkgBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageHelpDialog::OnCMakeListsExit,NULL,this);
+ wxButton* editCMakePrjBtn= new wxButton(this, ID_BUTTON_OPENPROJECT, wxT("Open Project's directory CMakeLists file"));
+ editCMakePrjBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageHelpDialog::OnCMakeListsEnter,NULL,this);
+ editCMakePrjBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageHelpDialog::OnCMakeListsExit,NULL,this);
- v_sizer1->Add(editCMakePKGBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
- v_sizer1->Add(editCMakePRJBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
+ v_sizer1->Add(editCMakePkgBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
+ v_sizer1->Add(editCMakePrjBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10);
//v_sizer1->RecalcSizes();
}
+void wxCDMPackageHelpDialog::OnCMakeLists(wxCommandEvent& event)
+{
+ std::string* result;
+
+ if((int)((wxButton*)event.GetEventObject())->GetId() == (int)ID_BUTTON_EDIT_CMAKELISTSFILE)
+ {
+
+ if(!this->package->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->package->GetCMakeLists() != NULL)
+ {
+ int CMId = this->package->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_OPENPROJECT)
+ {
+ modelCDMIProjectTreeNode* node = this->package;
+ while (node != NULL && dynamic_cast<modelCDMProject*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ if(!((modelCDMProject*)node)->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(((modelCDMProject*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMProject*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else
+ {
+ wxMessageBox(crea::std2wx("No project CMakeLists file was found."),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+ }
+ }
+}
+
+void wxCDMPackageHelpDialog::OnCMakeListsEnter(wxMouseEvent& event)
+{
+ if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_EDIT_CMAKELISTSFILE)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(this->package->GetCMakeLists() != NULL)
+ {
+ int CMId = this->package->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_OPENPROJECT)
+ {
+ modelCDMIProjectTreeNode* node = this->package;
+ while (node != NULL && dynamic_cast<modelCDMProject*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(((modelCDMProject*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMProject*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ }
+ event.Skip();
+}
+
+void wxCDMPackageHelpDialog::OnCMakeListsExit(wxMouseEvent& event)
+{
+ if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_EDIT_CMAKELISTSFILE)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->package->GetCMakeLists() != NULL)
+ {
+ int CMId = this->package->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ else if(((wxButton*)event.GetEventObject())->GetId() == ID_BUTTON_OPENPROJECT)
+ {
+ modelCDMIProjectTreeNode* node = this->package;
+ while (node != NULL && dynamic_cast<modelCDMProject*>(node) == NULL)
+ {
+ node = node->GetParent();
+ }
+ if (node != NULL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(((modelCDMProject*)node)->GetCMakeLists() != NULL)
+ {
+ int CMId = ((modelCDMProject*)node)->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+ }
+ event.Skip();
+}
+
void wxCDMPackageHelpDialog::OnFinish(wxCommandEvent& event)
{
this->EndDialog(wxID_CANCEL);