wxStaticText *m_label;
private:
+ wxLog *m_logTargetOld;
+
DECLARE_EVENT_TABLE()
};
MyFrame *frame = new MyFrame((wxFrame *) NULL,
"Controls wxWindows App",
x, y, 540, 430);
-
+
frame->SetSizeHints( 500, 425 );
// Give it an icon
m_text = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE );
// m_text->SetBackgroundColour("wheat");
- //delete wxLog::SetActiveTarget(new wxLogStderr);
+ //wxLog::AddTraceMask(_T("focus"));
+ m_logTargetOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_text));
m_notebook = new wxNotebook( this, ID_NOTEBOOK, wxPoint(0,0), wxSize(200,150) );
MyPanel::~MyPanel()
{
+ //wxLog::RemoveTraceMask(_T("focus"));
+ delete wxLog::SetActiveTarget(m_logTargetOld);
+
delete m_notebook->GetImageList();
}
wxString msg;
msg.Printf(
#ifdef __WXMSW__
- _T("Focus: wxWindow = %p, HWND = %08x"),
+ _T("Focus: %s, HWND = %08x"),
#else
- _T("Focus: wxWindow = %p"),
+ _T("Focus: %s"),
#endif
- s_windowFocus
+ s_windowFocus->GetClassInfo()->GetClassName()
#ifdef __WXMSW__
, s_windowFocus->GetHWND()
#endif
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
- wxPanel *panel = new wxPanel(this, -1);
- wxStaticBox *box = new wxStaticBox(panel, -1, "box");
- wxComboBox *combo = new wxComboBox(panel, -1, "combo");
- wxLayoutConstraints *c;
- c = new wxLayoutConstraints;
- c->left.SameAs(panel, wxLeft);
- c->right.SameAs(panel, wxRight);
- c->top.SameAs(panel, wxTop);
- c->bottom.SameAs(panel, wxBottom);
- box->SetConstraints(c);
- c = new wxLayoutConstraints;
- c->left.SameAs(box, wxLeft, 20);
- c->right.SameAs(box, wxRight, 10);
- c->top.SameAs(box, wxTop, 10);
- c->bottom.SameAs(box, wxBottom, 10);
- combo->SetConstraints(c);
- panel->SetAutoLayout(TRUE);
-
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);