/*========================================================================= Program: bbtk Module: $RCSfile$ Language: C++ Date: $Date$ 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 * \brief Class bbtk::WxInterfaceEditorGraphicBBS . */ #include "bbtkwxGUIEditorGraphicBBS.h" namespace bbtk { //========================================================================= wxGUIEditorGraphicBBS::wxGUIEditorGraphicBBS(wxFrame *parent) : wxFrame(parent, -1, _T("bbtkGEditor"),wxDefaultPosition, wxSize(1200,800)) { _frameAUIMgr = new wxAuiManager(this); //std::string datadir( crea::System::GetExecutablePath() ); std::string datadir ("."); cout<<"RaC //------------------"<Update(); } //========================================================================= wxGUIEditorGraphicBBS::~wxGUIEditorGraphicBBS() { _frameAUIMgr->UnInit(); } //========================================================================= void wxGUIEditorGraphicBBS::initToolbar() { //std::string filename= _dataDir + "/data/icons/wxart_new.xpm"; wxBitmap bmp_new(new_xpm); wxToolBar *_toolbar = new wxToolBar(this, wxID_ANY); //Adds a tool btn to the toolbar _toolbar->AddTool(wxID_NEW,_T("New"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New tab"), _T("Create a new panel tab")); _toolbar->SetMargins( 2, 2 ); _toolbar->Realize(); SetToolBar(_toolbar); // connect command event handlers Connect(wxID_NEW,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick)); } //========================================================================= void wxGUIEditorGraphicBBS::initHelpHTMLBrowser() { //TO FIX THE PATH OF BBTK BIN IN ORDER TO USE REGENERATE EXECUTABLES //RegenerateAll(); _helpHtmlBrowser = new WxGUIHtmlBrowser(this,wxSize(200,0)); _frameAUIMgr->AddPane(_helpHtmlBrowser,wxAuiPaneInfo().Right().MinSize(200,200)); } //========================================================================= void wxGUIEditorGraphicBBS::initMenu() { // create a menu bar wxMenu *fileMenu = new wxMenu; // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About")); fileMenu->Append(wxID_EXIT, _T("E&xit"), _T("Exit")); Connect(wxID_EXIT,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExit)); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(fileMenu, _T("&File")); menuBar->Append(helpMenu, _T("&Help")); // attach this menu bar to the frame SetMenuBar(menuBar); } //========================================================================= void wxGUIEditorGraphicBBS::initTabPanelsManager() { wxAuiNotebook *notebook = new wxAuiNotebook(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxAUI_NB_TOP|wxAUI_NB_TAB_MOVE|wxAUI_NB_CLOSE_ON_ACTIVE_TAB|wxAUI_NB_TAB_FIXED_WIDTH|wxAUI_NB_WINDOWLIST_BUTTON); _tabsMgr = new wxTabPanelsManager(notebook); _frameAUIMgr->AddPane(notebook,wxAuiPaneInfo().CenterPane()); } //========================================================================= void wxGUIEditorGraphicBBS::initPackageBrowser() { _pkgBrowser = new WxGUIPackageBrowser2(this); _pkgBrowser->IncludeAll(); _frameAUIMgr->AddPane(_pkgBrowser,wxAuiPaneInfo().Left().MinSize(200,200).CloseButton(false)); } //================================================================ void wxGUIEditorGraphicBBS::initPropertiesPanel() { _propertiesPanel = new wxPropertiesPanel(this); _frameAUIMgr->AddPane(_propertiesPanel,wxAuiPaneInfo().Right().MinSize(200,200).CloseButton(false).Floatable(false)); } //================================================================ void wxGUIEditorGraphicBBS::DoRegeneratePackageDoc( const std::string& pack ) { std::string mess("Regenerating doc for package '"); if (pack!="-a"){ mess += pack + "'"; } else { mess = "Regenerating doc for all packages"; } mess += " ... please wait"; SetStatusText( std2wx(mess) ); //BBTK_BUSY_CURSOR; std::string command; #if defined(WIN32) command = "\""; #endif command += ConfigurationFile::GetInstance().Get_bin_path(); command += ConfigurationFile::GetInstance().Get_file_separator(); command += "bbRegeneratePackageDoc"; #if defined(WIN32) command += "\""; #endif command += " " + pack + " -q"; bbtkMessage("debug",1,"Executing system command '"<addNewTab(); break; } } void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event) { Close(true); } } // EO namespace bbtk // EOF