return application;
}
-bool modelCDMAppli::OpenCMakeListsFile(std::string*& result)
-{
- //TODO: implement method
- return true;
-}
-
const bool modelCDMAppli::Refresh(std::string*& result)
{
//TODO: implement method
std::string*& result,
const std::string& path = "/"
);
- bool OpenCMakeListsFile(std::string*& result);
virtual const bool Refresh(std::string*& result);
private:
bool modelCDMFolder::OpenCMakeListsFile(std::string*& result)
{
- //TODO: implement method
- return true;
+ if (this->CMakeLists == NULL)
+ {
+ result = new std::string("There's no CMakeLists file to open.");
+ return false;
+ }
+ if (!CDMUtilities::openTextEditor(this->CMakeLists->GetPath()))
+ return true;
+ else
+ {
+ result = new std::string("Couldn't open CMakeLists file.");
+ return false;
+ }
}
const bool modelCDMFolder::Refresh(std::string*& result)
# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL-B license and that you accept its terms.
# ------------------------------------------------------------------------
-*/
+ */
/*
* modelCDMIProjectTreeNode.cpp
unsigned char yType = y->GetType();
while ((i < xName.length()) && (i < yName.length()))
- {
- if (tolower (xName[i]) < tolower (yName[i]))
- {
- noWinner = false;
- returnValue = true;
- break;
- }
- else if (tolower (xName[i]) > tolower (yName[i]))
{
- noWinner = false;
- returnValue = false;
- break;
+ if (tolower (xName[i]) < tolower (yName[i]))
+ {
+ noWinner = false;
+ returnValue = true;
+ break;
+ }
+ else if (tolower (xName[i]) > tolower (yName[i]))
+ {
+ noWinner = false;
+ returnValue = false;
+ break;
+ }
+ i++;
}
- i++;
- }
if(noWinner)
- {
- if (xName.length() < yName.length())
- returnValue = true;
- else
- returnValue = false;
- }
+ {
+ if (xName.length() < yName.length())
+ returnValue = true;
+ else
+ returnValue = false;
+ }
if(xType != yType)
- {
- if(xType == wxDIR_DIRS)
- returnValue = true;
- else
- returnValue = false;
- }
+ {
+ if(xType == wxDIR_DIRS)
+ returnValue = true;
+ else
+ returnValue = false;
+ }
return returnValue;
}
const bool modelCDMIProjectTreeNode::OpenInFileExplorer(std::string*& result) const
{
if (!CDMUtilities::openFileExplorer(this->GetPath()))
- return true;
- else
- {
- result = new std::string("Couldn't open file.");
- return false;
- }
+ return true;
+ else
+ {
+ result = new std::string("Couldn't open file.");
+ return false;
+ }
}
return library;
}
-bool modelCDMLib::OpenCMakeListsFile(std::string*& result)
-{
- if (!CDMUtilities::openTextEditor(this->CMakeLists->GetPath()))
- return true;
- else
- {
- result = new std::string("Couldn't open CMakeLists file.");
- return false;
- }
-}
-
const bool modelCDMLib::Refresh(std::string*& result)
{
this->type = wxDIR_DIRS;
const std::string& path = "/"
);
- bool OpenCMakeListsFile(std::string*& result);
virtual const bool Refresh(std::string*& result);
private:
actionsPanelSizer->Add(createApplicationbt, 0, wxALL, 5);
wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Open the system default text editor to edit the CMakeLists.txt file."));
+ editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMAppliDescriptionPanel::OnCMakeMouseEnter,NULL,this);
+ editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMAppliDescriptionPanel::OnCMakeMouseExit,NULL,this);
actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5);
wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Applications Folder"));
openFolderbt->SetToolTip(wxT("Open the appli folder in the file explorer."));
void wxCDMAppliDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnEditCMakeLists not implemented" << 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 wxCDMAppliDescriptionPanel::OnLnkApplicationSelect(wxHyperlinkEvent& event)
void wxCDMAppliDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl;
- event.Skip();
+ std::string* result;
+ if(!this->appli->OpenInFileExplorer(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
}
void wxCDMAppliDescriptionPanel::OnMouseEnter(wxMouseEvent& event)
event.Skip();
}
+void wxCDMAppliDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event)
+{
+ 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 wxCDMAppliDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event)
+{
+ 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 OnMouseEnter(wxMouseEvent& event);
void OnMouseExit(wxMouseEvent& event);
+ void OnCMakeMouseEnter(wxMouseEvent& event);
+ void OnCMakeMouseExit(wxMouseEvent& event);
};
actionsPanelSizer->Add(createLibrarybt, 0, wxALL, 5);
wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Open the system default text editor to edit the Lib's CMakeLists.txt file."));
+ editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibDescriptionPanel::OnCMakeMouseEnter,NULL,this);
+ editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibDescriptionPanel::OnCMakeMouseExit,NULL,this);
actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5);
wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Libraries Folder"));
openFolderbt->SetToolTip(wxT("Open the lib folder in the file explorer."));
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 wxCDMLibDescriptionPanel::OnLnkLibrarySelect(wxHyperlinkEvent& event)
wxPostEvent(this->GetParent(), *newEvent);
event.Skip();
}
+
+void wxCDMLibDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event)
+{
+ 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 wxCDMLibDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event)
+{
+ 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();
+}
void OnMouseEnter(wxMouseEvent& event);
void OnMouseExit(wxMouseEvent& event);
+ void OnCMakeMouseEnter(wxMouseEvent& event);
+ void OnCMakeMouseExit(wxMouseEvent& event);
};