]> git.saurik.com Git - wxWidgets.git/commitdiff
refactoring SizeEvent sending
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 3 Jun 2013 13:01:50 +0000 (13:01 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 3 Jun 2013 13:01:50 +0000 (13:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74097 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/toolbar.mm
src/osx/cocoa/window.mm
src/osx/nonownedwnd_osx.cpp
src/osx/toplevel_osx.cpp

index 1a989ddd6c38a190d168fbb8d866552e8f8d0c62..ed713512c8bc25a58e1ce1769e4f2cfa2e576979 100644 (file)
@@ -1244,9 +1244,6 @@ bool wxToolBar::Realize()
     SetInitialSize( wxSize(m_minWidth, m_minHeight));
 
     SendSizeEventToParent();
-    wxWindow * const parent = GetParent();
-    if ( parent && !parent->IsBeingDeleted() )
-        parent->MacOnInternalSize();
     
     return true;
 }
index c46dcd273f3d4065242d64308403381b407419a1..acd1ced6382ca7064cddbf9a0624847eb7a29922 100644 (file)
@@ -1745,7 +1745,6 @@ void wxWidgetCocoaImpl::SetVisibility( bool visible )
     wxUnusedVar(progress);
 
     m_win->SendSizeEvent();
-    m_win->MacOnInternalSize();
 }
 
 - (void)animationDidEnd:(NSAnimation*)animation
@@ -1922,7 +1921,6 @@ wxWidgetCocoaImpl::ShowViewOrWindowWithEffect(wxWindow *win,
         // refresh it once again after the end to ensure that everything is in
         // place
         win->SendSizeEvent();
-        win->MacOnInternalSize();
     }
 
     [anim setDelegate:nil];
index 10daf9d052677b4d4cd3befa3c45b6c267721a82..edcba5d9ce707e6f0cf838324b99f2177e7be9f7 100644 (file)
@@ -249,10 +249,7 @@ bool wxNonOwnedWindow::OSXShowWithEffect(bool show,
     {
         // as apps expect a size event to occur when the window is shown,
         // generate one when it is shown with effect too
-        MacOnInternalSize();
-        wxSizeEvent event(GetSize(), m_windowId);
-        event.SetEventObject(this);
-        HandleWindowEvent(event);
+        SendSizeEvent();
     }
 
     return true;
@@ -312,11 +309,7 @@ void wxNonOwnedWindow::HandleActivated( double timestampsec, bool didActivate )
 
 void wxNonOwnedWindow::HandleResized( double timestampsec )
 {
-    MacOnInternalSize();
-    wxSizeEvent wxevent( GetSize() , GetId());
-    wxevent.SetTimestamp( (int) (timestampsec * 1000) );
-    wxevent.SetEventObject( this );
-    HandleWindowEvent(wxevent);
+    SendSizeEvent();
     // we have to inform some controls that have to reset things
     // relative to the toplevel window (e.g. OpenGL buffers)
     wxWindowMac::MacSuperChangedPosition() ; // like this only children will be notified
@@ -387,10 +380,7 @@ bool wxNonOwnedWindow::Show(bool show)
     if ( show )
     {
         // because apps expect a size event to occur at this moment
-        MacOnInternalSize();
-        wxSizeEvent event(GetSize() , m_windowId);
-        event.SetEventObject(this);
-        HandleWindowEvent(event);
+        SendSizeEvent();
     }
 
     return true ;
index f92665932ea44b03ed34c598bf93195349accfc8..be18e7bc1a8ccebe7e378d408bc5dae91d9aa791 100644 (file)
@@ -187,7 +187,8 @@ void wxTopLevelWindowMac::ShowWithoutActivating()
 
     m_nowpeer->ShowWithoutActivating();
 
-    // TODO: Should we call EVT_SIZE here?
+    // because apps expect a size event to occur at this moment
+    SendSizeEvent();
 }
 
 bool wxTopLevelWindowMac::ShowFullScreen(bool show, long style)