]> git.saurik.com Git - wxWidgets.git/commitdiff
refresh the window when the size changed
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 9 Dec 2001 00:45:22 +0000 (00:45 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 9 Dec 2001 00:45:22 +0000 (00:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/dnd/dnd.cpp

index 5eaf9b4f39955b8d054f63f9b0cda792dd2bfdf4..ea4bb3ece5be5eb2ce9f5cb7ee1b0185a0a31e58 100644 (file)
@@ -224,6 +224,7 @@ public:
     ~DnDFrame();
 
     void OnPaint(wxPaintEvent& event);
+    void OnSize(wxSizeEvent& event);
     void OnQuit (wxCommandEvent& event);
     void OnAbout(wxCommandEvent& event);
     void OnDrag (wxCommandEvent& event);
@@ -816,6 +817,7 @@ BEGIN_EVENT_TABLE(DnDFrame, wxFrame)
     EVT_LEFT_DOWN(            DnDFrame::OnLeftDown)
     EVT_RIGHT_DOWN(           DnDFrame::OnRightDown)
     EVT_PAINT(                DnDFrame::OnPaint)
+    EVT_SIZE(                 DnDFrame::OnSize)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(DnDShapeFrame, wxFrame)
@@ -1009,6 +1011,13 @@ void DnDFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
     Close(TRUE);
 }
 
+void DnDFrame::OnSize(wxSizeEvent& event)
+{
+    Refresh();
+
+    event.Skip();
+}
+
 void DnDFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
     int w = 0;
@@ -1016,6 +1025,7 @@ void DnDFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
     GetClientSize( &w, &h );
 
     wxPaintDC dc(this);
+    dc.Clear();
     dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL, FALSE, "charter" ) );
     dc.DrawText( "Drag text from here!", 100, h-50 );
 }