suppress more float/double->int conversion warnings to be able to see anything else in wxOSX/Cocoa build

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61146 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-06-20 21:27:20 +00:00
parent 6398a32d3b
commit e490b0d23b
4 changed files with 38 additions and 38 deletions

View File

@@ -23,18 +23,18 @@ NSRect wxToNSRect( NSView* parent, const wxRect& r )
int y = r.y; int y = r.y;
int x = r.x ; int x = r.x ;
if ( parent == NULL || ![ parent isFlipped ] ) if ( parent == NULL || ![ parent isFlipped ] )
y = frame.size.height - ( r.y + r.height ); y = (int)(frame.size.height - ( r.y + r.height ));
return NSMakeRect(x, y, r.width , r.height); return NSMakeRect(x, y, r.width , r.height);
} }
wxRect wxFromNSRect( NSView* parent, const NSRect& rect ) wxRect wxFromNSRect( NSView* parent, const NSRect& rect )
{ {
NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame]; NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
int y = rect.origin.y; int y = (int)rect.origin.y;
int x = rect.origin.x; int x = (int)rect.origin.x;
if ( parent == NULL || ![ parent isFlipped ] ) if ( parent == NULL || ![ parent isFlipped ] )
y = frame.size.height - (rect.origin.y + rect.size.height); y = (int)(frame.size.height - (rect.origin.y + rect.size.height));
return wxRect( x, y, rect.size.width, rect.size.height ); return wxRect( x, y, (int)rect.size.width, (int)rect.size.height );
} }
NSPoint wxToNSPoint( NSView* parent, const wxPoint& p ) NSPoint wxToNSPoint( NSView* parent, const wxPoint& p )
@@ -43,17 +43,17 @@ NSPoint wxToNSPoint( NSView* parent, const wxPoint& p )
int x = p.x ; int x = p.x ;
int y = p.y; int y = p.y;
if ( parent == NULL || ![ parent isFlipped ] ) if ( parent == NULL || ![ parent isFlipped ] )
y = frame.size.height - ( p.y ); y = (int)(frame.size.height - ( p.y ));
return NSMakePoint(x, y); return NSMakePoint(x, y);
} }
wxPoint wxFromNSPoint( NSView* parent, const NSPoint& p ) wxPoint wxFromNSPoint( NSView* parent, const NSPoint& p )
{ {
NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame]; NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame];
int x = p.x; int x = (int)p.x;
int y = p.y; int y = (int)p.y;
if ( parent == NULL || ![ parent isFlipped ] ) if ( parent == NULL || ![ parent isFlipped ] )
y = frame.size.height - ( p.y ); y = (int)(frame.size.height - ( p.y ));
return wxPoint( x, y); return wxPoint( x, y);
} }
@@ -217,8 +217,8 @@ typedef void (*wxOSX_NoResponderHandlerPtr)(NSView* self, SEL _cmd, SEL selector
{ {
NSRect frame = [win frame]; NSRect frame = [win frame];
wxRect wxframe = wxFromNSRect( NULL, frame ); wxRect wxframe = wxFromNSRect( NULL, frame );
wxframe.SetWidth( proposedFrameSize.width ); wxframe.SetWidth( (int)proposedFrameSize.width );
wxframe.SetHeight( proposedFrameSize.height ); wxframe.SetHeight( (int)proposedFrameSize.height );
wxNSWindow* window = (wxNSWindow*) win; wxNSWindow* window = (wxNSWindow*) win;
wxNonOwnedWindowCocoaImpl* windowimpl = [window implementation]; wxNonOwnedWindowCocoaImpl* windowimpl = [window implementation];
if ( windowimpl ) if ( windowimpl )
@@ -548,8 +548,8 @@ void wxNonOwnedWindowCocoaImpl::GetPosition( int &x, int &y ) const
void wxNonOwnedWindowCocoaImpl::GetSize( int &width, int &height ) const void wxNonOwnedWindowCocoaImpl::GetSize( int &width, int &height ) const
{ {
NSRect rect = [m_macWindow frame]; NSRect rect = [m_macWindow frame];
width = rect.size.width; width = (int)rect.size.width;
height = rect.size.height; height = (int)rect.size.height;
} }
void wxNonOwnedWindowCocoaImpl::GetContentArea( int& left, int &top, int &width, int &height ) const void wxNonOwnedWindowCocoaImpl::GetContentArea( int& left, int &top, int &width, int &height ) const
@@ -557,10 +557,10 @@ void wxNonOwnedWindowCocoaImpl::GetContentArea( int& left, int &top, int &width,
NSRect outer = NSMakeRect(100,100,100,100); NSRect outer = NSMakeRect(100,100,100,100);
NSRect content = [NSWindow contentRectForFrameRect:outer styleMask:[m_macWindow styleMask] ]; NSRect content = [NSWindow contentRectForFrameRect:outer styleMask:[m_macWindow styleMask] ];
NSRect rect = [[m_macWindow contentView] frame]; NSRect rect = [[m_macWindow contentView] frame];
left = rect.origin.x; left = (int)rect.origin.x;
top = rect.origin.y; top = (int)rect.origin.y;
width = rect.size.width; width = (int)rect.size.width;
height = rect.size.height; height = (int)rect.size.height;
} }
bool wxNonOwnedWindowCocoaImpl::SetShape(const wxRegion& WXUNUSED(region)) bool wxNonOwnedWindowCocoaImpl::SetShape(const wxRegion& WXUNUSED(region))

View File

@@ -106,10 +106,10 @@ public:
{ {
wxNSTabView* slf = (wxNSTabView*) m_osxView; wxNSTabView* slf = (wxNSTabView*) m_osxView;
NSRect r = [slf contentRect]; NSRect r = [slf contentRect];
left = r.origin.x; left = (int)r.origin.x;
top = r.origin.y; top = (int)r.origin.y;
width = r.size.width; width = (int)r.size.width;
height = r.size.height; height = (int)r.size.height;
} }
void SetValue( wxInt32 value ) void SetValue( wxInt32 value )

View File

@@ -716,9 +716,9 @@ void wxToolBar::DoGetSize( int *width, int *height ) const
} }
if ( width != NULL ) if ( width != NULL )
*width = windowFrame.size.width; *width = (int)windowFrame.size.width;
if ( height != NULL ) if ( height != NULL )
*height = toolbarHeight; *height = (int)toolbarHeight;
} }
else else
wxToolBarBase::DoGetSize( width, height ); wxToolBarBase::DoGetSize( width, height );

View File

@@ -284,7 +284,7 @@ void SetupKeyEvent( wxKeyEvent &wxevent , NSEvent * nsEvent, NSString* charStrin
wxevent.m_rawCode = [nsEvent keyCode]; wxevent.m_rawCode = [nsEvent keyCode];
wxevent.m_rawFlags = modifiers; wxevent.m_rawFlags = modifiers;
wxevent.SetTimestamp( [nsEvent timestamp] * 1000.0 ) ; wxevent.SetTimestamp( (int)([nsEvent timestamp] * 1000) ) ;
wxString chars; wxString chars;
if ( eventType != NSFlagsChanged ) if ( eventType != NSFlagsChanged )
@@ -373,7 +373,7 @@ void SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEvent )
wxevent.m_controlDown = modifiers & NSControlKeyMask; wxevent.m_controlDown = modifiers & NSControlKeyMask;
wxevent.m_altDown = modifiers & NSAlternateKeyMask; wxevent.m_altDown = modifiers & NSAlternateKeyMask;
wxevent.m_metaDown = modifiers & NSCommandKeyMask; wxevent.m_metaDown = modifiers & NSCommandKeyMask;
wxevent.SetTimestamp( [nsEvent timestamp] * 1000.0 ) ; wxevent.SetTimestamp( (int)([nsEvent timestamp] * 1000) ) ;
UInt32 mouseChord = 0; UInt32 mouseChord = 0;
@@ -497,11 +497,11 @@ void SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEvent )
if ( fabs([nsEvent deltaX]) > fabs([nsEvent deltaY]) ) if ( fabs([nsEvent deltaX]) > fabs([nsEvent deltaY]) )
{ {
wxevent.m_wheelAxis = 1; wxevent.m_wheelAxis = 1;
wxevent.m_wheelRotation = [nsEvent deltaX] * 10.0; wxevent.m_wheelRotation = (int)([nsEvent deltaX] * 10);
} }
else else
{ {
wxevent.m_wheelRotation = [nsEvent deltaY] * 10.0; wxevent.m_wheelRotation = (int)([nsEvent deltaY] * 10);
} }
} }
break ; break ;
@@ -1230,8 +1230,8 @@ void wxWidgetCocoaImpl::GetPosition( int &x, int &y ) const
void wxWidgetCocoaImpl::GetSize( int &width, int &height ) const void wxWidgetCocoaImpl::GetSize( int &width, int &height ) const
{ {
NSRect rect = [m_osxView frame]; NSRect rect = [m_osxView frame];
width = rect.size.width; width = (int)rect.size.width;
height = rect.size.height; height = (int)rect.size.height;
} }
void wxWidgetCocoaImpl::GetContentArea( int&left, int &top, int &width, int &height ) const void wxWidgetCocoaImpl::GetContentArea( int&left, int &top, int &width, int &height ) const
@@ -1243,14 +1243,14 @@ void wxWidgetCocoaImpl::GetContentArea( int&left, int &top, int &width, int &hei
NSRect bounds = [m_osxView bounds]; NSRect bounds = [m_osxView bounds];
NSRect rect = [cv frame]; NSRect rect = [cv frame];
int y = rect.origin.y; int y = (int)rect.origin.y;
int x = rect.origin.x; int x = (int)rect.origin.x;
if ( ![ m_osxView isFlipped ] ) if ( ![ m_osxView isFlipped ] )
y = bounds.size.height - (rect.origin.y + rect.size.height); y = (int)(bounds.size.height - (rect.origin.y + rect.size.height));
left = x; left = x;
top = y; top = y;
width = rect.size.width; width = (int)rect.size.width;
height = rect.size.height; height = (int)rect.size.height;
} }
else else
{ {
@@ -1373,7 +1373,7 @@ wxInt32 wxWidgetCocoaImpl::GetMinimum() const
{ {
if ( [m_osxView respondsToSelector:@selector(getMinValue:)] ) if ( [m_osxView respondsToSelector:@selector(getMinValue:)] )
{ {
return [m_osxView minValue]; return (int)[m_osxView minValue];
} }
return 0; return 0;
} }
@@ -1382,7 +1382,7 @@ wxInt32 wxWidgetCocoaImpl::GetMaximum() const
{ {
if ( [m_osxView respondsToSelector:@selector(getMaxValue:)] ) if ( [m_osxView respondsToSelector:@selector(getMaxValue:)] )
{ {
return [m_osxView maxValue]; return (int)[m_osxView maxValue];
} }
return 0; return 0;
} }
@@ -1410,8 +1410,8 @@ void wxWidgetCocoaImpl::GetBestRect( wxRect *r ) const
[m_osxView sizeToFit]; [m_osxView sizeToFit];
NSRect best = [m_osxView frame]; NSRect best = [m_osxView frame];
[m_osxView setFrame:former]; [m_osxView setFrame:former];
r->width = best.size.width; r->width = (int)best.size.width;
r->height = best.size.height; r->height = (int)best.size.height;
} }
} }