]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/window_osx.cpp
Get wxSearchCtrl text events working, and share the text event handler code among...
[wxWidgets.git] / src / osx / window_osx.cpp
index 3d355fde51783d2863fb7fc162ec5e8e410ec07b..041c9d952e9bd77f99d817e4aa1501746f859d6c 100644 (file)
@@ -897,22 +897,20 @@ wxSize wxWindowMac::DoGetBestSize() const
             r.width =
             r.height = 16 ;
 
-            if ( 0 )
-            {
-            }
 #if wxUSE_SCROLLBAR
-            else if ( IsKindOf( CLASSINFO( wxScrollBar ) ) )
+            if ( IsKindOf( CLASSINFO( wxScrollBar ) ) )
             {
                 r.height = 16 ;
             }
+            else
 #endif
 #if wxUSE_SPINBTN
-            else if ( IsKindOf( CLASSINFO( wxSpinButton ) ) )
+            if ( IsKindOf( CLASSINFO( wxSpinButton ) ) )
             {
                 r.height = 24 ;
             }
-#endif
             else
+#endif
             {
                 // return wxWindowBase::DoGetBestSize() ;
             }
@@ -1060,6 +1058,22 @@ bool wxWindowMac::Show(bool show)
     if ( m_peer )
         m_peer->SetVisibility( show ) ;
 
+    wxShowEvent eventShow(GetId(), show);
+    eventShow.SetEventObject(this);
+    
+    HandleWindowEvent(eventShow);
+    
+    return true;
+}
+
+bool wxWindowMac::OSXShowWithEffect(bool show,
+                                    wxShowEffect effect,
+                                    unsigned timeout)
+{
+    if ( effect == wxSHOW_EFFECT_NONE ||
+            !m_peer || !m_peer->ShowWithEffect(show, effect, timeout) )
+        return Show(show);
+
     return true;
 }
 
@@ -1195,6 +1209,7 @@ wxWindow *wxGetActiveWindow()
 // Coordinates relative to the window
 void wxWindowMac::WarpPointer(int x_pos, int y_pos)
 {
+#if wxOSX_USE_COCOA_OR_CARBON
     int x = x_pos;
     int y = y_pos;
     DoClientToScreen(&x, &y);
@@ -1209,14 +1224,15 @@ void wxWindowMac::WarpPointer(int x_pos, int y_pos)
 
     event.m_altDown = mState.AltDown();
     event.m_controlDown = mState.ControlDown();
-    event.m_leftDown = mState.LeftDown();
-    event.m_middleDown = mState.MiddleDown();
-    event.m_rightDown = mState.RightDown();
+    event.m_leftDown = mState.LeftIsDown();
+    event.m_middleDown = mState.MiddleIsDown();
+    event.m_rightDown = mState.RightIsDown();
     event.m_metaDown = mState.MetaDown();
     event.m_shiftDown = mState.ShiftDown();
     event.SetId(GetId());
     event.SetEventObject(this);
     GetEventHandler()->ProcessEvent(event);
+#endif
 }
 
 int wxWindowMac::GetScrollPos(int orient) const
@@ -1829,6 +1845,7 @@ bool wxWindowMac::MacDoRedraw( long time )
     {
         case wxBG_STYLE_ERASE:
         case wxBG_STYLE_SYSTEM:
+        case wxBG_STYLE_COLOUR:
             {
                 // for the toplevel window this really is the entire area for
                 // all the others only their client area, otherwise they might
@@ -1857,6 +1874,7 @@ bool wxWindowMac::MacDoRedraw( long time )
             break;
 
         case wxBG_STYLE_PAINT:
+        case wxBG_STYLE_TRANSPARENT:
             // nothing to do, user-defined EVT_PAINT handler will overwrite the
             // entire window client area
             break;