]> git.saurik.com Git - wxWidgets.git/commitdiff
1. added some test code (currently disabled) to controls
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 22 Jan 2000 01:45:24 +0000 (01:45 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 22 Jan 2000 01:45:24 +0000 (01:45 +0000)
2. removed test code (oops...) from minimal

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5583 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/controls/controls.cpp
samples/minimal/minimal.cpp

index 8b5e042fa63b12a38ae70124cace09e207922705..b40bf86a55e25b5a47090b6ce2db487d84c4512b 100644 (file)
@@ -140,6 +140,8 @@ public:
     wxStaticText  *m_label;
 
 private:
+    wxLog *m_logTargetOld;
+
     DECLARE_EVENT_TABLE()
 };
 
@@ -220,7 +222,7 @@ bool MyApp::OnInit()
     MyFrame *frame = new MyFrame((wxFrame *) NULL,
             "Controls wxWindows App",
             x, y, 540, 430);
-    
+
     frame->SetSizeHints( 500, 425 );
 
     // Give it an icon
@@ -382,7 +384,8 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
     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) );
 
@@ -1151,6 +1154,9 @@ void MyPanel::OnShowProgress( wxCommandEvent& WXUNUSED(event) )
 
 MyPanel::~MyPanel()
 {
+    //wxLog::RemoveTraceMask(_T("focus"));
+    delete wxLog::SetActiveTarget(m_logTargetOld);
+
     delete m_notebook->GetImageList();
 }
 
@@ -1265,11 +1271,11 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) )
         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
index 8a7835efe4b046d45a9ae8da62c509b764a8bda0..6a093c743ea6bc82e458fb0412d43ee6ae8a1456 100644 (file)
@@ -165,24 +165,6 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
     // ... 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);