]> git.saurik.com Git - wxWidgets.git/commitdiff
test for wxFrame::GetPosition/GetSize added
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 6 Nov 1999 16:12:44 +0000 (16:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 6 Nov 1999 16:12:44 +0000 (16:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/controls/controls.cpp

index 8eb3a5994567d0b35ba0f9a9e19dcc4e9e254f62..610d0f8a0107df2b7cabe56aa3836518e3f8082c 100644 (file)
@@ -161,8 +161,17 @@ public:
 
     void OnIdle( wxIdleEvent& event );
     void OnSize( wxSizeEvent& event );
+    void OnMove( wxMoveEvent& event );
 
 private:
+    void UpdateStatusBar(const wxPoint& pos, const wxSize& size)
+    {
+        wxString msg;
+        msg.Printf(_("pos=(%d, %d), size=%dx%d"),
+                   pos.x, pos.y, size.x, size.y);
+        SetStatusText(msg, 1);
+    }
+
     wxPanel *m_panel;
 
     DECLARE_EVENT_TABLE()
@@ -1100,6 +1109,8 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_MENU(MINIMAL_ENABLE_ALL, MyFrame::OnEnableAll)
 
     EVT_SIZE(MyFrame::OnSize)
+    EVT_MOVE(MyFrame::OnMove)
+
     EVT_IDLE(MyFrame::OnIdle)
 END_EVENT_TABLE()
 
@@ -1168,11 +1179,16 @@ void MyFrame::OnEnableAll(wxCommandEvent& WXUNUSED(event))
     m_panel->Enable(s_enable);
 }
 
+void MyFrame::OnMove( wxMoveEvent& event )
+{
+    UpdateStatusBar(event.GetPosition(), GetSize());
+
+    event.Skip();
+}
+
 void MyFrame::OnSize( wxSizeEvent& event )
 {
-    wxString msg;
-    msg.Printf( _("%dx%d"), event.GetSize().x, event.GetSize().y);
-    SetStatusText(msg, 1);
+    UpdateStatusBar(GetPosition(), event.GetSize());
 
     event.Skip();
 }