Program: bbtk
Module: $RCSfile: bbtkWxGUITextEditor.cxx,v $
Language: C++
- Date: $Date: 2008/07/23 11:46:11 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2008/10/03 14:27:52 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//================================================================
-
//================================================================
/* BEGIN_EVENT_TABLE(WxGUITextEditorPage, wxPanel)
EVT_CLOSE(WxGUITextEditorPage::OnClose)
mName(""),
mAskFilename(true)
{
+
+ // std::cout << "WxGUITextEditorPage::WxGUITextEditorPage("<<mName<<")"<<std::endl;
+
wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
mwxInputText =
+
new WxTextCtrlGettingKeyEvents(this,
-1, //ID_InputText,
_T(""),
wxDefaultSize,
wxTE_MULTILINE
// |wxTE_PROCESS_ENTER
- | wxTE_PROCESS_TAB
+ //| wxTE_PROCESS_TAB
// | wxWANTS_CHARS
- | wxTAB_TRAVERSAL
+ // | wxTAB_TRAVERSAL
);
mwxInputText->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,
mUser(user),
mFileNameFilter("*.*")
{
- m_mgr.SetManagedWindow(this);
-
- // wxInitAllImageHandlers();
-
- mwxNotebook = new wxAuiNotebook(this,
+ // m_mgr.SetManagedWindow(this);
+ // wxInitAllImageHandlers();
+
+ // std::cout << "WxGUITextEditor::WxGUITextEditor"<<std::endl;
+
+ wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+
+ mwxNotebook = new wxNotebook(this,-1,
+ wxDefaultPosition, wxDefaultSize,
+ wxNB_TOP
+
+
+ );
+
+ sizer->Add(mwxNotebook,1,wxGROW);
+
+
+ /*
+ mwxNotebook = new wxAuiNotebook(this,
-1,
wxPoint(0, 0),
wxSize(500,500),
.Center()
.MinSize(wxSize(100,50))
);
-
+*/
/*
wxBitmap bmp_new(cc_new_xpm);
mwxToolBar->AddControl(mwxPosition);
mwxToolBar->Realize();
+ sizer->Add(mwxToolBar,0,wxGROW);
+
+ /*
m_mgr.AddPane(mwxToolBar,
wxAuiPaneInfo().Name(wxT("toolBar"))
.Caption(wxT(""))
.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;
}
}
mwxNotebook->DeletePage(mwxNotebook->GetSelection());
FocusOnCurrentPage();
- return false;
+ return true;
}
//================================================================
//================================================================
void WxGUITextEditor::OnKeyUp(wxKeyEvent& event)
{
- // std::cout << "U" << std::endl;
+ // std::cout << "U" << std::endl;
UpdateInfo();
}
//================================================================
//================================================================
void WxGUITextEditor::OnKeyDown(wxKeyEvent& event)
{
- // std::cout << "D" << std::endl;
+ // std::cout << "D" << std::endl;
// std::cout << "Key="<<event.GetKeyCode()<<std::endl;
if ( event.ControlDown() )
{
SetSizer(sizer);
- // Creates the parent window of all bbtk windows as a child of this
- Wx::CreateTopWindow(this);
+ // parent window of all bbtk windows will be a child of this
+ Wx::SetTopWindowParent(this);
// Add the method OnWxSignal as a Wx::Signal observer
//bbtkAddWxSignalObserver(WxGUITextEditorWindow::OnWxSignal);