]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
It is possible to center the view to the original point
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / bbtkwxGUIEditorGraphicBBS.cxx
index 7f8e8ac21699f6c4af3470e4cc5d588aacf1f4fd..8d63e0db11f9b519e53d3321b980e68c0eab0ff0 100644 (file)
@@ -88,6 +88,7 @@ namespace bbtk
                wxBitmap bmp_new(new_xpm);
                wxBitmap bmp_run(run_xpm);
                wxBitmap bmp_delete(delete_xpm);
+               wxBitmap bmp_centerview(centerview_xpm);
 
                wxToolBar  *_toolbar = new wxToolBar(this, wxID_ANY);
 
@@ -95,6 +96,7 @@ namespace bbtk
                _toolbar->AddTool(1000,_T("New"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New tab"), _T("Create a new panel tab"));
                _toolbar->AddTool(1001,_T("Execute"),bmp_run, wxNullBitmap, wxITEM_NORMAL,_T("Execute actual diagram"), _T("Execute actual diagram"));
                _toolbar->AddTool(1002,_T("Delete all"),bmp_delete, wxNullBitmap, wxITEM_NORMAL,_T("Delete all boxes"), _T("Delete all boxes"));
+               _toolbar->AddTool(1003,_T("Center view"),bmp_centerview, wxNullBitmap, wxITEM_NORMAL,_T("Center view"), _T("Center view"));
 
                _toolbar->SetMargins( 2, 2 );
                _toolbar->Realize();
@@ -104,6 +106,7 @@ namespace bbtk
                Connect(1000,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab));
                Connect(1001,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExecuteActualDiagram));
                Connect(1002,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram));
+               Connect(1003,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCenterViewActualDiagram));
 
        }
        //=========================================================================
@@ -362,12 +365,20 @@ namespace bbtk
 
        //=========================================================================
 
+       void wxGUIEditorGraphicBBS::OnCenterViewActualDiagram(wxCommandEvent& event)
+       {
+               _tabsMgr->centerViewActualDiagram();
+       }
+
+       //=========================================================================
+
        void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event)
        {
                Close(true);
        }
 
 
+
 }  // EO namespace bbtk
 
 // EOF