X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkWxGUITextEditor.cxx;h=5f065ff9f4ff859f66bce3e46149ec806d233116;hb=d7e710c3fe8bd9c8c5fb79073bd5667b24c048f8;hp=b1f95b4af9449dbd116d9402c1d25b2baccdd0d0;hpb=f993478d7df1d9688c4ab93c617688c84cf2d424;p=bbtk.git diff --git a/kernel/src/bbtkWxGUITextEditor.cxx b/kernel/src/bbtkWxGUITextEditor.cxx index b1f95b4..5f065ff 100644 --- a/kernel/src/bbtkWxGUITextEditor.cxx +++ b/kernel/src/bbtkWxGUITextEditor.cxx @@ -1,20 +1,35 @@ -/*========================================================================= - +/*========================================================================= Program: bbtk Module: $RCSfile: bbtkWxGUITextEditor.cxx,v $ Language: C++ - Date: $Date: 2008/05/14 12:32:26 $ - Version: $Revision: 1.12 $ - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*//** + Date: $Date: 2008/10/17 08:18:15 $ + Version: $Revision: 1.18 $ +=========================================================================*/ + +/* --------------------------------------------------------------------- + +* 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. +* ------------------------------------------------------------------------ */ + + +/** * \brief Short description in one line * * Long description which @@ -38,20 +53,20 @@ #include "bbtkConfigurationFile.h" #include "bbtkUtilities.h" -#include "icons/cc_new.xpm" -#include "icons/cc_open.xpm" -#include "icons/cc_stop.xpm" -#include "icons/cc_save.xpm" -#include "icons/cc_save_as.xpm" -#include "icons/cc_run.xpm" -#include "icons/cc_exit.xpm" +//#include "icons/cc_new.xpm" +//#include "icons/cc_open.xpm" +//#include "icons/cc_stop.xpm" +//#include "icons/cc_save.xpm" +//#include "icons/cc_save_as.xpm" +//#include "icons/cc_run.xpm" +//#include "icons/cc_exit.xpm" #include "../data/icons/wxart_new.xpm" #include "../data/icons/wxart_fileopen.xpm" #include "../data/icons/wxart_filesave.xpm" #include "../data/icons/wxart_filesaveas.xpm" -#include "../data/icons/wxart_exefile.xpm" -#include "../data/icons/wxart_delete.xpm" +//#include "../data/icons/wxart_exefile.xpm" +//#include "../data/icons/wxart_delete.xpm" #include "../data/icons/wxart_down.xpm" #include "../data/icons/wxart_eldel.xpm" @@ -107,7 +122,6 @@ namespace bbtk //================================================================ - //================================================================ /* BEGIN_EVENT_TABLE(WxGUITextEditorPage, wxPanel) EVT_CLOSE(WxGUITextEditorPage::OnClose) @@ -122,9 +136,13 @@ namespace bbtk mName(""), mAskFilename(true) { + + // std::cout << "WxGUITextEditorPage::WxGUITextEditorPage("<SetWxGUITextEditor(mEditor); - + /* + new wxTextCtrl(this,-1,_T(""), + wxDefaultPosition, + wxDefaultSize, + wxTE_MULTILINE + // |wxTE_PROCESS_ENTER + // | wxTE_PROCESS_TAB + // | wxWANTS_CHARS + // | wxTAB_TRAVERSAL + ); + */ wxFont* FixedFont = new wxFont(10, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, @@ -189,8 +217,11 @@ namespace bbtk wxFileDialog* fd = new wxFileDialog(this,_T("Save file"),_T(""), _T(""),std2wx(filter), wxSAVE | wxOVERWRITE_PROMPT ); - fd->ShowModal(); + int result_fd = fd->ShowModal(); + // This line is need it by windows // EED + fd->SetReturnCode( result_fd ); + if (fd->GetReturnCode()==wxID_OK) { mName = wx2std(fd->GetPath()); @@ -242,11 +273,25 @@ namespace bbtk mUser(user), mFileNameFilter("*.*") { - m_mgr.SetManagedWindow(this); - - // wxInitAllImageHandlers(); - - mwxNotebook = new wxAuiNotebook(this, + // m_mgr.SetManagedWindow(this); + // wxInitAllImageHandlers(); + + // std::cout << "WxGUITextEditor::WxGUITextEditor"<Add(mwxNotebook,1,wxGROW); + + + /* + mwxNotebook = new wxAuiNotebook(this, -1, wxPoint(0, 0), wxSize(500,500), @@ -271,7 +316,7 @@ namespace bbtk .Center() .MinSize(wxSize(100,50)) ); - +*/ /* wxBitmap bmp_new(cc_new_xpm); @@ -316,6 +361,9 @@ namespace bbtk mwxToolBar->AddControl(mwxPosition); mwxToolBar->Realize(); + sizer->Add(mwxToolBar,0,wxGROW); + + /* m_mgr.AddPane(mwxToolBar, wxAuiPaneInfo().Name(wxT("toolBar")) .Caption(wxT("")) @@ -324,20 +372,24 @@ namespace bbtk .MinSize(wxSize(100,50)) .LeftDockable(false).RightDockable(false) ); - - NewPage(""); - UpdateInfo(); +*/ + SetSizer(sizer); + - m_mgr.Update(); +// m_mgr.Update(); SetAutoLayout(true); Layout(); + + NewPage(""); + UpdateInfo(); + } //================================================================ //================================================================ WxGUITextEditor::~WxGUITextEditor() { - m_mgr.UnInit(); + // m_mgr.UnInit(); // delete mInterpreter; } @@ -432,8 +484,11 @@ namespace bbtk wxFileDialog* fd = new wxFileDialog(this,_T("Open file"),_T(""), _T(""),std2wx(mFileNameFilter), wxOPEN | wxFILE_MUST_EXIST ); - fd->ShowModal(); - + int result_fd = fd->ShowModal(); + + // This line is need it by windows //EED + fd->SetReturnCode( result_fd ); + if (fd->GetReturnCode()==wxID_OK) { std::string filename = wx2std(fd->GetPath()); @@ -483,7 +538,7 @@ namespace bbtk } mwxNotebook->DeletePage(mwxNotebook->GetSelection()); FocusOnCurrentPage(); - return false; + return true; } //================================================================ @@ -608,7 +663,7 @@ namespace bbtk //================================================================ void WxGUITextEditor::OnKeyUp(wxKeyEvent& event) { - // std::cout << "U" << std::endl; + // std::cout << "U" << std::endl; UpdateInfo(); } //================================================================ @@ -616,7 +671,7 @@ namespace bbtk //================================================================ void WxGUITextEditor::OnKeyDown(wxKeyEvent& event) { - // std::cout << "D" << std::endl; + // std::cout << "D" << std::endl; // std::cout << "Key="<