X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/91722d741287608527eb819f74f9d9693211a710..39d0e65b6224f1307ede8a965eee122e707fd57e:/src/osx/window_osx.cpp diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index def6d915da..f09d216e64 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -484,39 +484,6 @@ void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant ) return; GetPeer()->SetControlSize( variant ); -#if wxOSX_USE_CARBON - ControlSize size ; - - // we will get that from the settings later - // and make this NORMAL later, but first - // we have a few calculations that we must fix - - switch ( variant ) - { - case wxWINDOW_VARIANT_NORMAL : - size = kControlSizeNormal; - break ; - - case wxWINDOW_VARIANT_SMALL : - size = kControlSizeSmall; - break ; - - case wxWINDOW_VARIANT_MINI : - // not always defined in the headers - size = 3 ; - break ; - - case wxWINDOW_VARIANT_LARGE : - size = kControlSizeLarge; - break ; - - default: - wxFAIL_MSG(wxT("unexpected window variant")); - break ; - } - GetPeer()->SetData(kControlEntireControl, kControlSizeTag, &size ) ; -#endif - switch ( variant ) { @@ -655,10 +622,8 @@ void wxWindowMac::SetDropTarget(wxDropTarget *pDropTarget) delete m_dropTarget; m_dropTarget = pDropTarget; - if ( m_dropTarget != NULL ) - { - // TODO: - } + + GetPeer()->SetDropTarget(m_dropTarget) ; } #endif @@ -1065,6 +1030,7 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height) if ( doResize ) { MacRepositionScrollBars() ; + MacOnInternalSize(); wxSize size(actualWidth, actualHeight); wxSizeEvent event(size, m_windowId); event.SetEventObject(this); @@ -1148,6 +1114,7 @@ void wxWindowMac::DoSetSize(int x, int y, int width, int height, int sizeFlags) if (sizeFlags & wxSIZE_FORCE_EVENT) { + MacOnInternalSize(); wxSizeEvent event( wxSize(width,height), GetId() ); event.SetEventObject( this ); HandleWindowEvent( event ); @@ -1261,6 +1228,9 @@ bool wxWindowMac::Show(bool show) if ( GetPeer() ) GetPeer()->SetVisibility( show ) ; + if ( show ) + MacInvalidateBorders(); + #ifdef __WXOSX_IPHONE__ // only when there's no native event support if ( !IsTopLevel() ) @@ -1683,6 +1653,7 @@ void wxWindowMac::DoUpdateScrollbarVisibility() MacRepositionScrollBars() ; if ( triggerSizeEvent ) { + MacOnInternalSize(); wxSizeEvent event(GetSize(), m_windowId); event.SetEventObject(this); HandleWindowEvent(event); @@ -2525,7 +2496,7 @@ Rect wxMacGetBoundsForControl( wxWindowMac* window , const wxPoint& pos , const int x, y, w, h ; window->MacGetBoundsForControl( pos , size , x , y, w, h , adjustForOrigin ) ; - Rect bounds = { y, x, y + h, x + w }; + Rect bounds = { static_cast(y), static_cast(x), static_cast(y + h), static_cast(x + w) }; return bounds ; } @@ -2624,20 +2595,18 @@ wxHotKeyHandler(EventHandlerCallRef WXUNUSED(nextHandler), unsigned char charCode ; UInt32 keyCode ; UInt32 modifiers ; - Point where ; UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ; GetEventParameter( event, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(char), NULL, &charCode ); GetEventParameter( event, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode ); GetEventParameter( event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers ); - GetEventParameter( event, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &where ); UInt32 keymessage = (keyCode << 8) + charCode; wxKeyEvent wxevent(wxEVT_HOTKEY); wxevent.SetId(hotKeyId.id); wxTheApp->MacCreateKeyEvent( wxevent, s_hotkeys[i].window , keymessage , - modifiers , when , where.h , where.v , 0 ) ; + modifiers , when , 0 ) ; s_hotkeys[i].window->HandleWindowEvent(wxevent); } @@ -2707,7 +2676,7 @@ bool wxWindowMac::RegisterHotKey(int hotkeyId, int modifiers, int keycode) bool wxWindowMac::UnregisterHotKey(int hotkeyId) { - for ( unsigned i = s_hotkeys.size()-1; i>=0; -- i ) + for ( int i = ((int)s_hotkeys.size())-1; i>=0; -- i ) { if ( s_hotkeys[i].keyId == hotkeyId ) {