Feature: Now detecting BBS files in folders. They can be executed with bbs or edited in code editor.
return system(command.c_str());
}
- int openFileWithCommand(const std::string& file, const std::string& command)
+ int openFileWithCommand(const std::string& file, const std::string& command, const std::string& parameters)
{
#ifdef _WIN32
std::string comm = "start " + command;
if(file != "")
- comm += " \"" + file + "\"";
+ comm += " \"" + file + "\" " + parameters;
#else
std::string comm = command;
if(file != "")
- comm += " \"" + file + "\"";
+ comm += " \"" + file + "\" " + parameters;
comm += " &";
#endif
return system(comm.c_str());
* Opens a file with a given command.
* @param file Full path of the file to open.
* @param command Command to execute the file with.
+ * @param parameters Parameters to open file.
* @return True if there was an error on the execution of the operation.
*/
- int openFileWithCommand(const std::string& file, const std::string& command);
+ int openFileWithCommand(const std::string& file, const std::string& command, const std::string& parameters = "");
/**
* Opens the BBTK Graphical Editor
* @return True if there was an error on the execution of the operation.
/* XPM */
-static char * BBSIcon20_xpm[] = {
+const static char * BBSIcon20[] = {
"20 20 131 2",
" c None",
". c #171E27",
/* XPM */
-static char * BBSIcon_xpm[] = {
+const static char * BBSIcon64[] = {
"64 64 217 2",
" c None",
". c #1D242D",
--- /dev/null
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# 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.
+# ------------------------------------------------------------------------
+ */
+
+/*
+ * modelCDMBBSFile.cpp
+ *
+ * Created on: Jun 27, 2013
+ * Author: Daniel Felipe Gonzalez Obando
+ */
+
+#include "modelCDMBBSFile.h"
+
+#include <fstream>
+
+#include<creaWx.h>
+#include<wx/dir.h>
+
+#include "CDMUtilities.h"
+
+modelCDMBBSFile::modelCDMBBSFile()
+{
+}
+
+modelCDMBBSFile::modelCDMBBSFile(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
+{
+ std::cout << "creating bbs file: " + path + "\n";
+ this->parent = parent;
+ this->children.clear();
+ this->level = level;
+ this->type = wxDIR_FILES;
+ this->name = name;
+ this->path = path;
+
+ std::ifstream in(path.c_str(), std::ifstream::in | std::ifstream::binary);
+ in.seekg(0, std::ifstream::end);
+ this->length = in.tellg();
+ in.close();
+}
+
+modelCDMBBSFile::~modelCDMBBSFile()
+{
+}
+
+bool modelCDMBBSFile::OpenFile(std::string*& result)
+{
+
+ if (!CDMUtilities::openTextEditor(this->path))
+ return true;
+ else
+ {
+ result = new std::string("Couldn't open bbs file in text editor.");
+ return false;
+ }
+}
+
+bool modelCDMBBSFile::ExecuteFile(
+ std::string*& result,
+ const std::string& parameters)
+{
+ if (!CDMUtilities::openFileWithCommand(this->path, "bbi", parameters))
+ return true;
+ else
+ {
+ result = new std::string("Couldn't open bbs file with bbi.");
+ return false;
+ }
+}
+
+const bool modelCDMBBSFile::Refresh(std::string*& result)
+{
+ //std::cout << "refreshing bbs file" << std::endl;
+ std::ifstream in((this->path).c_str());
+ if(!in.is_open())
+ {
+ in.close();
+ return false;
+ }
+ std::ifstream in2(path.c_str(), std::ifstream::in | std::ifstream::binary);
+ in2.seekg(0, std::ifstream::end);
+ this->length = in2.tellg();
+ in2.close();
+ return true;
+}
--- /dev/null
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# 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.
+# ------------------------------------------------------------------------
+ */
+
+/*
+ * modelCDMBBSFile.h
+ *
+ * Created on: Jun 27, 2013
+ * Author: Daniel Felipe Gonzalez Obando
+ */
+
+#ifndef MODELCDMBBSFILE_H_
+#define MODELCDMBBSFILE_H_
+
+#include "modelCDMFile.h"
+
+/**
+ * Class representing a bbs file in a folder of a Crea project.
+ */
+class modelCDMBBSFile : public modelCDMFile
+{
+public:
+ /**
+ * Default Constructor.
+ */
+ modelCDMBBSFile();
+ /**
+ * BBS file Constructor.
+ * @param parent Parent node of the BBS file node.
+ * @param path Full path to the BBS file node.
+ * @param name File name of the BBS file node.
+ * @param level Project hierarchy level of the BBS file node.
+ */
+ modelCDMBBSFile(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name = "CMakeLists.txt", const int& level = 1);
+ /**
+ * Destructor
+ */
+ ~modelCDMBBSFile();
+
+ /**
+ * Opens the file in the system default code editor.
+ * @param result Result message.
+ * @return True if the operation was successful.
+ */
+ bool OpenFile(std::string*& result);
+
+ /**
+ * Opens the file using bbi.
+ * @param parameters Execution parameters.
+ * @param result Result message.
+ * @return True if the operation was successful.
+ */
+ bool ExecuteFile(std::string*& result, const std::string& parameters = "");
+
+ /**
+ * Refreshes the state of the BBS file.
+ * @param result Result message.
+ * @return True if the operation was successful.
+ */
+ virtual const bool Refresh(std::string*& result);
+};
+
+#endif /* MODELCDMBBSFILE_H_ */
modelCDMCodeFile* file = new modelCDMCodeFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
this->children.push_back(file);
}
+ else if(fileType == ".bbs")
+ {
+ modelCDMBBSFile* file = new modelCDMBBSFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+ this->children.push_back(file);
+ }
//if is an unknown file, create file
else
{
{
this->children.push_back(new modelCDMCodeFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
}
+ else if(fileType == ".bbs")
+ {
+ this->children.push_back(new modelCDMBBSFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+ }
else
{
modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
#include "modelCDMIProjectTreeNode.h"
#include "modelCDMCMakeListsFile.h"
#include "modelCDMCodeFile.h"
+#include "modelCDMBBSFile.h"
/**
* Class representing a folder in the project hierarchy.
--- /dev/null
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# 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.
+# ------------------------------------------------------------------------
+ */
+
+/*
+ * wxCDMBBSFileDescriptionPanel.cpp
+ *
+ * Created on: Jun 27, 2012
+ * Author: Daniel Felipe Gonzalez Obando
+ */
+
+#include "wxCDMBBSFileDescriptionPanel.h"
+
+#include "wxCDMMainFrame.h"
+
+#include "creaDevManagerIds.h"
+#include "images/BBSIcon64.xpm"
+
+BEGIN_EVENT_TABLE(wxCDMBBSFileDescriptionPanel, wxPanel)
+EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMBBSFileDescriptionPanel::OnBtnReturn)
+EVT_BUTTON(ID_BUTTON_OPEN_FILE, wxCDMBBSFileDescriptionPanel::OnBtnOpenInEditor)
+EVT_BUTTON(ID_BUTTON_OPEN_COMMAND, wxCDMBBSFileDescriptionPanel::OnBtnOpenInBBI)
+EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMBBSFileDescriptionPanel::OnBtnOpenFolder)
+END_EVENT_TABLE()
+
+wxCDMBBSFileDescriptionPanel::wxCDMBBSFileDescriptionPanel(
+ wxWindow* parent,
+ modelCDMBBSFile* bbsfile,
+ wxWindowID id,
+ const wxString& caption,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style
+)
+{
+ wxCDMBBSFileDescriptionPanel::Create(parent, bbsfile, id, caption, pos, size, style);
+}
+
+wxCDMBBSFileDescriptionPanel::~wxCDMBBSFileDescriptionPanel()
+{
+}
+
+bool wxCDMBBSFileDescriptionPanel::Create(
+ wxWindow* parent,
+ modelCDMBBSFile* bbsfile,
+ wxWindowID id,
+ const wxString& caption,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style
+)
+{
+ wxPanel::Create(parent, id, pos, size, style);
+ this->bbsFile = bbsfile;
+ CreateControls();
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+ return TRUE;
+}
+
+void wxCDMBBSFileDescriptionPanel::CreateControls()
+{
+ wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+
+ //Links to return
+ wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
+ std::vector<modelCDMIProjectTreeNode*> parents = this->bbsFile->GetParents();
+ for (int i = 0; i < (int)(parents.size()); i++)
+ {
+ wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE);
+ returnLnk->SetWindowStyle(wxNO_BORDER);
+ returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
+ linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
+ linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
+ }
+
+ linksSizer->Add(new wxStaticText(this, wxID_ANY, crea::std2wx(this->bbsFile->GetName())), 0, wxALIGN_CENTER, 0);
+
+ sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
+
+ //Header
+ wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
+ {
+ //Image
+ headerSizer->Add(new wxStaticBitmap(this, -1, wxBitmap(BBSIcon64)),0, wxALIGN_CENTER, 0);
+ wxBoxSizer* textSizer = new wxBoxSizer(wxVERTICAL);
+ //Title
+ textSizer->Add(new wxStaticText(this, -1, _("BBS Script File")),0, wxALIGN_LEFT, 0);
+ //File Name
+ textSizer->Add(new wxStaticText(this, -1, crea::std2wx(this->bbsFile->GetName())),0, wxALIGN_LEFT, 0);
+ headerSizer->Add(textSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
+ }
+ sizer->Add(headerSizer, 0, wxALIGN_CENTER);
+
+ //Actions
+ wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("&Actions"));
+ wxPanel* actionsPanel = new wxPanel(this);
+ wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL);
+ //actionsGrid Sizer
+ wxFlexGridSizer* actionsGridSizer = new wxFlexGridSizer(2, 2, 9, 15);
+
+ wxButton* executeScriptbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_COMMAND, _T("Execute Script"));
+ executeScriptbt->SetToolTip(wxT("Execute the BBS file using bbi."));
+ actionsGridSizer->Add(executeScriptbt, 1, wxALL | wxEXPAND, 5);
+ wxButton* editScriptbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FILE, _T("Edit File"));
+ editScriptbt->SetToolTip(wxT("Edit the BBS file in the default text editor."));
+ actionsGridSizer->Add(editScriptbt, 1, wxALL | wxEXPAND, 5);
+ wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Containing Folder"));
+ openFolderbt->SetToolTip(wxT("Open the folder where the BBS file is located in the file explorer."));
+ actionsGridSizer->Add(openFolderbt, 1, wxALL | wxEXPAND, 5);
+
+ actionsGridSizer->AddGrowableCol(0,1);
+ actionsGridSizer->AddGrowableCol(1,1);
+
+ actionsPanelSizer->Add(actionsGridSizer, 1, wxEXPAND, 0);
+ actionsPanel->SetSizer(actionsPanelSizer);
+ actionsPanelSizer->Fit(actionsPanel);
+ actionsBox->Add(actionsPanel, 1, wxEXPAND);
+ sizer -> Add(actionsBox, 0, wxEXPAND | wxALL, 10);
+
+ //Assign sizer
+ SetSizer(sizer);
+ sizer->SetSizeHints(this);
+}
+
+void wxCDMBBSFileDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
+{
+ std::vector<modelCDMIProjectTreeNode*> parents = this->bbsFile->GetParents();
+ std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+ //std::cout << parentURL << std::endl;
+ for (int i = 0; i < (int)(parents.size()); i++)
+ {
+ if (parents[i]->GetPath() == parentURL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+ newEvent->SetClientData(parents[i]);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+}
+
+void wxCDMBBSFileDescriptionPanel::OnBtnOpenInEditor(wxCommandEvent& event)
+{
+ std::string* result;
+ if(!this->bbsFile->OpenFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open BBS File - Error!"),wxOK | wxICON_ERROR);
+}
+
+void
+wxCDMBBSFileDescriptionPanel::OnBtnOpenInBBI(wxCommandEvent& event)
+{
+ std::string* result;
+ std::string params = "-g";
+ if(!this->bbsFile->ExecuteFile(result, params))
+ {
+ wxMessageBox(crea::std2wx(*result),_T("Execute BBS File - Error!"),wxOK | wxICON_ERROR);
+ }
+}
+
+void wxCDMBBSFileDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
+{
+ std::string* result;
+ if(!this->bbsFile->OpenInFileExplorer(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
+}
--- /dev/null
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# 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.
+# ------------------------------------------------------------------------
+ */
+
+/*
+ * wxCDMBBSFileDescriptionPanel.h
+ *
+ * Created on: Jun 27, 2012
+ * Author: Daniel Felipe Gonzalez Obando
+ */
+
+#ifndef WXCDMBBSFILEDESCRIPTIONPANEL_H_
+#define WXCDMBBSFILEDESCRIPTIONPANEL_H_
+
+#include <creaWx.h>
+#include <wx/hyperlink.h>
+
+#include "modelCDMBBSFile.h"
+
+/**
+ * BBS File description panel. Shows the file properties and the available actions for it.
+ */
+class wxCDMBBSFileDescriptionPanel : public wxScrolledWindow
+{
+ DECLARE_EVENT_TABLE()
+public:
+ /**
+ * BBS File description panel Constructor.
+ * @param parent Parent window reference.
+ * @param bbsfile BBSFile class reference.
+ * @param id Panel ID. By default -1.
+ * @param caption Panel label. By default "Description Frame".
+ * @param pos Panel position. By default wxDefaultPosition.
+ * @param size Panel size. By default wxDefaultSize.
+ * @param style Panel style. By default wxDEFAULT_FRAME_STYLE.
+ */
+ wxCDMBBSFileDescriptionPanel(
+ wxWindow* parent,
+ modelCDMBBSFile* bbsfile,
+ wxWindowID id = -1,
+ const wxString& caption = _("Description Frame"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE
+ );
+
+ /**
+ * Destructor.
+ */
+ ~wxCDMBBSFileDescriptionPanel();
+
+ /**
+ * BBS File description panel Constructor.
+ * @param parent Parent window reference.
+ * @param bbsfile BBSFile class reference.
+ * @param id Panel ID. By default -1.
+ * @param caption Panel label. By default "Description Frame".
+ * @param pos Panel position. By default wxDefaultPosition.
+ * @param size Panel size. By default wxDefaultSize.
+ * @param style Panel style. By default wxDEFAULT_FRAME_STYLE.
+ * @return True if the creation was successful.
+ */
+ bool Create(
+ wxWindow* parent,
+ modelCDMBBSFile* bbsfile,
+ wxWindowID id = -1,
+ const wxString& caption = _("Description Frame"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE
+ );
+
+ /**
+ * Creates all the controls in the panel (property and action controls).
+ */
+ void CreateControls();
+
+private:
+ /**
+ * BBS file described.
+ */
+ modelCDMBBSFile* bbsFile;
+
+ //handlers
+protected:
+ /**
+ * Handles when a return link is pressed.
+ * @param event Has the link reference to know where to return
+ */
+ void OnBtnReturn(wxHyperlinkEvent& event);
+ /**
+ * Handles when the open file in text editor button is pressed.
+ */
+ void OnBtnOpenInEditor(wxCommandEvent& event);
+ /**
+ * Handles when the open file in bbi button is pressed.
+ */
+ void OnBtnOpenInBBI(wxCommandEvent& event);
+ /**
+ * Handles when the open containing folder button is pressed.
+ */
+ void OnBtnOpenFolder(wxCommandEvent& event);
+};
+
+#endif /* WXCDMBBSFILEDESCRIPTIONPANEL_H_ */
#include "wxCDMLibraryDescriptionPanel.h"
#include "wxCDMPackageDescriptionPanel.h"
#include "wxCDMBlackBoxDescriptionPanel.h"
+#include "wxCDMBBSFileDescriptionPanel.h"
#include "wxCDMCodeFileDescriptionPanel.h"
#include "wxCDMCMakeListsDescriptionPanel.h"
#include "wxCDMFolderDescriptionPanel.h"
}
else
{
- //folder
- modelCDMFolder* elementFolder = dynamic_cast<modelCDMFolder*>(element);
- if(elementFolder != NULL)
+ //BBSFile
+ modelCDMBBSFile* elementBBSFile = dynamic_cast<modelCDMBBSFile*>(element);
+ if(elementBBSFile != NULL)
{
//create element description
- description = new wxCDMFolderDescriptionPanel(
+ description = new wxCDMBBSFileDescriptionPanel(
this,
- elementFolder,
+ elementBBSFile,
ID_WINDOW_PROPERTIES,
wxT("Description Panel"),
wxDefaultPosition,
}
else
{
- //file
- modelCDMFile* elementFile = dynamic_cast<modelCDMFile*>(element);
- if(elementFile != NULL)
+ //folder
+ modelCDMFolder* elementFolder = dynamic_cast<modelCDMFolder*>(element);
+ if(elementFolder != NULL)
{
//create element description
- description = new wxCDMFileDescriptionPanel(
+ description = new wxCDMFolderDescriptionPanel(
this,
- elementFile,
+ elementFolder,
ID_WINDOW_PROPERTIES,
wxT("Description Panel"),
wxDefaultPosition,
}
else
{
-
- //main if not any
- //create element description
- description = new wxCDMMainDescriptionPanel(
- this,
- ID_WINDOW_PROPERTIES,
- wxT("Description Panel"),
- wxDefaultPosition,
- wxSize(600, 400),
- 0
- );
+ //file
+ modelCDMFile* elementFile = dynamic_cast<modelCDMFile*>(element);
+ if(elementFile != NULL)
+ {
+ //create element description
+ description = new wxCDMFileDescriptionPanel(
+ this,
+ elementFile,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
+ else
+ {
+
+ //main if not any
+ //create element description
+ description = new wxCDMMainDescriptionPanel(
+ this,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+ 0
+ );
+ }
}
}
}
#include "images/AIcon20.xpm"
#include "images/ApIcon20.xpm"
#include "images/BBIcon20.xpm"
+#include "images/BBSIcon20.xpm"
#include "images/CIcon20.xpm"
#include "images/CFIcon20.xpm"
#include "images/CMIcon20.xpm"
this->ID_AIcon = images->Add(wxIcon(AIcon20));
this->ID_ApIcon = images->Add(wxIcon(ApIcon20));
this->ID_BBIcon = images->Add(wxIcon(BBIcon20));
+ this->ID_BBSIcon = images->Add(wxIcon(BBSIcon20));
this->ID_Cicon = images->Add(wxIcon(CIcon20));
this->ID_CMIcon = images->Add(wxIcon(CMIcon20));
this->ID_FdIcon = images->Add(wxIcon(FdIcon20));
}
else
{
- element = dynamic_cast<modelCDMFolder*>(node);
+ element = dynamic_cast<modelCDMBBSFile*>(node);
if(element != NULL)
{
- return this->ID_FdIcon;
+ return this->ID_BBSIcon;
}
else
{
- element = dynamic_cast<modelCDMFile*>(node);
+ element = dynamic_cast<modelCDMFolder*>(node);
if(element != NULL)
{
- return this->ID_FlIcon;
+ return this->ID_FdIcon;
}
else
{
- return this->ID_Cicon;
+ element = dynamic_cast<modelCDMFile*>(node);
+ if(element != NULL)
+ {
+ return this->ID_FlIcon;
+ }
+ else
+ {
+ return this->ID_Cicon;
+ }
}
}
}
* BB Icon ID.
*/
int ID_BBIcon;
+ /**
+ * BBS Icon ID.
+ */
+ int ID_BBSIcon;
/**
* C Icon ID.
*/