+ //EED02JUIN2010 delete _tabsMgr;
+ _frameAUIMgr->UnInit();
+ // FCY memory leaks
+ delete _frameAUIMgr;
+ delete _notebook;
+ delete _tabsMgr;
+}
+
+//=========================================================================
+void wxGUIEditorGraphicBBS::initToolbar()
+{
+ wxBitmap bmp_new(new_xpm);
+ wxBitmap bmp_open(open_xpm);
+ wxBitmap bmp_save(save_xpm);
+ wxBitmap bmp_run(run_xpm);
+ wxBitmap bmp_delete(delete_xpm);
+ wxBitmap bmp_centerview(centerview_xpm);
+ wxBitmap bmp_box(box_xpm);
+ wxBitmap bmp_executablebox(executablebox_xpm);
+ wxBitmap bmp_complexbox(complexbox_xpm);
+ wxBitmap bmp_complexinputport(complexinputport_xpm);
+ wxBitmap bmp_complexoutputport(complexoutputport_xpm);
+ wxBitmap bmp_undo(undo_xpm);
+ wxBitmap bmp_redo(redo_xpm);
+ wxBitmap bmp_editProperties(editProperties_xpm);
+ wxBitmap bmp_showTree(showTree_xpm);
+
+// wxToolBar *toolbar = new wxToolBar(this, wxID_ANY);
+ wxToolBar *toolbar = CreateToolBar();
+
+ //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->AddTool(ID_SAVE_AS_DIAGRAM,_T("Save Diagram As"),bmp_save, wxNullBitmap, wxITEM_NORMAL,_T("Saves the current diagram"), _T("Saves the current diagram")); //DFCH
+ toolbar->AddTool(ID_RUN, _T("Run"), bmp_run, wxNullBitmap, wxITEM_NORMAL,
+ _T("Execute actual diagram"), _T("Execute actual diagram"));
+ toolbar->AddTool(ID_DELETEALL, _T("Delete all"), bmp_delete, wxNullBitmap,
+ wxITEM_NORMAL, _T("Delete all boxes"), _T("Delete all boxes"));
+ toolbar->AddTool(ID_CENTERVIEW, _T("Center view"), bmp_centerview,
+ wxNullBitmap, wxITEM_NORMAL, _T("Center view"), _T("Center view"));
+ toolbar->AddSeparator();
+ toolbar->AddTool(ID_BTNBOX, _T("New Box"), bmp_box, wxNullBitmap,
+ wxITEM_NORMAL, _T("New Box"), _T("Nex Box"));
+ toolbar->AddSeparator();
+ toolbar->AddTool(ID_BTEXECUTABLEBOX, _T("Select as executable Box"),
+ bmp_executablebox, wxNullBitmap, wxITEM_NORMAL,
+ _T("Select as executable Box"), _T("Select as executable Box"));
+ 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"),
+ // bmp_complexinputport, wxNullBitmap, wxITEM_NORMAL,
+ // _T("Add input to Complex box"), _T("Add input to Complex box"));
+ toolbar->AddTool(ID_ADDCOMPLEXBOXINPUT, _T("Add external input (Complex box or console app)"),
+ bmp_complexinputport, wxNullBitmap, wxITEM_NORMAL,
+ _T("Add external input (Complex box or console app)"), _T("Add external input (Complex box or console app)"));
+
+ toolbar->AddTool(ID_ADDCOMPLEXBOXOUTPUT, _T("Add output to Complex box"),
+ bmp_complexoutputport, wxNullBitmap, wxITEM_NORMAL,
+ _T("Add output Complex box"), _T("Add output Complex box"));
+
+ // toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT, false); RaC2012 2nd HackFest
+ toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT, true);
+
+ toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT, false);
+ toolbar->AddSeparator();
+ toolbar->AddTool(ID_UNDO, _T("Undo"),bmp_undo, wxNullBitmap, wxITEM_NORMAL, _T("Undo"), _T("Undo"));
+ toolbar->AddTool(ID_REDO, _T("Redo"),bmp_redo, wxNullBitmap, wxITEM_NORMAL, _T("Redo"), _T("Redo"));
+ toolbar->AddSeparator();
+ toolbar->AddTool(ID_EDITPROPERTIES, _T("Edit diagram properties"),bmp_editProperties, wxNullBitmap, wxITEM_NORMAL, _T("Edit diagram properties"), _T("Edit diagram properties"));
+ 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->SetMargins(2, 2);
+ toolbar->Realize();
+ SetToolBar(toolbar);
+
+
+
+ // connect command event handlers
+
+ Connect(ID_NEW, wxEVT_COMMAND_TOOL_CLICKED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab));
+ Connect(ID_OPEN, wxEVT_COMMAND_TOOL_CLICKED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnOpenDiagram));
+ Connect(ID_SAVE_DIAGRAM, wxEVT_COMMAND_TOOL_CLICKED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualDiagram)); //DFCH
+ Connect(ID_SAVE_AS_DIAGRAM, wxEVT_COMMAND_TOOL_CLICKED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveAsActualDiagram)); //DFCH
+ Connect(
+ ID_RUN,
+ wxEVT_COMMAND_TOOL_CLICKED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExecuteActualDiagram));
+ Connect(
+ ID_DELETEALL,
+ wxEVT_COMMAND_TOOL_CLICKED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram));
+ Connect(
+ ID_CENTERVIEW,
+ wxEVT_COMMAND_TOOL_CLICKED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCenterViewActualDiagram));
+ Connect(ID_BTNBOX, wxEVT_COMMAND_TOOL_CLICKED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnBox));
+ Connect(
+ ID_BTEXECUTABLEBOX,
+ wxEVT_COMMAND_TOOL_CLICKED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnExecutableBox));
+ Connect(ID_BTNCOMPLEXBOX, wxEVT_COMMAND_TOOL_CLICKED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnComplexBox));
+ Connect(ID_ADDCOMPLEXBOXINPUT, wxEVT_COMMAND_TOOL_CLICKED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnAddComplexBoxInput));
+ Connect(ID_ADDCOMPLEXBOXOUTPUT, wxEVT_COMMAND_TOOL_CLICKED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnAddComplexBoxOutput));
+ Connect(ID_UNDO,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnUndo));
+ Connect(ID_REDO,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnRedo));
+ Connect(ID_CHANGENAME, wxEVT_COMMAND_RIGHT_CLICK, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnChangeName));
+ Connect(ID_EDITPROPERTIES,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnEditDiagramProperties));
+ Connect(ID_SHOWTREE,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnShowTree));
+
+
+}
+//=========================================================================
+void wxGUIEditorGraphicBBS::initHelpHTMLBrowser() {
+ // JGRR & CM
+ _helpHtmlBrowser = new WxGUIHtmlBrowser(this, wxSize(200, 0));
+
+ // EO JGRR & CM
+
+}
+
+//=========================================================================
+void wxGUIEditorGraphicBBS::initMenu() {
+ // Create File menu and its items
+ wxMenu *fileMenu = new wxMenu();
+ fileMenu->Append(ID_NEW, _T("New diagram"), _T("New"));
+ fileMenu->Append(ID_SAVE_DIAGRAM, _T("Save Diagram"), _T("Save Diagram")); //DFCH
+ fileMenu->Append(ID_SAVE_AS_DIAGRAM, _T("Save Diagram As"),
+ _T("Save Diagram As")); //DFCH
+ fileMenu->Append(ID_OPEN_BBS, _T("Open BBS"), _T("Open BBS"));
+ // CM
+ fileMenu->Append(ID_OPEN, _T("Open a diagram"), _T("Open a diagram"));
+ fileMenu->Append(ID_SAVE_AS_BBS, _T("Save BBS"), _T("Save BBS"));
+ fileMenu->Append(ID_SAVE_AS_COMPLEXBOX, _T("Save complex box"),
+ _T("Save complex box"));
+ fileMenu->Append(ID_EXPORT_CONSOLEAPP, _T("Export console commands"),
+ _T("Export console execution commands"));
+ fileMenu->Append(wxID_EXIT, _T("E&xit"), _T("Exit"));
+
+ Connect(ID_NEW, wxEVT_COMMAND_MENU_SELECTED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab));
+ Connect(ID_SAVE_DIAGRAM, wxEVT_COMMAND_MENU_SELECTED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualDiagram)); //DFCH
+ Connect(ID_SAVE_AS_DIAGRAM, wxEVT_COMMAND_MENU_SELECTED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveAsActualDiagram));
+ Connect(ID_OPEN_BBS, wxEVT_COMMAND_MENU_SELECTED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnOpenBBS));
+ Connect(ID_SAVE_AS_BBS, wxEVT_COMMAND_MENU_SELECTED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualBBS));
+ Connect( ID_SAVE_AS_COMPLEXBOX, wxEVT_COMMAND_MENU_SELECTED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualComplexBox));
+ Connect( ID_EXPORT_CONSOLEAPP, wxEVT_COMMAND_MENU_SELECTED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExportConsoleExecCommand));
+ Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED,
+ wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExit));