#endif
#if wxUSE_DRAG_AND_DROP
-#include "wx/dnd.h"
+ #include "wx/dnd.h"
#endif
#include "wx/graphics.h"
#if wxOSX_USE_CARBON
-#include "wx/osx/uma.h"
+ #include "wx/osx/uma.h"
#else
-#include "wx/osx/private.h"
+ #include "wx/osx/private.h"
#endif
#define MAC_SCROLLBAR_SIZE 15
#endif
}
-void wxWindowMac::MacPostControlCreate(const wxPoint& WXUNUSED(pos), const wxSize& size)
+void wxWindowMac::MacPostControlCreate(const wxPoint& WXUNUSED(pos),
+ const wxSize& WXUNUSED(size))
{
// todo remove if refactoring works correctly
#if 0
{
// Don't assert, in case we set the window variant before
// the window is created
- // wxASSERT( GetPeer()->Ok() ) ;
+ // wxASSERT( GetPeer()->IsOk() ) ;
m_windowVariant = variant ;
{
if (m_growBox)
{
- if ( m_backgroundColour.Ok() )
+ if ( m_backgroundColour.IsOk() )
m_growBox->SetBackgroundColour(m_backgroundColour);
else
m_growBox->SetBackgroundColour(*wxWHITE);
return false ;
}
- wxASSERT_MSG( m_cursor.Ok(),
+ wxASSERT_MSG( m_cursor.IsOk(),
wxT("cursor must be valid after call to the base version"));
if ( GetPeer() != NULL )
if ( doResize )
{
MacRepositionScrollBars() ;
+ MacOnInternalSize();
wxSize size(actualWidth, actualHeight);
wxSizeEvent event(size, m_windowId);
event.SetEventObject(this);
if (sizeFlags & wxSIZE_FORCE_EVENT)
{
+ MacOnInternalSize();
wxSizeEvent event( wxSize(width,height), GetId() );
event.SetEventObject( this );
HandleWindowEvent( event );
bool wxWindowMac::Show(bool show)
{
+ if ( !show )
+ MacInvalidateBorders();
+
if ( !wxWindowBase::Show(show) )
return false;
if ( GetPeer() )
GetPeer()->SetVisibility( show ) ;
+ if ( show )
+ MacInvalidateBorders();
+
#ifdef __WXOSX_IPHONE__
// only when there's no native event support
if ( !IsTopLevel() )
CGRect cgrect = CGRectMake( rect.right - size , rect.bottom - size , size , size ) ;
CGContextSaveGState( cgContext );
- if ( m_backgroundColour.Ok() )
+ if ( m_backgroundColour.IsOk() )
{
CGContextSetFillColorWithColor( cgContext, m_backgroundColour.GetCGColor() );
}
#else
if (m_growBox)
{
- if ( m_backgroundColour.Ok() )
+ if ( m_backgroundColour.IsOk() )
m_growBox->SetBackgroundColour(m_backgroundColour);
else
m_growBox->SetBackgroundColour(*wxWHITE);
GetPeer()->GetSize( tw, th );
GetPeer()->GetPosition( tx, ty );
- Rect rect = { ty,tx, ty+th, tx+tw };
-
#if wxOSX_USE_COCOA_OR_CARBON
- InsetRect( &rect, -1 , -1 ) ;
-
{
- CGRect cgrect = CGRectMake( rect.left , rect.top , rect.right - rect.left ,
- rect.bottom - rect.top ) ;
+ CGRect cgrect = CGRectMake( tx-1 , ty-1 , tw+2 ,
+ th+2 ) ;
CGContextRef cgContext = (CGContextRef) GetParent()->MacGetCGContextRef() ;
wxASSERT( cgContext ) ;
MacRepositionScrollBars() ;
if ( triggerSizeEvent )
{
+ MacOnInternalSize();
wxSizeEvent event(GetSize(), m_windowId);
event.SetEventObject(this);
HandleWindowEvent(event);
// if the user code caught EVT_SET_CURSOR() and returned nothing from
// it - this is a way to say that our cursor shouldn't be used for this
// point
- if ( !processedEvtSetCursor && m_cursor.Ok() )
+ if ( !processedEvtSetCursor && m_cursor.IsOk() )
cursor = m_cursor ;
if ( !wxIsBusy() && !GetParent() )
cursor = *wxSTANDARD_CURSOR ;
}
- if ( cursor.Ok() )
+ if ( cursor.IsOk() )
cursor.MacInstall() ;
}
- return cursor.Ok() ;
+ return cursor.IsOk() ;
}
wxString wxWindowMac::MacGetToolTipString( wxPoint &WXUNUSED(pt) )
}
m_updateRegion = formerUpdateRgn;
+
+ wxNonOwnedWindow* top = MacGetTopLevelWindow();
+ if (top)
+ top->WindowWasPainted() ;
+
return handled;
}
#if wxUSE_HOTKEY && wxOSX_USE_COCOA_OR_CARBON
-OSStatus wxHotKeyHandler(EventHandlerCallRef nextHandler,EventRef event, void *userData)
+OSStatus
+wxHotKeyHandler(EventHandlerCallRef WXUNUSED(nextHandler),
+ EventRef event,
+ void* WXUNUSED(userData))
{
EventHotKeyID hotKeyId;
GetEventParameter( event, kEventParamDirectObject, typeEventHotKeyID, NULL, sizeof(hotKeyId), NULL, &hotKeyId);
- for ( int i = 0; i < s_hotkeys.size(); ++i )
+ for ( unsigned i = 0; i < s_hotkeys.size(); ++i )
{
- if ( s_hotkeys[i].keyId == hotKeyId.id )
+ if ( s_hotkeys[i].keyId == static_cast<int>(hotKeyId.id) )
{
unsigned char charCode ;
UInt32 keyCode ;
bool wxWindowMac::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
{
- for ( int i = 0; i < s_hotkeys.size(); ++i )
+ for ( unsigned i = 0; i < s_hotkeys.size(); ++i )
{
if ( s_hotkeys[i].keyId == hotkeyId )
{
mac_modifiers |= optionKey;
if ( modifiers & wxMOD_SHIFT )
mac_modifiers |= shiftKey;
- if ( modifiers & wxMOD_CONTROL )
+ if ( modifiers & wxMOD_RAW_CONTROL )
mac_modifiers |= controlKey;
- if ( modifiers & wxMOD_META )
+ if ( modifiers & wxMOD_CONTROL )
mac_modifiers |= cmdKey;
EventHotKeyRef hotKeyRef;
bool wxWindowMac::UnregisterHotKey(int hotkeyId)
{
- for ( int 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 )
{