From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Sat, 6 Nov 1999 16:12:44 +0000 (+0000)
Subject: test for wxFrame::GetPosition/GetSize added
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/97206645f18092041cab2154436bd6facc972c9e?hp=01325161d50f20b8c894397a6a70f9d788576343

test for wxFrame::GetPosition/GetSize added


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

diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp
index 8eb3a59945..610d0f8a01 100644
--- a/samples/controls/controls.cpp
+++ b/samples/controls/controls.cpp
@@ -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();
 }