-static const wxCmdLineEntryDesc cmdLineDesc[] =
-{
-{ wxCMD_LINE_PARAM, NULL, NULL, _T("file"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
-{ wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Prints this help") },
-//{ wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("Message all 9") },
-{ wxCMD_LINE_NONE }
-};
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ static const wxCmdLineEntryDesc cmdLineDesc[] =
+ {
+ { wxCMD_LINE_PARAM, NULL, NULL, _T("file"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Prints this help") },
+ //{ wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("Message all 9") },
+ { wxCMD_LINE_NONE }
+ };
+#else
+ static const wxCmdLineEntryDesc cmdLineDesc[] =
+ {
+ { wxCMD_LINE_PARAM, NULL, NULL, "file", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_SWITCH, "h", "help", "Prints this help" },
+ //{ wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("Message all 9") },
+ { wxCMD_LINE_NONE }
+ };
+#endif
+
+
class wxBBEditorApp : public wxApp
// main frame
bool wxBBEditorApp::OnInit( )
{
-
vtkOutputWindowbbGEditor *vtkoutputwindowbbgeditor= vtkOutputWindowbbGEditor::New();
vtkOutputWindow::SetInstance( vtkoutputwindowbbgeditor );
vtkoutputwindowbbgeditor->Delete();
#endif
bbtk::wxGUIEditorGraphicBBS *iegbbs;
+
iegbbs = new bbtk::wxGUIEditorGraphicBBS(NULL);
SetTopWindow(iegbbs);
iegbbs->Show(true);
}
}
-
return true;
}
if ( _vtkInteractorStyleBaseView!=NULL)
{
int X,Y;
- wxVTKRenderWindowInteractor *_wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *_wxVTKiren;
_wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
_wxVTKiren->GetEventPosition( X , Y );
bool ok=true;
int X,Y;
- wxVTKRenderWindowInteractor *_wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *_wxVTKiren;
_wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
_wxVTKiren->GetEventPosition( X , Y );
}
//=========================================================================
-
bool GBlackBoxController::OnLeftButtonUp()
{
_isLeftClickDown = false;
int state = _view->getState();
-
- //Evaluate new state
-
-//EED Borrame
-// int X,Y;
-// wxVTKRenderWindowInteractor *wxVTKiren;
-// wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-// wxVTKiren->GetEventPosition(X,Y);
-// if(_isLeftClickDown)
-// {
-// _isLeftClickDown=false;
-// if(_view->isPointInside(X,Y))
-// {
- // It is supposed that I'm always inside even if the box is in drag
-// _view->setState(SELECTED);
-// _model->notifyObservers(getId());
-// }
-// }
-
-
-
- int shiftkey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
- int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
+ int shiftkey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
+ int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
ctrlkey = ctrlkey + shiftkey;
-
-
//EED 12/07/2012
// if ( (state==SELECTED) && (ctrlkey==0) && (_objHasBeenMoved==false))
// {
// _view->setState(NOTHING_HAPPENS);
// _model->notifyObservers(getId(),REMOVE_FROM_SELECTED);
// }
-
-
-
return true;
-
}
//=========================================================================
-
bool GBlackBoxController::OnRightButtonUp()
{
return true;
}
//=========================================================================
-
bool GBlackBoxController::OnMiddleButtonDown()
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
-
// int state = _view->getState();
-
//Evaluate new state
if(_view->isPointInside(X,Y))
{
if(bbmodel->isExecutable())
{
bbmodel->setExecutable(false);
- }
- else
- {
+ } else {
bbmodel->setExecutable(true);
}
bbmodel->notifyObservers(getId());
}
-
return true;
}
if ( _vtkInteractorStyleBaseView!=NULL)
{
int X,Y;
- wxVTKRenderWindowInteractor *_wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *_wxVTKiren;
_wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
_wxVTKiren->GetEventPosition( X , Y );
bool GBoxController::OnLeftButtonUp()
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
if ( _vtkInteractorStyleBaseView!=NULL)
{
int X,Y;
- wxVTKRenderWindowInteractor *_wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *_wxVTKiren;
_wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
_wxVTKiren->GetEventPosition( X , Y );
if ( _vtkInteractorStyleBaseView!=NULL )
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
if( _vtkInteractorStyleBaseView!= NULL )
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
if ( _vtkInteractorStyleBaseView!=NULL )
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
if( _vtkInteractorStyleBaseView!= NULL )
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
if ( _vtkInteractorStyleBaseView!=NULL )
{
int X, Y, Z=GPOSITION_Z;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
_controller->GetManualViewBaseContour()->InitMove( X, Y,Z);
bool GObjectController::OnMouseMove( ) {
int X , Y ;
- wxVTKRenderWindowInteractor *_wxVTKiren ;
+ crea::wxVTKRenderWindowInteractor *_wxVTKiren ;
_wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView( )->GetWxVTKRenderWindowInteractor( ) ;
_wxVTKiren->GetEventPosition( X , Y ) ;
int state = _view->getState( ) ;
}
//=========================================================================
-void wxGUIEditorGraphicBBS::initToolbar() {
+void wxGUIEditorGraphicBBS::initToolbar()
+{
wxBitmap bmp_new(new_xpm);
wxBitmap bmp_open(open_xpm);
wxBitmap bmp_save(save_xpm);
//Adds a tool btn to the toolbar
toolbar->AddTool(ID_NEW, _T("New"), bmp_new, wxNullBitmap, wxITEM_NORMAL,
_T("New tab"), _T("Create a new panel tab"));
+
toolbar->AddTool(ID_OPEN, _T("Open diagram"), bmp_open, wxNullBitmap,
wxITEM_NORMAL, _T("Open a diagram"), _T("Open a diagram"));
+
toolbar->AddTool(ID_SAVE_DIAGRAM, _T("Save Diagram"), bmp_save,
wxNullBitmap, wxITEM_NORMAL, _T("Saves the current diagram"),
_T("Saves the current diagram")); //DFCH
toolbar->AddSeparator();
toolbar->AddTool(ID_BTNCOMPLEXBOX, _T("Complex box"), complexbox_xpm,
wxNullBitmap, wxITEM_NORMAL, _T("Complex box"), _T("Complex box"));
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
toolbar->SetToggle(ID_BTNCOMPLEXBOX, true);
+#else
+ printf ("EED Warnning. wxGUIEditorGraphicBBS::initToolbar >>> toolbar->SetToggle \n ");
+ // ..
+#endif
// RaC 2012 2nd HackFest - Now Complex inputs are any external input
// toolbar->AddTool(ID_ADDCOMPLEXBOXINPUT, _T("Add input to Complex box"),
toolbar->EnableTool(ID_EDITPROPERTIES, false);
toolbar->AddTool(ID_SHOWTREE, _T("Show tree"),bmp_showTree, wxNullBitmap, wxITEM_NORMAL, _T("Show tree"), _T("Show tree"));
+
toolbar->EnableTool(ID_UNDO, false);
toolbar->EnableTool(ID_REDO, false);
toolbar->Realize();
SetToolBar(toolbar);
+
// connect command event handlers
Connect(ID_EDITPROPERTIES,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnEditDiagramProperties));
Connect(ID_SHOWTREE,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnShowTree));
+
}
//=========================================================================
void wxGUIEditorGraphicBBS::initHelpHTMLBrowser() {
//=========================================================================
void wxGUIEditorGraphicBBS::OnOpenBBS(wxCommandEvent& event)
{
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open BBS"), wxEmptyString, wxT("NewBBS"), wxT("*.bbs"), wxOPEN);
+#else
+ wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open BBS"), wxEmptyString, wxT("NewBBS"), wxT("*.bbs"), wxFD_OPEN);
+#endif
if (openFileDialog->ShowModal() == wxID_OK)
{
}
void wxGUIEditorGraphicBBS::OnSaveActualBBS(wxCommandEvent& event) {
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog * saveFileDialog = new wxFileDialog(this,
wxT("Save actual BBS"), wxEmptyString, wxT("NewBBS"),
wxT("*.bbs"), wxSAVE | wxOVERWRITE_PROMPT);
+#else
+ wxFileDialog * saveFileDialog = new wxFileDialog(this,
+ wxT("Save actual BBS"), wxEmptyString, wxT("NewBBS"),
+ wxT("*.bbs"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
+#endif
+
if (saveFileDialog->ShowModal() == wxID_OK) {
wxString fileName = saveFileDialog->GetPath();
std::string filename = (const char*) (fileName.mb_str());
//=========================================================================
-void wxGUIEditorGraphicBBS::OnSaveActualComplexBox(wxCommandEvent& event) {
+void wxGUIEditorGraphicBBS::OnSaveActualComplexBox(wxCommandEvent& event)
+{
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog * saveFileDialog = new wxFileDialog(this,
wxT("Save Complex Box BBS"), wxEmptyString,
_T("ComplexBoxName"), wxT("*.bbs"), wxSAVE
| wxOVERWRITE_PROMPT);
+#else
+ wxFileDialog * saveFileDialog = new wxFileDialog(this,
+ wxT("Save Complex Box BBS"), wxEmptyString,
+ _T("ComplexBoxName"), wxT("*.bbs"), wxFD_SAVE
+ | wxFD_OVERWRITE_PROMPT);
+#endif
+
if (saveFileDialog->ShowModal() == wxID_OK) {
wxString fileName = saveFileDialog->GetPath();
std::string filename = (const char*) (fileName.mb_str());
//The following method allows to save the current diagram asking the filename
//DFCH
-void wxGUIEditorGraphicBBS::SaveCurrentDiagramAs() {
+void wxGUIEditorGraphicBBS::SaveCurrentDiagramAs()
+{
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog * saveFileDialog = new wxFileDialog(this,
wxT("Save current diagram"), wxEmptyString, wxT("NewDiagram"),
wxT("*.bbg"), wxSAVE | wxOVERWRITE_PROMPT);
+#else
+ wxFileDialog * saveFileDialog = new wxFileDialog(this,
+ wxT("Save current diagram"), wxEmptyString, wxT("NewDiagram"),
+ wxT("*.bbg"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
+#endif
+
if (saveFileDialog->ShowModal() == wxID_OK) {
//_tabsMgr->SetNameTabPanel(saveFileDialog->GetFilename());
wxString pathfileName = saveFileDialog->GetPath();
//=========================================================================
void wxGUIEditorGraphicBBS::OnExportConsoleExecCommand(wxCommandEvent& event)
{
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog * saveFileDialog = new wxFileDialog(this,
wxT("Export console command"), wxEmptyString, wxT("ConsoleApp.txt"),
wxT("*.txt;*.bbs;*.bbg;*.sh;*.bat"), wxSAVE | wxOVERWRITE_PROMPT);
+#else
+ wxFileDialog * saveFileDialog = new wxFileDialog(this,
+ wxT("Export console command"), wxEmptyString, wxT("ConsoleApp.txt"),
+ wxT("*.txt;*.bbs;*.bbg;*.sh;*.bat"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
+#endif
+
if (saveFileDialog->ShowModal() == wxID_OK)
{
void wxGUIEditorGraphicBBS::OnOpenDiagram(wxCommandEvent& event)
{
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open diagram"), wxEmptyString, wxT(""), wxT("*.bbg"), wxOPEN | wxFILE_MUST_EXIST);
+#else
+ wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open diagram"), wxEmptyString, wxT(""), wxT("*.bbg"), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
+#endif
+
if (openFileDialog->ShowModal() == wxID_OK)
{
wxString filePath = openFileDialog->GetPath();
Version: $Revision$
=========================================================================*/
-/* ---------------------------------------------------------------------
-
-* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
-* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
-*
-* 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.
-* ------------------------------------------------------------------------ */
-
-
/**
* \file
_baseView->SetInteractorStyleBaseView(interactorstylebaseview);
// Important to activate the 2D interaction system
- wxVTKRenderWindowInteractor *iren = _baseView->GetWxVTKRenderWindowInteractor();
+ crea::wxVTKRenderWindowInteractor *iren = _baseView->GetWxVTKRenderWindowInteractor();
interactorstylebaseview->SetInteractor(iren);
iren->SetInteractorStyle(interactorstylebaseview);
interactorstylebaseview->SetwxVtkBaseView(_baseView);
int X, Y;
bool okStatusMessage = false;
bool okPortMessage = false;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
GObjectController *wxVtkSceneManager::GetGBlackBoxControlerPointedByMouse() {
GObjectController *result = NULL;
int X, Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren
= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
UnSelectBlackBoxes();
_parent->editBlackBox((GBlackBoxModel*) cont->getModel());
}
-
- /*EED Borrame
-
- int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
- wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
- wxVTKiren->GetEventPosition(X,Y);
-
- std::map<int, GObjectController*>::iterator it;
-
- bool clickOnObject = false;
-
- for(it = _controllers.begin(); it != _controllers.end() && clickOnObject==false; ++it)
- {
- GObjectController *cont = it->second;
- int type = cont->getGObjectType();
-
- if(cont->getView()->isPointInside(X,Y))
- {
- if(type==GBLACKBOX)
- {
- for (int i=0; i< (int)_selectedObjects.size(); i++)
- {
- int id = _selectedObjects[i];
- GObjectController* control = _controllers[id];
- control->getView()->setState(NOTHING_HAPPENS);
- }
- _selectedObjects.clear();
-
- GBlackBoxModel *bbmodel = (GBlackBoxModel*)cont->getModel();
- _parent->editBlackBox(bbmodel);
- }
- clickOnObject = true;
- }
- }
-
- if(clickOnObject==false)
- {
- //_parent->editDiagramParameters(this);
- }
- */
return true;
}