test for wxFrame::GetPosition/GetSize added

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-11-06 16:12:44 +00:00
parent 01325161d5
commit 97206645f1

View File

@@ -161,8 +161,17 @@ public:
void OnIdle( wxIdleEvent& event ); void OnIdle( wxIdleEvent& event );
void OnSize( wxSizeEvent& event ); void OnSize( wxSizeEvent& event );
void OnMove( wxMoveEvent& event );
private: 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; wxPanel *m_panel;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
@@ -1100,6 +1109,8 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(MINIMAL_ENABLE_ALL, MyFrame::OnEnableAll) EVT_MENU(MINIMAL_ENABLE_ALL, MyFrame::OnEnableAll)
EVT_SIZE(MyFrame::OnSize) EVT_SIZE(MyFrame::OnSize)
EVT_MOVE(MyFrame::OnMove)
EVT_IDLE(MyFrame::OnIdle) EVT_IDLE(MyFrame::OnIdle)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -1168,11 +1179,16 @@ void MyFrame::OnEnableAll(wxCommandEvent& WXUNUSED(event))
m_panel->Enable(s_enable); m_panel->Enable(s_enable);
} }
void MyFrame::OnMove( wxMoveEvent& event )
{
UpdateStatusBar(event.GetPosition(), GetSize());
event.Skip();
}
void MyFrame::OnSize( wxSizeEvent& event ) void MyFrame::OnSize( wxSizeEvent& event )
{ {
wxString msg; UpdateStatusBar(GetPosition(), event.GetSize());
msg.Printf( _("%dx%d"), event.GetSize().x, event.GetSize().y);
SetStatusText(msg, 1);
event.Skip(); event.Skip();
} }