git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28338
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// event handlers (these functions should _not_ be virtual)
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
// event handlers (these functions should _not_ be virtual)
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
void OnLogs(wxCommandEvent& event);
void OnLogs(wxCommandEvent& event);
void OnBrowser(wxCommandEvent& event);
void OnPlugProvider(wxCommandEvent& event);
void OnBrowser(wxCommandEvent& event);
void OnPlugProvider(wxCommandEvent& event);
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(ID_Quit, MyFrame::OnQuit)
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(ID_Quit, MyFrame::OnQuit)
EVT_MENU(ID_Logs, MyFrame::OnLogs)
EVT_MENU(ID_Logs, MyFrame::OnLogs)
EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
EVT_MENU(ID_Browser, MyFrame::OnBrowser)
EVT_MENU(ID_PlugProvider, MyFrame::OnPlugProvider)
EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
EVT_MENU(ID_Browser, MyFrame::OnBrowser)
EVT_MENU(ID_PlugProvider, MyFrame::OnPlugProvider)
menuFile->AppendCheckItem(ID_PlugProvider, _T("&Plug-in art provider"), _T("Enable custom art provider"));
menuFile->AppendSeparator();
menuFile->AppendCheckItem(ID_PlugProvider, _T("&Plug-in art provider"), _T("Enable custom art provider"));
menuFile->AppendSeparator();
menuFile->Append(ID_Logs, _T("&Logging test"), _T("Show some logging output"));
menuFile->Append(ID_Logs, _T("&Logging test"), _T("Show some logging output"));
menuFile->Append(ID_Browser, _T("&Resources browser"), _T("Browse all available icons"));
menuFile->AppendSeparator();
menuFile->Append(ID_Browser, _T("&Resources browser"), _T("Browse all available icons"));
menuFile->AppendSeparator();
void MyFrame::OnLogs(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(_T("Some information."));
void MyFrame::OnLogs(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(_T("Some information."));
wxLog::GetActiveTarget()->Flush();
wxLogMessage(_T("Check/uncheck 'File/Plug-in art provider' and try again."));
}
wxLog::GetActiveTarget()->Flush();
wxLogMessage(_T("Check/uncheck 'File/Plug-in art provider' and try again."));
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
pEditorDlg = NULL;
pParamDlg = NULL;
pEditorDlg = NULL;
pParamDlg = NULL;
delete wxLog::SetActiveTarget(new wxLogStderr);
delete wxLog::SetActiveTarget(new wxLogStderr);
} // DatabaseDemoFrame constructor
DatabaseDemoFrame::~DatabaseDemoFrame()
{
} // DatabaseDemoFrame constructor
DatabaseDemoFrame::~DatabaseDemoFrame()
{
delete wxLog::SetActiveTarget(NULL);
delete wxLog::SetActiveTarget(NULL);
} // DatabaseDemoFrame destructor
} // DatabaseDemoFrame destructor
{
wxLogError(wxT("The sample can't run on this system."));
{
wxLogError(wxT("The sample can't run on this system."));
wxLog::GetActiveTarget()->Flush();
wxLog::GetActiveTarget()->Flush();
// do it here, OnExit() won't be called
delete m_dial;
// do it here, OnExit() won't be called
delete m_dial;
wxDefaultPosition,
wxDefaultSize )
{
wxDefaultPosition,
wxDefaultSize )
{
- int gridW = 600, gridH = 300;
- int logW = gridW, logH = 100;
-
wxMenu *fileMenu = new wxMenu;
fileMenu->Append( ID_VTABLE, _T("&Virtual table test\tCtrl-V"));
fileMenu->Append( ID_BUGS_TABLE, _T("&Bugs table test\tCtrl-B"));
wxMenu *fileMenu = new wxMenu;
fileMenu->Append( ID_VTABLE, _T("&Virtual table test\tCtrl-V"));
fileMenu->Append( ID_BUGS_TABLE, _T("&Bugs table test\tCtrl-B"));
wxPoint( 0, 0 ),
wxSize( 400, 300 ) );
wxPoint( 0, 0 ),
wxSize( 400, 300 ) );
+#if wxUSE_LOG
+ int gridW = 600, gridH = 300;
+ int logW = gridW, logH = 100;
+
logWin = new wxTextCtrl( this,
wxID_ANY,
wxEmptyString,
logWin = new wxTextCtrl( this,
wxID_ANY,
wxEmptyString,
logger = new wxLogTextCtrl( logWin );
m_logOld = logger->SetActiveTarget( logger );
logger->SetTimestamp( NULL );
logger = new wxLogTextCtrl( logWin );
m_logOld = logger->SetActiveTarget( logger );
logger->SetTimestamp( NULL );
// this will create a grid and, by default, an associated grid
// table for strings
// this will create a grid and, by default, an associated grid
// table for strings
topSizer->Add( logWin,
0,
wxEXPAND );
topSizer->Add( logWin,
0,
wxEXPAND );
GridFrame::~GridFrame()
{
GridFrame::~GridFrame()
{
delete wxLog::SetActiveTarget(m_logOld);
delete wxLog::SetActiveTarget(m_logOld);
class GridFrame : public wxFrame
{
wxGrid *grid;
class GridFrame : public wxFrame
{
wxGrid *grid;
wxTextCtrl *logWin;
wxLogTextCtrl *logger;
wxTextCtrl *logWin;
wxLogTextCtrl *logger;
wxString logBuf;
void SetDefaults();
wxString logBuf;
void SetDefaults();
// add the cells to selection when using commands from select menu?
bool m_addToSel;
// add the cells to selection when using commands from select menu?
bool m_addToSel;
m_btnExit = new wxButton( m_panel, wxID_OK, wxT("&Exit") );
m_btnExit->SetDefault();
m_btnExit = new wxButton( m_panel, wxID_OK, wxT("&Exit") );
m_btnExit->SetDefault();
m_text = new wxTextCtrl(m_panel, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
m_logTargetOld = wxLog::SetActiveTarget( new wxLogTextCtrl(m_text) );
m_text = new wxTextCtrl(m_panel, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
m_logTargetOld = wxLog::SetActiveTarget( new wxLogTextCtrl(m_text) );
// Set sizers
m_sizerFrame = new wxBoxSizer(wxVERTICAL);
// Set sizers
m_sizerFrame = new wxBoxSizer(wxVERTICAL);
m_sizerFrame->Add(m_sizerTop, 1, wxEXPAND);
m_sizerFrame->Add(m_sizerTop, 1, wxEXPAND);
m_sizerFrame->Add(m_text, 0, wxEXPAND);
m_sizerFrame->Add(m_text, 0, wxEXPAND);
ReInitNotebook();
m_notebook->CreateInitialPages();
ReInitNotebook();
m_notebook->CreateInitialPages();
delete wxLog::SetActiveTarget(m_logTargetOld);
delete wxLog::SetActiveTarget(m_logTargetOld);
wxLogMessage(wxT("Notebook event #%d: %s (%d)"),
s_numNotebookEvents++, str.c_str(), eventType);
wxLogMessage(wxT("Notebook event #%d: %s (%d)"),
s_numNotebookEvents++, str.c_str(), eventType);
m_text->SetInsertionPointEnd();
m_text->SetInsertionPointEnd();
// Log window
wxTextCtrl *m_text;
// Log window
wxTextCtrl *m_text;