--- /dev/null
+/* XPM */
+static char *delete_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 21 1",
+"2 c #A5AEBD",
+"* c #5478B4",
+"< c #95A3BB",
+"O c #9AA7BC",
+"; c #758EB7",
+"$ c #6986B6",
+"# c #4971B2",
+"& c #8A9CBA",
+"X c #8598B9",
+" c None",
+"o c #ABB2BE",
+"- c #7F95B9",
+"= c #4E74B3",
+"1 c #A0ABBC",
+"+ c #6F8AB7",
+". c #B5B9BF",
+"@ c #3E69B1",
+", c #90A0BA",
+": c #6483B5",
+"> c #5A7BB4",
+"% c #5F7FB5",
+/* pixels */
+" ",
+" .Xo OO ",
+" +@#. $@% ",
+" &@@X .*@*o ",
+" =@= .*@*. ",
+" -@@X*@*. ",
+" .#@@@$. ",
+" ;@@: ",
+" ;@@@+ ",
+" .>@#%@@. ",
+" o*@*oO@@, ",
+" <#@*. .@@= ",
+"&@@$ :@@1 ",
+";#& 2#>. ",
+" "
+};
--- /dev/null
+/* XPM */
+static char * down_xpm[] = {
+"16 15 3 1",
+" c None",
+". c Black",
+"X c Gray100",
+" ",
+" ...... ",
+" .XXXX. ",
+" .XXXX. ",
+" .XXXX. ",
+" .XXXX. ",
+" .XXXX. ",
+" .XXXX. ",
+" ....XXXX.... ",
+" .XXXXXXXX. ",
+" .XXXXXX. ",
+" .XXXX. ",
+" .XX. ",
+" .. ",
+" "};
--- /dev/null
+/* XPM */
+static char * eldel_xpm[] = {
+"16 16 3 1",
+" c None",
+". c #7F0000",
+"+ c #FFFFFF",
+" ",
+" ",
+" ",
+" ..+ ..+ ",
+" ....+ ..+ ",
+" ....+ ..+ ",
+" ...+ .+ ",
+" .....+ ",
+" ...+ ",
+" .....+ ",
+" ...+ ..+ ",
+" ...+ ..+ ",
+" ...+ .+ ",
+" ...+ .+ ",
+" . . ",
+" "};
--- /dev/null
+/* XPM */
+static char * eldown_xpm[] = {
+"16 16 2 1",
+" c None",
+". c #000000",
+" ",
+" ",
+" ... ",
+" ... ",
+" ... ",
+" ... ",
+" ... ",
+" ... ",
+" ........... ",
+" ......... ",
+" ....... ",
+" ..... ",
+" ... ",
+" . ",
+" ",
+" "};
--- /dev/null
+/* XPM */
+static char *exefile_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 51 1",
+"% c #E8E8EC",
+"= c #E8E8ED",
+"z c #CACAD4",
+"8 c #D9D9E1",
+"p c #D2D2DA",
+"u c #E1E1E7",
+"a c #D2D2DB",
+"< c #E9E9ED",
+"q c #DADAE1",
+"+ c #F1F1F4",
+"g c #D3D3DB",
+"1 c #E2E2E8",
+"x c #D3D3DC",
+"5 c #00A5FF",
+"$ c #EAEAEE",
+"4 c #DBDBE2",
+"h c #CCCCD6",
+"y c #D4D4DC",
+"r c #E3E3E9",
+"d c #D4D4DD",
+"7 c #DCDCE2",
+": c #EBEBEF",
+"0 c #DCDCE3",
+" c None",
+"O c #F3F3F5",
+"> c #E4E4E9",
+"& c #F3F3F6",
+"j c #D5D5DD",
+"6 c #E4E4EA",
+". c #C6C6D5",
+"# c #ECECF0",
+"f c #CECED7",
+"l c #CECED8",
+"e c #D6D6DE",
+"; c #EDEDF0",
+"3 c #DEDEE4",
+", c #EDEDF1",
+"c c #CFCFD8",
+"o c #F5F5F7",
+"- c #E6E6EB",
+"w c #D7D7DF",
+"v c #C8C8D3",
+"i c #DFDFE5",
+"@ c #EEEEF2",
+"s c #D0D0D9",
+"X c #9494AD",
+"9 c #D8D8DF",
+"t c #D8D8E0",
+"* c #EFEFF2",
+"2 c #E0E0E6",
+"k c #D1D1DA",
+/* pixels */
+" ........X ",
+" .oO+@#$%XX ",
+" .&+*#$=-XXX ",
+" .+*;:=->XXXX ",
+" .*,:<->1234X ",
+" .,5:5612378X ",
+" 5,5559530qwX ",
+" 55555550q9eX ",
+" 5555r5555teyX ",
+" 55rui559eypX ",
+" 5555i5555yasX ",
+" 5555555dasfX ",
+" 5355595gsfhX ",
+" .3595jgklhzX ",
+" .0qwjxkchzvX ",
+" XXXXXXXXXXXX "
+};
--- /dev/null
+/* XPM */
+static char *fileopen_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 36 1",
+"6 c #9BACC2",
+"< c #9AEA53",
+"9 c #94A5BD",
+"5 c #839CB5",
+"; c #4D7492",
+". c #376485",
+"$ c #7F99B4",
+"r c #D1D9E5",
+"7 c #EAEDF3",
+"@ c #CAD2DC",
+"% c #718BA7",
+"t c #BECAD9",
+"& c #65839D",
+"0 c #DCE2EA",
+"4 c #F5F6F7",
+"w c #597B9A",
+"O c #8DA0B9",
+" c None",
+"+ c #467291",
+"u c #305F81",
+"= c #B4C4D3",
+"# c #CAE2AA",
+"1 c #FAFCFE",
+"3 c #A8B6CA",
+"q c #E4E9ED",
+"8 c #EEF1F3",
+"X c #215579",
+"2 c #7F97B0",
+": c #B3BFD1",
+"y c #7A90AC",
+", c #C2CBDB",
+"- c #ADD668",
+"* c #B6D791",
+"e c #CAD6E1",
+"o c #DFF0D0",
+"> c #BBC4D6",
+/* pixels */
+" ",
+" .... ",
+"XXXXX .oo. ",
+"XOOOO+@.#o. ",
+"XOOOO$%&.*oXXX ",
+"XOOOOOOO.*oX=X ",
+"XOXXXX...-oXXXX;",
+"XOX:>,.<<<<<oX1;",
+"X2X3:>,.<<<oX4=;",
+"XX563:>>.<oX78; ",
+"XXO963:>>.X0q7; ",
+"Xw2O963:>>er0t; ",
+"X&y2O963:>,er; ",
+"uXXXXXXXXXXXX; ",
+" "
+};
--- /dev/null
+/* XPM */
+static char *filesave_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 21 1",
+"O c #FFFFFF",
+"> c #D5D6D8",
+"; c #446A8C",
+"1 c #CAD2DC",
+": c #C0C7D1",
+" c #5F666D",
+"% c #A5B0BA",
+"o c #65839D",
+", c #DCE2EA",
+"< c #C3C5C8",
+"- c #E1E6EE",
+"* c #C6CCD3",
+". c None",
+"$ c #305F81",
+"2 c #D6DFE7",
+"= c #D2D9E0",
+"& c #B7BFC7",
+"X c #1B4467",
+"# c #BCBDBE",
+"@ c #7A90AC",
+"+ c #5D7C93",
+/* pixels */
+" .",
+" XoOOOOOOOOO+X .",
+" @oO#######O+@ .",
+" @oOOOOOOOOO+@ .",
+" @oO#######O+@ .",
+" @oOOOOOOOOO+@ .",
+" @@+++++++++@@ .",
+" @@@@@@@@@@@@@ .",
+" @@@$$$$$$$$@@ .",
+" @@$%%%&*=-O$@ .",
+" @@$%X;;*=-O$@ .",
+" @@$%X;;:>,O$@ .",
+" @@$%X;;<12O$@ .",
+" @@$<<2OOOOO$@ .",
+". .."
+};
--- /dev/null
+/* XPM */
+static char *filesaveas_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 23 1",
+"X c Black",
+"+ c #FFFFFF",
+"< c #D5D6D8",
+"> c #446A8C",
+"3 c #CAD2DC",
+", c #C0C7D1",
+" c #5F666D",
+"* c #A5B0BA",
+"O c #65839D",
+"1 c #DCE2EA",
+"2 c #C3C5C8",
+": c #E1E6EE",
+". c #FFFF00",
+"- c #C6CCD3",
+"@ c None",
+"& c #305F81",
+"4 c #D6DFE7",
+"; c #D2D9E0",
+"= c #B7BFC7",
+"o c #1B4467",
+"$ c #BCBDBE",
+"# c #7A90AC",
+"% c #5D7C93",
+/* pixels */
+" .X .XX.",
+" oO+++++++.X.X.@",
+" #O+$$$$$XX...XX",
+" #O++++++.......",
+" #O+$$$$$XX...XX",
+" #O+++++++.X.X.@",
+" ##%%%%%%.X%.X .",
+" ############# @",
+" ###&&&&&&&&## @",
+" ##&***=-;:+&# @",
+" ##&*o>>-;:+&# @",
+" ##&*o>>,<1+&# @",
+" ##&*o>>234+&# @",
+" ##&224+++++&# @",
+"@ @@"
+};
--- /dev/null
+/* XPM */
+static char *new_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 29 1",
+"* c #97C4E7",
+"- c #72A8D2",
+": c #FFFFFF",
+"9 c #839CB5",
+"o c #6B98B8",
+"X c #5A89A6",
+"# c #3A749C",
+", c #D1E5F5",
+"0 c #85A7BC",
+"$ c #C3DDF1",
+"8 c #749BB4",
+"; c #5F9BC8",
+" c None",
+"+ c #538DB3",
+"= c #85BBE2",
+"3 c #EFF6FC",
+"O c #6591AE",
+"5 c #F7FBFD",
+"7 c #FAFCFE",
+"< c #DAEAF7",
+"4 c #E9F3FA",
+"6 c #FDFDFE",
+"1 c #E2EFF8",
+". c #8EA9BC",
+"% c #B6D5EE",
+"& c #A5CCEA",
+"> c #ACE95B",
+"2 c #F4F9FD",
+"@ c #4581AA",
+/* pixels */
+" .XoOO+@#. ",
+" .$$%&*=O-; ",
+" @@@@$%&*O:*o ",
+" @>>@$$%&O::*o ",
+"@@@>>@@@$%OOoO+ ",
+"@>>>>>>@,$%&*=+ ",
+"@>>>>>>@<,$%&*+ ",
+"@@@>>@@@1<,$%&O ",
+" @>>@2341<,$%O ",
+" @@@@52341<,$o ",
+" .:6752341<,8 ",
+" .::6752341<8 ",
+" .:::67523419 ",
+" .::::6752340 ",
+" ............ "
+};
Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $ $
Language: C++
- Date: $Date: 2008/03/25 06:22:53 $
- Version: $Revision: 1.53 $
+ Date: $Date: 2008/03/25 15:47:54 $
+ Version: $Revision: 1.54 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if (fs!=0) in_script = true;
file = mFileName.back();
line = mLine.back();
- }
+ }
+ CloseAllFiles();
throw InterpreterError(e,in_script,file,line);
}
else
file = mFileName.back();
line = mLine.back();
}
- throw InterpreterError(e.what(),in_script,file,line);
+ CloseAllFiles();
+ throw InterpreterError(e.what(),in_script,file,line);
}
else
{
file = mFileName.back();
line = mLine.back();
}
- throw InterpreterError("Unknown exception caught",
+ CloseAllFiles();
+ throw InterpreterError("Unknown exception caught",
in_script,file,line);
}
else
Program: bbtk
Module: $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $
Language: C++
- Date: $Date: 2008/03/25 10:31:18 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/03/25 15:47:54 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
mInterpreter = new bbtk::Interpreter();
mInterpreter->SetUser(this);
mInterpreter->SetCommandLine(true);
+ mInterpreter->SetThrow(true);
//==============
// Menu
wxInitAllImageHandlers();
menuWindows->AppendSeparator();
menuWindows->Append ( ID_Menu_Windows_Save, _T("Save interface configuration"));
+ wxMenu *menuOptions = new wxMenu;
+ mwxMenuItemReset = menuOptions->AppendCheckItem(-1,
+ _T("Reset before running") );
+ mwxMenuItemReset->Check();
+
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append( menuFile, _T("&File") );
menuBar->Append( menuTools, _T("&Tools") );
+ menuBar->Append( menuOptions, _T("&Options") );
menuBar->Append( menuWindows, _T("&Windows") );
menuBar->Append( menuAbout, _T("About") );
mWxGUITextEditor->Open(filename);
}
//================================================================
-
+
+#define CATCH_MACRO \
+ catch (InterpreterError e) \
+ { \
+ std::cerr << "* IERROR : "<<e.GetMessage()<<std::endl; \
+ if (e.IsInScriptFile()) \
+ std::cerr << "* FILE : '"<<e.GetScriptFile()<<"'"<<std::endl; \
+ std::cerr << "* LINE : "<<e.GetScriptLine()<<std::endl; \
+ int lev = bbtk::MessageManager::GetMessageLevel("Error"); \
+ if (lev > 0) { \
+ std::cerr << "* Exception thrown : "<<std::endl; \
+ std::cerr << "* OBJECT : " <<e.GetObject()<<std::endl; \
+ std::cerr << "* FILE : " <<e.GetSourceFile()<<std::endl; \
+ } \
+ }
+
//================================================================
void WxGUIScriptingInterface::WxGUICommandEnter(const std::string& command)
{
std::string s("> ");
s += command + "\n";
mWxGUIOutputMessages->Print(s,wxRED);
-
- if ( mInterpreter->InterpretLine( command ) ==
- Interpreter::Interpreter_QUIT )
+
+ try
{
- Close(true);
+ mInterpreter->InterpretLine( command );
}
+ CATCH_MACRO;
}
//================================================================
-
+
//================================================================
/// Runs the interpretation of a file
bool WxGUIScriptingInterface::InterpretFile( const std::string& filename)
{
- if ( mInterpreter->InterpretFile(filename) ==
- Interpreter::Interpreter_ERROR )
+ try
{
- return false;
+ mInterpreter->InterpretFile(filename);
}
+ CATCH_MACRO;
return true;
}
//================================================================
// wxString temp = mWxGUIHtmlBrowser->GetCurrentPage();
std::stringstream* buf = new std::stringstream;
(*buf) << mWxGUITextEditor->GetCurrentPage()->GetText();
-
- mInterpreter->SetThrow(true);
try
{
+ if (mwxMenuItemReset->IsChecked()) WxGUICommandEnter("reset");
mInterpreter->InterpretBuffer(buf);
}
- catch (InterpreterError e)
- {
- std::cerr << "* IERROR : "<<e.GetMessage()<<std::endl;
- if (e.IsInScriptFile())
- std::cerr << "* FILE : '"<<e.GetScriptFile()<<"'"<<std::endl;
- std::cerr << "* LINE : "<<e.GetScriptLine()<<std::endl;
- int lev = bbtk::MessageManager::GetMessageLevel("Error");
- if (lev > 0) {
- std::cerr << "* Exception thrown : "<<std::endl;
- std::cerr << "* OBJECT : " <<e.GetObject()<<std::endl;
- std::cerr << "* FILE : " <<e.GetSourceFile()<<std::endl;
- }
- }
- /*
- // wxString temp = mWxGUIHtmlBrowser->GetCurrentPage();
- std::string filename = mWxGUITextEditor->GetCurrentPage();//wx2std(temp);
- size_t s = filename.length();
-
- Interpreter* I = new Interpreter;
-
- if ((s>3) && (filename[s-1]=='s')
- && (filename[s-2]=='b')
- && (filename[s-3]=='b')
- && (filename[s-4]=='.'))
- {
- std::string tmp("Executing ");
- tmp += filename;
- SetStatusText(std2wx(tmp));
- I->InterpretFile(filename);
- }
- else
- {
- SetStatusText(_T("The current page is not a bbs file : cannot execute it"));
- }
-
- delete I;
- */
+ CATCH_MACRO
}
//================================================================
//================================================================
void WxGUIScriptingInterface::OnMenuQuit(wxCommandEvent& WXUNUSED(event))
{
+ if (!mWxGUITextEditor->CloseAllPages()) return;
Close(true);
}
//================================================================
Program: bbtk
Module: $RCSfile: bbtkWxGUIScriptingInterface.h,v $
Language: C++
- Date: $Date: 2008/03/25 10:31:18 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/03/25 15:47:54 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void OnMenuWindowsSave( wxCommandEvent& WXUNUSED(event));
void OnMenuWindowsCheck( wxCommandEvent& event,
wxWindow* w);
-
void OnPaneClose(wxAuiManagerEvent& evt);
WxGUIHtmlBrowser* mWxGUIHtmlBrowser;
WxGUITextEditor* mWxGUITextEditor;
+ wxMenuItem* mwxMenuItemReset;
// wxButton* mwxButtonRun;
public:
Program: bbtk
Module: $RCSfile: bbtkWxGUITextEditor.cxx,v $
Language: C++
- Date: $Date: 2008/03/25 10:31:18 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/03/25 15:47:54 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#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_down.xpm"
+#include "../data/icons/wxart_eldel.xpm"
namespace bbtk
{
// BUTTONS
wxPanel *btnsCtrlPanel = new wxPanel(this,-1);
wxBoxSizer *btnsSizer = new wxBoxSizer(wxHORIZONTAL);
-
+
+ /*
wxBitmap bmp_new(cc_new_xpm);
- mwxButtonNew = new wxBitmapButton( btnsCtrlPanel,ID_ButtonNew,bmp_new);//_T("New") );
- btnsSizer->Add( mwxButtonNew );
wxBitmap bmp_open(cc_open_xpm);
- mwxButtonOpen = new wxBitmapButton( btnsCtrlPanel,ID_ButtonOpen,bmp_open);//,_T("Open") );
- btnsSizer->Add( mwxButtonOpen );
wxBitmap bmp_close(cc_stop_xpm);
- mwxButtonClose = new wxBitmapButton( btnsCtrlPanel,ID_ButtonClose,bmp_close);//,_T("Open") );
- btnsSizer->Add( mwxButtonClose );
wxBitmap bmp_save(cc_save_xpm);
- mwxButtonSave = new wxBitmapButton( btnsCtrlPanel,ID_ButtonSave,bmp_save);//_T("Save") );
- btnsSizer->Add( mwxButtonSave );
wxBitmap bmp_saveas(cc_save_as_xpm);
- mwxButtonSaveAs = new wxBitmapButton( btnsCtrlPanel,ID_ButtonSaveAs,bmp_saveas);//_T("Save") );
+ wxBitmap bmp_run(cc_run_xpm);
+ */
+ wxBitmap bmp_new(new_xpm);
+ wxBitmap bmp_open(fileopen_xpm);
+ wxBitmap bmp_close(eldel_xpm);
+ wxBitmap bmp_save(filesave_xpm);
+ wxBitmap bmp_saveas(filesaveas_xpm);
+ wxBitmap bmp_run(down_xpm);
+
+
+ wxSize btn_size(32,32);
+ mwxButtonNew = new wxBitmapButton( btnsCtrlPanel,ID_ButtonNew,bmp_new
+ ,wxDefaultPosition, btn_size);
+ btnsSizer->Add( mwxButtonNew );
+
+ mwxButtonOpen = new wxBitmapButton( btnsCtrlPanel,ID_ButtonOpen,bmp_open ,wxDefaultPosition, btn_size);//,_T("Open") );
+ btnsSizer->Add( mwxButtonOpen );
+
+ mwxButtonClose = new wxBitmapButton( btnsCtrlPanel,ID_ButtonClose,bmp_close ,wxDefaultPosition, btn_size);//,_T("Open") );
+ btnsSizer->Add( mwxButtonClose );
+
+ mwxButtonSave = new wxBitmapButton( btnsCtrlPanel,ID_ButtonSave,bmp_save ,wxDefaultPosition, btn_size);//_T("Save") );
+ btnsSizer->Add( mwxButtonSave );
+
+ mwxButtonSaveAs = new wxBitmapButton( btnsCtrlPanel,ID_ButtonSaveAs,bmp_saveas ,wxDefaultPosition, btn_size);//_T("Save") );
btnsSizer->Add( mwxButtonSaveAs );
- wxBitmap bmp_run(cc_run_xpm);
- mwxButtonRun = new wxBitmapButton( btnsCtrlPanel,ID_ButtonRun,bmp_run);//_T("Run") );
+
+ mwxButtonRun = new wxBitmapButton( btnsCtrlPanel,ID_ButtonRun,bmp_run ,wxDefaultPosition, btn_size);//_T("Run") );
btnsSizer->Add( mwxButtonRun );
/*
wxBitmap bmp_quit(cc_exit_xpm);
WxGUITextEditor::~WxGUITextEditor()
{
m_mgr.UnInit();
+
// delete mInterpreter;
}
//================================================================
//================================================================
void WxGUITextEditor::OnButtonClose(wxCommandEvent& event)
{
+ CloseCurrentPage();
+ }
+ //================================================================
+
+ //================================================================
+ bool WxGUITextEditor::CloseCurrentPage()
+ {
std::cout << "-------------- CLOSE ---------------"<<std::endl;
- if (mwxNotebook->GetPageCount()==0) return;
+ if (mwxNotebook->GetPageCount()==0) return true;
if (GetCurrentPage()->IsModified())
{
+ wxString mess = std2wx(GetCurrentPage()->GetPageName());
+ mess += _T(" modified. Save it ?");
wxMessageDialog* d =
new wxMessageDialog(this,
- _T("Buffer modified. Save it ?"),
+ mess,
_T("Save buffer"),
wxYES_NO | wxCANCEL | wxICON_QUESTION);
switch (d->ShowModal())
{
case wxID_CANCEL :
- return;
+ return false;
break;
case wxID_YES :
GetCurrentPage()->Save(mFileNameFilter);
}
mwxNotebook->DeletePage(mwxNotebook->GetSelection());
FocusOnCurrentPage();
- }
+ return true;
+ }
+ //================================================================
+
+ //================================================================
+ bool WxGUITextEditor::CloseAllPages()
+ {
+ bool ok = true;
+ while (mwxNotebook->GetPageCount()!=0)
+ {
+ if (!CloseCurrentPage())
+ {
+ ok = false;
+ break;
+ }
+ }
+ return ok;
+ }
//================================================================
//================================================================
void WxGUITextEditor::OnButtonSave(wxCommandEvent& event)
{
- Save();
+ SaveCurrentPage();
}
- void WxGUITextEditor::Save()
+ void WxGUITextEditor::SaveCurrentPage()
{
- std::cout << "-------------- SAVE ---------------"<<std::endl;
if (mwxNotebook->GetPageCount()==0) return;
GetCurrentPage()->Save(mFileNameFilter);
mwxNotebook->SetPageText(mwxNotebook->GetSelection(),
{
if (mwxNotebook->GetPageCount()==0) return;
GetCurrentPage()->SetAskFilename(true);
- Save();
+ SaveCurrentPage();
}
//================================================================
void WxGUITextEditor::OnPageClose(wxAuiNotebookEvent& evt)
{
std::cout << "-------------- CLOSE ---------------"<<std::endl;
+ if (!CloseCurrentPage()) evt.Veto();
+
+ /*
if (mwxNotebook->GetPageCount()==0) return;
if (GetCurrentPage()->IsModified())
{
case wxID_NO : ;
}
}
-
+ */
}
//================================================================
switch (event.GetKeyCode())
{
case 'n': case 'N' : New(); break;
- case 's': case 'S' : Save(); break;
+ case 's': case 'S' : SaveCurrentPage(); break;
case 'o': case 'O' : Open(); break;
// case 'r': case 'R' : Run(); break;
// case 'q': case 'Q' : Quit(); break;
Program: bbtk
Module: $RCSfile: bbtkWxGUITextEditor.h,v $
Language: C++
- Date: $Date: 2008/03/25 10:31:18 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/03/25 15:47:54 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void New();
void Open();
void Open(const std::string& filename);
- void Save();
+ void SaveCurrentPage();
+ bool CloseCurrentPage();
+ bool CloseAllPages();
// void Run();
// void Quit();