adapting to widgetimpl extensions and iPhone OS 3.0

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2009-07-10 19:19:36 +00:00
parent 2e1517a2e3
commit 9e55f38df7
4 changed files with 23 additions and 5 deletions

View File

@@ -78,7 +78,11 @@ public :
wxInt32 GetValue() const; wxInt32 GetValue() const;
void SetValue( wxInt32 v ); void SetValue( wxInt32 v );
void SetBitmap( const wxBitmap& bitmap );
virtual wxBitmap GetBitmap() const;
virtual void SetBitmap( const wxBitmap& bitmap );
virtual void SetBitmapPosition( wxDirection dir );
void SetupTabs( const wxNotebook &notebook ); void SetupTabs( const wxNotebook &notebook );
void GetBestRect( wxRect *r ) const; void GetBestRect( wxRect *r ) const;
bool IsEnabled() const; bool IsEnabled() const;

View File

@@ -30,10 +30,14 @@ IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl)
wxScreenDCImpl::wxScreenDCImpl( wxDC *owner ) : wxScreenDCImpl::wxScreenDCImpl( wxDC *owner ) :
wxWindowDCImpl( owner ) wxWindowDCImpl( owner )
{ {
#if wxOSX_USE_COCOA_OR_CARBON
CGRect cgbounds ; CGRect cgbounds ;
cgbounds = CGDisplayBounds(CGMainDisplayID()); cgbounds = CGDisplayBounds(CGMainDisplayID());
m_width = (wxCoord)cgbounds.size.width; m_width = (wxCoord)cgbounds.size.width;
m_height = (wxCoord)cgbounds.size.height; m_height = (wxCoord)cgbounds.size.height;
#else
wxDisplaySize( &m_width, &m_height );
#endif
#if wxOSX_USE_COCOA_OR_IPHONE #if wxOSX_USE_COCOA_OR_IPHONE
SetGraphicsContext( wxGraphicsContext::Create() ); SetGraphicsContext( wxGraphicsContext::Create() );
#else #else

View File

@@ -141,7 +141,7 @@ protected :
- (void) keyDown:(NSEvent*) event - (void) keyDown:(NSEvent*) event
{ {
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( [self delegate] ); wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( (WXWidget) [self delegate] );
lastKeyDownEvent = event; lastKeyDownEvent = event;
if ( impl == NULL || !impl->DoHandleKeyEvent(event) ) if ( impl == NULL || !impl->DoHandleKeyEvent(event) )
[super keyDown:event]; [super keyDown:event];
@@ -150,14 +150,14 @@ protected :
- (void) keyUp:(NSEvent*) event - (void) keyUp:(NSEvent*) event
{ {
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( [self delegate] ); wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( (WXWidget) [self delegate] );
if ( impl == NULL || !impl->DoHandleKeyEvent(event) ) if ( impl == NULL || !impl->DoHandleKeyEvent(event) )
[super keyUp:event]; [super keyUp:event];
} }
- (void) flagsChanged:(NSEvent*) event - (void) flagsChanged:(NSEvent*) event
{ {
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( [self delegate] ); wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( (WXWidget) [self delegate] );
if ( impl == NULL || !impl->DoHandleKeyEvent(event) ) if ( impl == NULL || !impl->DoHandleKeyEvent(event) )
[super flagsChanged:event]; [super flagsChanged:event];
} }
@@ -170,7 +170,7 @@ protected :
- (void) insertText:(id) str - (void) insertText:(id) str
{ {
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( [self delegate] ); wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( (WXWidget) [self delegate] );
if ( impl == NULL || lastKeyDownEvent==nil || !impl->DoHandleCharEvent(lastKeyDownEvent, str) ) if ( impl == NULL || lastKeyDownEvent==nil || !impl->DoHandleCharEvent(lastKeyDownEvent, str) )
{ {
[super insertText:str]; [super insertText:str];

View File

@@ -519,6 +519,16 @@ void wxWidgetIPhoneImpl::SetBitmap( const wxBitmap& bitmap )
{ {
} }
wxBitmap wxWidgetIPhoneImpl::GetBitmap() const
{
wxBitmap bmp;
return bmp;
}
void wxWidgetIPhoneImpl::SetBitmapPosition( wxDirection dir )
{
}
void wxWidgetIPhoneImpl::SetupTabs( const wxNotebook &notebook ) void wxWidgetIPhoneImpl::SetupTabs( const wxNotebook &notebook )
{ {
} }