Remove hard TABs and trailing spaces
no real changes
This commit is contained in:
@@ -153,7 +153,7 @@ bool wxGTKCairoDCImpl::DoStretchBlit(int xdest, int ydest, int dstWidth, int dst
|
|||||||
// surface and use this copy in the drawing operations.
|
// surface and use this copy in the drawing operations.
|
||||||
if ( cr == cr_src )
|
if ( cr == cr_src )
|
||||||
{
|
{
|
||||||
// Check if destination and source regions overlap.
|
// Check if destination and source regions overlap.
|
||||||
// If necessary, copy source surface to the temporary one.
|
// If necessary, copy source surface to the temporary one.
|
||||||
if (wxRect(xdest, ydest, dstWidth, dstHeight)
|
if (wxRect(xdest, ydest, dstWidth, dstHeight)
|
||||||
.Intersects(wxRect(xsrc, ysrc, srcWidth, srcHeight)))
|
.Intersects(wxRect(xsrc, ysrc, srcWidth, srcHeight)))
|
||||||
@@ -221,7 +221,7 @@ bool wxGTKCairoDCImpl::DoStretchBlit(int xdest, int ydest, int dstWidth, int dst
|
|||||||
cairo_restore(cr);
|
cairo_restore(cr);
|
||||||
if ( surfaceTmp )
|
if ( surfaceTmp )
|
||||||
{
|
{
|
||||||
cairo_surface_destroy(surfaceTmp);
|
cairo_surface_destroy(surfaceTmp);
|
||||||
}
|
}
|
||||||
m_logicalFunction = rop_save;
|
m_logicalFunction = rop_save;
|
||||||
return true;
|
return true;
|
||||||
|
@@ -510,10 +510,10 @@ void wxStaticBox::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
::GetClientRect(GetHwnd(), &rc);
|
::GetClientRect(GetHwnd(), &rc);
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
|
|
||||||
// No need to do anything if the client rectangle is empty and, worse,
|
// No need to do anything if the client rectangle is empty and, worse,
|
||||||
// doing it would result in an assert when creating the bitmap below.
|
// doing it would result in an assert when creating the bitmap below.
|
||||||
if ( !rc.right || !rc.bottom )
|
if ( !rc.right || !rc.bottom )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// draw the entire box in a memory DC
|
// draw the entire box in a memory DC
|
||||||
wxMemoryDC memdc(&dc);
|
wxMemoryDC memdc(&dc);
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
inline bool wxHasCGContext(wxWindow* WXUNUSED(win), wxDC& dc)
|
inline bool wxHasCGContext(wxWindow* WXUNUSED(win), wxDC& dc)
|
||||||
{
|
{
|
||||||
wxGCDCImpl* gcdc = wxDynamicCast( dc.GetImpl() , wxGCDCImpl);
|
wxGCDCImpl* gcdc = wxDynamicCast( dc.GetImpl() , wxGCDCImpl);
|
||||||
|
|
||||||
if ( gcdc )
|
if ( gcdc )
|
||||||
{
|
{
|
||||||
if ( gcdc->GetGraphicsContext()->GetNativeContext() )
|
if ( gcdc->GetGraphicsContext()->GetNativeContext() )
|
||||||
@@ -218,7 +218,7 @@ int wxRendererMac::DrawHeaderButton( wxWindow *win,
|
|||||||
{
|
{
|
||||||
drawInfo.value = kThemeButtonOn;
|
drawInfo.value = kThemeButtonOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
HIThemeDrawButton( &headerRect, &drawInfo, cgContext, kHIThemeOrientationNormal, &labelRect );
|
HIThemeDrawButton( &headerRect, &drawInfo, cgContext, kHIThemeOrientationNormal, &labelRect );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -730,22 +730,22 @@ void wxRendererMac::DrawTitleBarBitmap(wxWindow *win,
|
|||||||
drawCircle = false;
|
drawCircle = false;
|
||||||
glyphColor = wxColour(145, 147, 149);
|
glyphColor = wxColour(145, 147, 149);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( drawCircle )
|
if ( drawCircle )
|
||||||
{
|
{
|
||||||
wxRect circleRect(rect);
|
wxRect circleRect(rect);
|
||||||
circleRect.Deflate(2);
|
circleRect.Deflate(2);
|
||||||
|
|
||||||
dc.DrawEllipse(circleRect);
|
dc.DrawEllipse(circleRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
dc.SetPen(wxPen(glyphColor, 1));
|
dc.SetPen(wxPen(glyphColor, 1));
|
||||||
|
|
||||||
wxRect centerRect(rect);
|
wxRect centerRect(rect);
|
||||||
centerRect.Deflate(5);
|
centerRect.Deflate(5);
|
||||||
centerRect.height++;
|
centerRect.height++;
|
||||||
centerRect.width++;
|
centerRect.width++;
|
||||||
|
|
||||||
dc.DrawLine(centerRect.GetTopLeft(), centerRect.GetBottomRight());
|
dc.DrawLine(centerRect.GetTopLeft(), centerRect.GetBottomRight());
|
||||||
dc.DrawLine(centerRect.GetTopRight(), centerRect.GetBottomLeft());
|
dc.DrawLine(centerRect.GetTopRight(), centerRect.GetBottomLeft());
|
||||||
}
|
}
|
||||||
|
@@ -145,7 +145,7 @@ public :
|
|||||||
|
|
||||||
virtual void controlDoubleAction(WXWidget slf, void* _cmd, void *sender) wxOVERRIDE;
|
virtual void controlDoubleAction(WXWidget slf, void* _cmd, void *sender) wxOVERRIDE;
|
||||||
|
|
||||||
|
|
||||||
protected :
|
protected :
|
||||||
wxNSTableView* m_tableView ;
|
wxNSTableView* m_tableView ;
|
||||||
|
|
||||||
@@ -293,9 +293,9 @@ protected:
|
|||||||
- (void) tableViewSelectionDidChange: (NSNotification *) notification
|
- (void) tableViewSelectionDidChange: (NSNotification *) notification
|
||||||
{
|
{
|
||||||
wxUnusedVar(notification);
|
wxUnusedVar(notification);
|
||||||
|
|
||||||
int row = [self selectedRow];
|
int row = [self selectedRow];
|
||||||
|
|
||||||
if (row == -1)
|
if (row == -1)
|
||||||
{
|
{
|
||||||
// no row selected
|
// no row selected
|
||||||
@@ -305,14 +305,14 @@ protected:
|
|||||||
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
|
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
|
||||||
wxListBox *list = static_cast<wxListBox*> ( impl->GetWXPeer());
|
wxListBox *list = static_cast<wxListBox*> ( impl->GetWXPeer());
|
||||||
wxCHECK_RET( list != NULL , wxT("Listbox expected"));
|
wxCHECK_RET( list != NULL , wxT("Listbox expected"));
|
||||||
|
|
||||||
if ((row < 0) || (row > (int) list->GetCount())) // OS X can select an item below the last item
|
if ((row < 0) || (row > (int) list->GetCount())) // OS X can select an item below the last item
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( !list->MacGetBlockEvents() )
|
if ( !list->MacGetBlockEvents() )
|
||||||
list->HandleLineEvent( row, false );
|
list->HandleLineEvent( row, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setFont:(NSFont *)aFont
|
- (void)setFont:(NSFont *)aFont
|
||||||
@@ -388,11 +388,11 @@ wxListWidgetColumn* wxListWidgetCocoaImpl::InsertTextColumn( unsigned pos, const
|
|||||||
[col1 setWidth:1000];
|
[col1 setWidth:1000];
|
||||||
}
|
}
|
||||||
[col1 setResizingMask: NSTableColumnAutoresizingMask];
|
[col1 setResizingMask: NSTableColumnAutoresizingMask];
|
||||||
|
|
||||||
wxListBox *list = static_cast<wxListBox*> ( GetWXPeer());
|
wxListBox *list = static_cast<wxListBox*> ( GetWXPeer());
|
||||||
if ( list != NULL )
|
if ( list != NULL )
|
||||||
[[col1 dataCell] setFont:list->GetFont().OSXGetNSFont()];
|
[[col1 dataCell] setFont:list->GetFont().OSXGetNSFont()];
|
||||||
|
|
||||||
wxCocoaTableColumn* wxcol = new wxCocoaTableColumn( col1, editable );
|
wxCocoaTableColumn* wxcol = new wxCocoaTableColumn( col1, editable );
|
||||||
[col1 setColumn:wxcol];
|
[col1 setColumn:wxcol];
|
||||||
|
|
||||||
@@ -412,30 +412,30 @@ wxListWidgetColumn* wxListWidgetCocoaImpl::InsertCheckColumn( unsigned pos , con
|
|||||||
[checkbox setTitle:@""];
|
[checkbox setTitle:@""];
|
||||||
[checkbox setButtonType:NSSwitchButton];
|
[checkbox setButtonType:NSSwitchButton];
|
||||||
[col1 setDataCell:checkbox] ;
|
[col1 setDataCell:checkbox] ;
|
||||||
|
|
||||||
wxListBox *list = static_cast<wxListBox*> ( GetWXPeer());
|
wxListBox *list = static_cast<wxListBox*> ( GetWXPeer());
|
||||||
if ( list != NULL )
|
if ( list != NULL )
|
||||||
{
|
{
|
||||||
NSControlSize size = NSRegularControlSize;
|
NSControlSize size = NSRegularControlSize;
|
||||||
|
|
||||||
switch ( list->GetWindowVariant() )
|
switch ( list->GetWindowVariant() )
|
||||||
{
|
{
|
||||||
case wxWINDOW_VARIANT_NORMAL :
|
case wxWINDOW_VARIANT_NORMAL :
|
||||||
size = NSRegularControlSize;
|
size = NSRegularControlSize;
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
case wxWINDOW_VARIANT_SMALL :
|
case wxWINDOW_VARIANT_SMALL :
|
||||||
size = NSSmallControlSize;
|
size = NSSmallControlSize;
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
case wxWINDOW_VARIANT_MINI :
|
case wxWINDOW_VARIANT_MINI :
|
||||||
size = NSMiniControlSize;
|
size = NSMiniControlSize;
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
case wxWINDOW_VARIANT_LARGE :
|
case wxWINDOW_VARIANT_LARGE :
|
||||||
size = NSRegularControlSize;
|
size = NSRegularControlSize;
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break ;
|
break ;
|
||||||
}
|
}
|
||||||
@@ -502,7 +502,7 @@ void wxListWidgetCocoaImpl::ListSetSelection( unsigned int n, bool select, bool
|
|||||||
// TODO
|
// TODO
|
||||||
if ( select )
|
if ( select )
|
||||||
[m_tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:n]
|
[m_tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:n]
|
||||||
byExtendingSelection:multi];
|
byExtendingSelection:multi];
|
||||||
else
|
else
|
||||||
[m_tableView deselectRow: n];
|
[m_tableView deselectRow: n];
|
||||||
|
|
||||||
|
@@ -60,7 +60,7 @@ static void *AVSPPlayerItemStatusContext = &AVSPPlayerItemStatusContext;
|
|||||||
static void *AVSPPlayerRateContext = &AVSPPlayerRateContext;
|
static void *AVSPPlayerRateContext = &AVSPPlayerRateContext;
|
||||||
|
|
||||||
@interface wxAVPlayer : AVPlayer {
|
@interface wxAVPlayer : AVPlayer {
|
||||||
|
|
||||||
AVPlayerLayer *playerLayer;
|
AVPlayerLayer *playerLayer;
|
||||||
|
|
||||||
wxAVMediaBackend* m_backend;
|
wxAVMediaBackend* m_backend;
|
||||||
@@ -75,10 +75,10 @@ static void *AVSPPlayerRateContext = &AVSPPlayerRateContext;
|
|||||||
class WXDLLIMPEXP_MEDIA wxAVMediaBackend : public wxMediaBackendCommonBase
|
class WXDLLIMPEXP_MEDIA wxAVMediaBackend : public wxMediaBackendCommonBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
wxAVMediaBackend();
|
wxAVMediaBackend();
|
||||||
~wxAVMediaBackend();
|
~wxAVMediaBackend();
|
||||||
|
|
||||||
virtual bool CreateControl(wxControl* ctrl, wxWindow* parent,
|
virtual bool CreateControl(wxControl* ctrl, wxWindow* parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
@@ -86,41 +86,41 @@ public:
|
|||||||
long style,
|
long style,
|
||||||
const wxValidator& validator,
|
const wxValidator& validator,
|
||||||
const wxString& name) wxOVERRIDE;
|
const wxString& name) wxOVERRIDE;
|
||||||
|
|
||||||
virtual bool Play() wxOVERRIDE;
|
virtual bool Play() wxOVERRIDE;
|
||||||
virtual bool Pause() wxOVERRIDE;
|
virtual bool Pause() wxOVERRIDE;
|
||||||
virtual bool Stop() wxOVERRIDE;
|
virtual bool Stop() wxOVERRIDE;
|
||||||
|
|
||||||
virtual bool Load(const wxString& fileName) wxOVERRIDE;
|
virtual bool Load(const wxString& fileName) wxOVERRIDE;
|
||||||
virtual bool Load(const wxURI& location) wxOVERRIDE;
|
virtual bool Load(const wxURI& location) wxOVERRIDE;
|
||||||
|
|
||||||
virtual wxMediaState GetState() wxOVERRIDE;
|
virtual wxMediaState GetState() wxOVERRIDE;
|
||||||
|
|
||||||
virtual bool SetPosition(wxLongLong where) wxOVERRIDE;
|
virtual bool SetPosition(wxLongLong where) wxOVERRIDE;
|
||||||
virtual wxLongLong GetPosition() wxOVERRIDE;
|
virtual wxLongLong GetPosition() wxOVERRIDE;
|
||||||
virtual wxLongLong GetDuration() wxOVERRIDE;
|
virtual wxLongLong GetDuration() wxOVERRIDE;
|
||||||
|
|
||||||
virtual void Move(int x, int y, int w, int h) wxOVERRIDE;
|
virtual void Move(int x, int y, int w, int h) wxOVERRIDE;
|
||||||
wxSize GetVideoSize() const wxOVERRIDE;
|
wxSize GetVideoSize() const wxOVERRIDE;
|
||||||
|
|
||||||
virtual double GetPlaybackRate() wxOVERRIDE;
|
virtual double GetPlaybackRate() wxOVERRIDE;
|
||||||
virtual bool SetPlaybackRate(double dRate) wxOVERRIDE;
|
virtual bool SetPlaybackRate(double dRate) wxOVERRIDE;
|
||||||
|
|
||||||
virtual double GetVolume() wxOVERRIDE;
|
virtual double GetVolume() wxOVERRIDE;
|
||||||
virtual bool SetVolume(double dVolume) wxOVERRIDE;
|
virtual bool SetVolume(double dVolume) wxOVERRIDE;
|
||||||
|
|
||||||
void Cleanup();
|
void Cleanup();
|
||||||
void FinishLoad();
|
void FinishLoad();
|
||||||
|
|
||||||
virtual bool ShowPlayerControls(wxMediaCtrlPlayerControls flags) wxOVERRIDE;
|
virtual bool ShowPlayerControls(wxMediaCtrlPlayerControls flags) wxOVERRIDE;
|
||||||
private:
|
private:
|
||||||
void DoShowPlayerControls(wxMediaCtrlPlayerControls flags);
|
void DoShowPlayerControls(wxMediaCtrlPlayerControls flags);
|
||||||
|
|
||||||
wxSize m_bestSize; //Original movie size
|
wxSize m_bestSize; //Original movie size
|
||||||
wxAVPlayer* m_player; //AVPlayer handle/instance
|
wxAVPlayer* m_player; //AVPlayer handle/instance
|
||||||
|
|
||||||
wxMediaCtrlPlayerControls m_interfaceflags; // Saved interface flags
|
wxMediaCtrlPlayerControls m_interfaceflags; // Saved interface flags
|
||||||
|
|
||||||
wxDECLARE_DYNAMIC_CLASS(wxAVMediaBackend);
|
wxDECLARE_DYNAMIC_CLASS(wxAVMediaBackend);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -146,19 +146,19 @@ private:
|
|||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
[playerLayer release];
|
[playerLayer release];
|
||||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
|
|
||||||
[self removeObserver:self forKeyPath:@"rate" context:AVSPPlayerRateContext];
|
[self removeObserver:self forKeyPath:@"rate" context:AVSPPlayerRateContext];
|
||||||
[self removeObserver:self forKeyPath:@"currentItem.status" context:AVSPPlayerItemStatusContext];
|
[self removeObserver:self forKeyPath:@"currentItem.status" context:AVSPPlayerItemStatusContext];
|
||||||
|
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||||
{
|
{
|
||||||
if (context == AVSPPlayerItemStatusContext)
|
if (context == AVSPPlayerItemStatusContext)
|
||||||
{
|
{
|
||||||
id val = [change objectForKey:NSKeyValueChangeNewKey];
|
id val = [change objectForKey:NSKeyValueChangeNewKey];
|
||||||
if ( val != [NSNull null ] )
|
if ( val != [NSNull null ] )
|
||||||
{
|
{
|
||||||
@@ -180,10 +180,10 @@ private:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (context == AVSPPlayerRateContext)
|
else if (context == AVSPPlayerRateContext)
|
||||||
{
|
{
|
||||||
NSNumber* newRate = [change objectForKey:NSKeyValueChangeNewKey];
|
NSNumber* newRate = [change objectForKey:NSKeyValueChangeNewKey];
|
||||||
if ([newRate intValue] == 0)
|
if ([newRate intValue] == 0)
|
||||||
{
|
{
|
||||||
m_backend->QueuePauseEvent();
|
m_backend->QueuePauseEvent();
|
||||||
@@ -192,11 +192,11 @@ private:
|
|||||||
{
|
{
|
||||||
m_backend->QueuePlayEvent();
|
m_backend->QueuePlayEvent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-(wxAVMediaBackend*) backend
|
-(wxAVMediaBackend*) backend
|
||||||
@@ -220,12 +220,12 @@ private:
|
|||||||
|
|
||||||
-(BOOL)isPlaying
|
-(BOOL)isPlaying
|
||||||
{
|
{
|
||||||
if ([self rate] == 0)
|
if ([self rate] == 0)
|
||||||
{
|
{
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -252,7 +252,7 @@ private:
|
|||||||
|
|
||||||
+ (Class)layerClass
|
+ (Class)layerClass
|
||||||
{
|
{
|
||||||
return [AVPlayerLayer class];
|
return [AVPlayerLayer class];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithFrame:(CGRect)rect player:(wxAVPlayer*) player
|
- (id) initWithFrame:(CGRect)rect player:(wxAVPlayer*) player
|
||||||
@@ -342,7 +342,7 @@ private:
|
|||||||
[playerlayer setAutoresizingMask:kCALayerWidthSizable | kCALayerHeightSizable];
|
[playerlayer setAutoresizingMask:kCALayerWidthSizable | kCALayerHeightSizable];
|
||||||
[[self layer] addSublayer:playerlayer];
|
[[self layer] addSublayer:playerlayer];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -377,9 +377,9 @@ bool wxAVMediaBackend::CreateControl(wxControl* inctrl, wxWindow* parent,
|
|||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
wxMediaCtrl* mediactrl = (wxMediaCtrl*) inctrl;
|
wxMediaCtrl* mediactrl = (wxMediaCtrl*) inctrl;
|
||||||
|
|
||||||
mediactrl->DontCreatePeer();
|
mediactrl->DontCreatePeer();
|
||||||
|
|
||||||
if ( !mediactrl->wxControl::Create(
|
if ( !mediactrl->wxControl::Create(
|
||||||
parent, wid, pos, size,
|
parent, wid, pos, size,
|
||||||
wxWindow::MacRemoveBordersFromStyle(style),
|
wxWindow::MacRemoveBordersFromStyle(style),
|
||||||
@@ -392,7 +392,7 @@ bool wxAVMediaBackend::CreateControl(wxControl* inctrl, wxWindow* parent,
|
|||||||
[m_player setBackend:this];
|
[m_player setBackend:this];
|
||||||
|
|
||||||
WXRect r = wxOSXGetFrameForControl( mediactrl, pos , size ) ;
|
WXRect r = wxOSXGetFrameForControl( mediactrl, pos , size ) ;
|
||||||
|
|
||||||
WXWidget view = NULL;
|
WXWidget view = NULL;
|
||||||
#if wxOSX_USE_AVKIT
|
#if wxOSX_USE_AVKIT
|
||||||
if ( NSClassFromString(@"AVPlayerView") )
|
if ( NSClassFromString(@"AVPlayerView") )
|
||||||
@@ -401,12 +401,12 @@ bool wxAVMediaBackend::CreateControl(wxControl* inctrl, wxWindow* parent,
|
|||||||
[(wxAVPlayerView*) view setControlsStyle:AVPlayerViewControlsStyleNone];
|
[(wxAVPlayerView*) view setControlsStyle:AVPlayerViewControlsStyleNone];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( view == NULL )
|
if ( view == NULL )
|
||||||
{
|
{
|
||||||
view = [[wxAVView alloc] initWithFrame: r player:m_player];
|
view = [[wxAVView alloc] initWithFrame: r player:m_player];
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxOSX_USE_IPHONE
|
#if wxOSX_USE_IPHONE
|
||||||
wxWidgetIPhoneImpl* impl = new wxWidgetIPhoneImpl(mediactrl,view);
|
wxWidgetIPhoneImpl* impl = new wxWidgetIPhoneImpl(mediactrl,view);
|
||||||
#else
|
#else
|
||||||
@@ -431,16 +431,16 @@ bool wxAVMediaBackend::Load(const wxURI& location)
|
|||||||
{
|
{
|
||||||
wxCFStringRef uri(location.BuildURI());
|
wxCFStringRef uri(location.BuildURI());
|
||||||
NSURL *url = [NSURL URLWithString: uri.AsNSString()];
|
NSURL *url = [NSURL URLWithString: uri.AsNSString()];
|
||||||
|
|
||||||
AVAsset* asset = [AVAsset assetWithURL:url];
|
AVAsset* asset = [AVAsset assetWithURL:url];
|
||||||
if (! asset )
|
if (! asset )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( [asset isPlayable] )
|
if ( [asset isPlayable] )
|
||||||
{
|
{
|
||||||
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:asset];
|
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:asset];
|
||||||
[m_player replaceCurrentItemWithPlayerItem:playerItem];
|
[m_player replaceCurrentItemWithPlayerItem:playerItem];
|
||||||
|
|
||||||
return playerItem != nil;
|
return playerItem != nil;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -449,12 +449,12 @@ bool wxAVMediaBackend::Load(const wxURI& location)
|
|||||||
void wxAVMediaBackend::FinishLoad()
|
void wxAVMediaBackend::FinishLoad()
|
||||||
{
|
{
|
||||||
DoShowPlayerControls(m_interfaceflags);
|
DoShowPlayerControls(m_interfaceflags);
|
||||||
|
|
||||||
AVPlayerItem *playerItem = [m_player currentItem];
|
AVPlayerItem *playerItem = [m_player currentItem];
|
||||||
|
|
||||||
CGSize s = [playerItem presentationSize];
|
CGSize s = [playerItem presentationSize];
|
||||||
m_bestSize = wxSize(s.width, s.height);
|
m_bestSize = wxSize(s.width, s.height);
|
||||||
|
|
||||||
NotifyMovieLoaded();
|
NotifyMovieLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,7 +500,7 @@ bool wxAVMediaBackend::SetPlaybackRate(double dRate)
|
|||||||
|
|
||||||
bool wxAVMediaBackend::SetPosition(wxLongLong where)
|
bool wxAVMediaBackend::SetPosition(wxLongLong where)
|
||||||
{
|
{
|
||||||
[m_player seekToTime:CMTimeMakeWithSeconds(where.GetValue() / 1000.0, 1)
|
[m_player seekToTime:CMTimeMakeWithSeconds(where.GetValue() / 1000.0, 1)
|
||||||
toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero];
|
toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero];
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -514,11 +514,11 @@ wxLongLong wxAVMediaBackend::GetPosition()
|
|||||||
wxLongLong wxAVMediaBackend::GetDuration()
|
wxLongLong wxAVMediaBackend::GetDuration()
|
||||||
{
|
{
|
||||||
AVPlayerItem *playerItem = [m_player currentItem];
|
AVPlayerItem *playerItem = [m_player currentItem];
|
||||||
|
|
||||||
if ([playerItem status] == AVPlayerItemStatusReadyToPlay)
|
if ([playerItem status] == AVPlayerItemStatusReadyToPlay)
|
||||||
return CMTimeGetSeconds([[playerItem asset] duration])*1000.0;
|
return CMTimeGetSeconds([[playerItem asset] duration])*1000.0;
|
||||||
else
|
else
|
||||||
return 0.f;
|
return 0.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMediaState wxAVMediaBackend::GetState()
|
wxMediaState wxAVMediaBackend::GetState()
|
||||||
@@ -555,7 +555,7 @@ bool wxAVMediaBackend::ShowPlayerControls(wxMediaCtrlPlayerControls flags)
|
|||||||
{
|
{
|
||||||
if ( m_interfaceflags != flags )
|
if ( m_interfaceflags != flags )
|
||||||
DoShowPlayerControls(flags);
|
DoShowPlayerControls(flags);
|
||||||
|
|
||||||
m_interfaceflags = flags;
|
m_interfaceflags = flags;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -238,8 +238,7 @@ protected :
|
|||||||
- (BOOL)textFieldShouldReturn:(UITextField *)textField
|
- (BOOL)textFieldShouldReturn:(UITextField *)textField
|
||||||
{
|
{
|
||||||
wxUnusedVar(textField);
|
wxUnusedVar(textField);
|
||||||
|
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -317,7 +316,7 @@ wxUITextViewControl::wxUITextViewControl( wxTextCtrl *wxPeer, UITextView* v) :
|
|||||||
{
|
{
|
||||||
m_textView = v;
|
m_textView = v;
|
||||||
m_delegate= [[wxUITextViewDelegate alloc] init];
|
m_delegate= [[wxUITextViewDelegate alloc] init];
|
||||||
|
|
||||||
[m_textView setDelegate:m_delegate];
|
[m_textView setDelegate:m_delegate];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -423,7 +422,7 @@ void wxUITextViewControl::WriteText(const wxString& str)
|
|||||||
wxString st = str;
|
wxString st = str;
|
||||||
wxMacConvertNewlines10To13( &st );
|
wxMacConvertNewlines10To13( &st );
|
||||||
wxMacEditHelper helper(m_textView);
|
wxMacEditHelper helper(m_textView);
|
||||||
|
|
||||||
wxCFStringRef insert( st , m_wxPeer->GetFont().GetEncoding() );
|
wxCFStringRef insert( st , m_wxPeer->GetFont().GetEncoding() );
|
||||||
NSMutableString* subst = [NSMutableString stringWithString:[m_textView text]];
|
NSMutableString* subst = [NSMutableString stringWithString:[m_textView text]];
|
||||||
[subst replaceCharactersInRange:[m_textView selectedRange] withString:insert.AsNSString()];
|
[subst replaceCharactersInRange:[m_textView selectedRange] withString:insert.AsNSString()];
|
||||||
@@ -466,10 +465,10 @@ bool wxUITextViewControl::GetStyle(long position, wxTextAttr& style)
|
|||||||
/*
|
/*
|
||||||
if (font)
|
if (font)
|
||||||
style.SetFont(wxFont(font));
|
style.SetFont(wxFont(font));
|
||||||
|
|
||||||
if (bgcolor)
|
if (bgcolor)
|
||||||
style.SetBackgroundColour(wxColour(bgcolor));
|
style.SetBackgroundColour(wxColour(bgcolor));
|
||||||
|
|
||||||
if (fgcolor)
|
if (fgcolor)
|
||||||
style.SetTextColour(wxColour(fgcolor));
|
style.SetTextColour(wxColour(fgcolor));
|
||||||
*/
|
*/
|
||||||
@@ -489,15 +488,15 @@ void wxUITextViewControl::SetStyle(long start,
|
|||||||
range = [m_textView selectedRange];
|
range = [m_textView selectedRange];
|
||||||
/*
|
/*
|
||||||
UITextStorage* storage = [m_textView textStorage];
|
UITextStorage* storage = [m_textView textStorage];
|
||||||
|
|
||||||
wxFont font = style.GetFont();
|
wxFont font = style.GetFont();
|
||||||
if (style.HasFont() && font.IsOk())
|
if (style.HasFont() && font.IsOk())
|
||||||
[storage addAttribute:NSFontAttributeName value:font.OSXGetNSFont() range:range];
|
[storage addAttribute:NSFontAttributeName value:font.OSXGetNSFont() range:range];
|
||||||
|
|
||||||
wxColour bgcolor = style.GetBackgroundColour();
|
wxColour bgcolor = style.GetBackgroundColour();
|
||||||
if (style.HasBackgroundColour() && bgcolor.IsOk())
|
if (style.HasBackgroundColour() && bgcolor.IsOk())
|
||||||
[storage addAttribute:NSBackgroundColorAttributeName value:bgcolor.OSXGetNSColor() range:range];
|
[storage addAttribute:NSBackgroundColorAttributeName value:bgcolor.OSXGetNSColor() range:range];
|
||||||
|
|
||||||
wxColour fgcolor = style.GetTextColour();
|
wxColour fgcolor = style.GetTextColour();
|
||||||
if (style.HasTextColour() && fgcolor.IsOk())
|
if (style.HasTextColour() && fgcolor.IsOk())
|
||||||
[storage addAttribute:NSForegroundColorAttributeName value:fgcolor.OSXGetNSColor() range:range];
|
[storage addAttribute:NSForegroundColorAttributeName value:fgcolor.OSXGetNSColor() range:range];
|
||||||
@@ -512,9 +511,9 @@ void wxUITextViewControl::CheckSpelling(bool check)
|
|||||||
wxSize wxUITextViewControl::GetBestSize() const
|
wxSize wxUITextViewControl::GetBestSize() const
|
||||||
{
|
{
|
||||||
wxRect r;
|
wxRect r;
|
||||||
|
|
||||||
GetBestRect(&r);
|
GetBestRect(&r);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (m_textView && [m_textView layoutManager])
|
if (m_textView && [m_textView layoutManager])
|
||||||
{
|
{
|
||||||
@@ -526,7 +525,7 @@ wxSize wxUITextViewControl::GetBestSize() const
|
|||||||
}
|
}
|
||||||
return wxSize(0,0);
|
return wxSize(0,0);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxSize sz = r.GetSize();
|
wxSize sz = r.GetSize();
|
||||||
if ( sz.y < 31 )
|
if ( sz.y < 31 )
|
||||||
sz.y = 31;
|
sz.y = 31;
|
||||||
@@ -571,7 +570,7 @@ void wxUITextFieldControl::SetStringValue( const wxString &str)
|
|||||||
wxSize wxUITextFieldControl::GetBestSize() const
|
wxSize wxUITextFieldControl::GetBestSize() const
|
||||||
{
|
{
|
||||||
wxRect r;
|
wxRect r;
|
||||||
|
|
||||||
GetBestRect(&r);
|
GetBestRect(&r);
|
||||||
wxSize sz = r.GetSize();
|
wxSize sz = r.GetSize();
|
||||||
if ( sz.y < 31 )
|
if ( sz.y < 31 )
|
||||||
@@ -605,7 +604,7 @@ void wxUITextFieldControl::SetEditable(bool editable)
|
|||||||
if ( !editable ) {
|
if ( !editable ) {
|
||||||
[m_textField resignFirstResponder];
|
[m_textField resignFirstResponder];
|
||||||
}
|
}
|
||||||
|
|
||||||
[m_textField setEnabled: editable];
|
[m_textField setEnabled: editable];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -710,7 +709,7 @@ wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
|
|||||||
UITextView * v = nil;
|
UITextView * v = nil;
|
||||||
v = [[UITextView alloc] initWithFrame:r];
|
v = [[UITextView alloc] initWithFrame:r];
|
||||||
tv = v;
|
tv = v;
|
||||||
|
|
||||||
wxUITextViewControl* tc = new wxUITextViewControl( wxpeer, v );
|
wxUITextViewControl* tc = new wxUITextViewControl( wxpeer, v );
|
||||||
c = tc;
|
c = tc;
|
||||||
t = tc;
|
t = tc;
|
||||||
@@ -721,39 +720,39 @@ wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
|
|||||||
wxUITextField* v = [[wxUITextField alloc] initWithFrame:r];
|
wxUITextField* v = [[wxUITextField alloc] initWithFrame:r];
|
||||||
tv = v;
|
tv = v;
|
||||||
|
|
||||||
v.textColor = [UIColor blackColor];
|
v.textColor = [UIColor blackColor];
|
||||||
v.font = [UIFont systemFontOfSize:17.0];
|
v.font = [UIFont systemFontOfSize:17.0];
|
||||||
v.backgroundColor = [UIColor whiteColor];
|
v.backgroundColor = [UIColor whiteColor];
|
||||||
|
|
||||||
v.clearButtonMode = UITextFieldViewModeNever;
|
v.clearButtonMode = UITextFieldViewModeNever;
|
||||||
|
|
||||||
[v setBorderStyle:UITextBorderStyleBezel];
|
[v setBorderStyle:UITextBorderStyleBezel];
|
||||||
if ( style & wxNO_BORDER )
|
if ( style & wxNO_BORDER )
|
||||||
v.borderStyle = UITextBorderStyleNone;
|
v.borderStyle = UITextBorderStyleNone;
|
||||||
|
|
||||||
wxUITextFieldControl* tc = new wxUITextFieldControl( wxpeer, v );
|
wxUITextFieldControl* tc = new wxUITextFieldControl( wxpeer, v );
|
||||||
c = tc;
|
c = tc;
|
||||||
t = tc;
|
t = tc;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( style & wxTE_PASSWORD )
|
if ( style & wxTE_PASSWORD )
|
||||||
[tv setSecureTextEntry:YES];
|
[tv setSecureTextEntry:YES];
|
||||||
|
|
||||||
if ( style & wxTE_CAPITALIZE )
|
if ( style & wxTE_CAPITALIZE )
|
||||||
[tv setAutocapitalizationType:UITextAutocapitalizationTypeWords];
|
[tv setAutocapitalizationType:UITextAutocapitalizationTypeWords];
|
||||||
else
|
else
|
||||||
[tv setAutocapitalizationType:UITextAutocapitalizationTypeSentences];
|
[tv setAutocapitalizationType:UITextAutocapitalizationTypeSentences];
|
||||||
|
|
||||||
if ( !(style & wxTE_MULTILINE) )
|
if ( !(style & wxTE_MULTILINE) )
|
||||||
{
|
{
|
||||||
[tv setAutocorrectionType:UITextAutocorrectionTypeNo];
|
[tv setAutocorrectionType:UITextAutocorrectionTypeNo];
|
||||||
[tv setReturnKeyType:UIReturnKeyDone];
|
[tv setReturnKeyType:UIReturnKeyDone];
|
||||||
}
|
}
|
||||||
[tv setKeyboardType:UIKeyboardTypeDefault];
|
[tv setKeyboardType:UIKeyboardTypeDefault];
|
||||||
|
|
||||||
t->SetStringValue(str);
|
t->SetStringValue(str);
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -68,7 +68,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -221,7 +221,7 @@ void wxWindowMac::Init()
|
|||||||
wxWindowMac::~wxWindowMac()
|
wxWindowMac::~wxWindowMac()
|
||||||
{
|
{
|
||||||
SendDestroyEvent();
|
SendDestroyEvent();
|
||||||
|
|
||||||
#if wxUSE_HOTKEY && wxOSX_USE_COCOA_OR_CARBON
|
#if wxUSE_HOTKEY && wxOSX_USE_COCOA_OR_CARBON
|
||||||
for ( int i = s_hotkeys.size()-1; i>=0; -- i )
|
for ( int i = s_hotkeys.size()-1; i>=0; -- i )
|
||||||
{
|
{
|
||||||
@@ -310,10 +310,10 @@ void wxWindowMac::SetWrappingPeer(wxOSXWidgetImpl* wrapper)
|
|||||||
wxOSXWidgetImpl* inner = GetPeer();
|
wxOSXWidgetImpl* inner = GetPeer();
|
||||||
wxASSERT_MSG( inner != NULL && inner->IsOk(), "missing or incomplete inner peer" );
|
wxASSERT_MSG( inner != NULL && inner->IsOk(), "missing or incomplete inner peer" );
|
||||||
wxASSERT_MSG( wrapper != NULL && wrapper->IsOk(), "missing or incomplete wrapper" );
|
wxASSERT_MSG( wrapper != NULL && wrapper->IsOk(), "missing or incomplete wrapper" );
|
||||||
|
|
||||||
if ( !(inner != NULL && inner->IsOk() && wrapper != NULL && wrapper->IsOk()) )
|
if ( !(inner != NULL && inner->IsOk() && wrapper != NULL && wrapper->IsOk()) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
inner->RemoveFromParent();
|
inner->RemoveFromParent();
|
||||||
wrapper->InstallEventHandler();
|
wrapper->InstallEventHandler();
|
||||||
wrapper->Embed(inner);
|
wrapper->Embed(inner);
|
||||||
@@ -334,28 +334,28 @@ void wxWindowMac::SetPeer(wxOSXWidgetImpl* peer)
|
|||||||
if ( GetPeer() && !GetPeer()->IsRootControl())
|
if ( GetPeer() && !GetPeer()->IsRootControl())
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( GetPeer()->IsOk() , wxT("The native control must exist already") ) ;
|
wxASSERT_MSG( GetPeer()->IsOk() , wxT("The native control must exist already") ) ;
|
||||||
|
|
||||||
if (!GetParent()->GetChildren().Find((wxWindow*)this))
|
if (!GetParent()->GetChildren().Find((wxWindow*)this))
|
||||||
GetParent()->AddChild( this );
|
GetParent()->AddChild( this );
|
||||||
|
|
||||||
GetPeer()->InstallEventHandler();
|
GetPeer()->InstallEventHandler();
|
||||||
GetPeer()->Embed(GetParent()->GetPeer());
|
GetPeer()->Embed(GetParent()->GetPeer());
|
||||||
|
|
||||||
GetParent()->MacChildAdded() ;
|
GetParent()->MacChildAdded() ;
|
||||||
|
|
||||||
// adjust font, controlsize etc
|
// adjust font, controlsize etc
|
||||||
GetPeer()->SetControlSize( m_windowVariant );
|
GetPeer()->SetControlSize( m_windowVariant );
|
||||||
InheritAttributes();
|
InheritAttributes();
|
||||||
// in case nothing has been set, use the variant default fonts
|
// in case nothing has been set, use the variant default fonts
|
||||||
if ( !m_hasFont )
|
if ( !m_hasFont )
|
||||||
DoSetWindowVariant( m_windowVariant );
|
DoSetWindowVariant( m_windowVariant );
|
||||||
|
|
||||||
GetPeer()->SetInitialLabel( wxStripMenuCodes(m_label, wxStrip_Mnemonics), GetFont().GetEncoding() ) ;
|
GetPeer()->SetInitialLabel( wxStripMenuCodes(m_label, wxStrip_Mnemonics), GetFont().GetEncoding() ) ;
|
||||||
|
|
||||||
// for controls we want to use best size for wxDefaultSize params )
|
// for controls we want to use best size for wxDefaultSize params )
|
||||||
if ( !GetPeer()->IsUserPane() )
|
if ( !GetPeer()->IsUserPane() )
|
||||||
SetInitialSize(GetMinSize());
|
SetInitialSize(GetMinSize());
|
||||||
|
|
||||||
SetCursor( *wxSTANDARD_CURSOR ) ;
|
SetCursor( *wxSTANDARD_CURSOR ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -859,16 +859,16 @@ void wxWindowMac::DoGetClientSize( int *x, int *y ) const
|
|||||||
// we shouldn't return invalid width
|
// we shouldn't return invalid width
|
||||||
if ( ww < 0 )
|
if ( ww < 0 )
|
||||||
ww = 0;
|
ww = 0;
|
||||||
|
|
||||||
*x = ww;
|
*x = ww;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (y)
|
if (y)
|
||||||
{
|
{
|
||||||
// we shouldn't return invalid height
|
// we shouldn't return invalid height
|
||||||
if ( hh < 0 )
|
if ( hh < 0 )
|
||||||
hh = 0;
|
hh = 0;
|
||||||
|
|
||||||
*y = hh;
|
*y = hh;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1244,7 +1244,7 @@ bool wxWindowMac::Show(bool show)
|
|||||||
{
|
{
|
||||||
if ( !show )
|
if ( !show )
|
||||||
MacInvalidateBorders();
|
MacInvalidateBorders();
|
||||||
|
|
||||||
if ( !wxWindowBase::Show(show) )
|
if ( !wxWindowBase::Show(show) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -1375,7 +1375,7 @@ void wxWindowMac::Refresh(bool WXUNUSED(eraseBack), const wxRect *rect)
|
|||||||
|
|
||||||
if ( !IsShownOnScreen() )
|
if ( !IsShownOnScreen() )
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
if ( IsFrozen() )
|
if ( IsFrozen() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1999,7 +1999,7 @@ bool wxWindowMac::MacDoRedraw( long time )
|
|||||||
wxNonOwnedWindow* top = MacGetTopLevelWindow();
|
wxNonOwnedWindow* top = MacGetTopLevelWindow();
|
||||||
if (top)
|
if (top)
|
||||||
top->WindowWasPainted() ;
|
top->WindowWasPainted() ;
|
||||||
|
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2302,14 +2302,14 @@ long wxWindowMac::MacGetLeftBorderSize() const
|
|||||||
{
|
{
|
||||||
// the wx borders are all symmetric in mac themes
|
// the wx borders are all symmetric in mac themes
|
||||||
long border = MacGetWXBorderSize() ;
|
long border = MacGetWXBorderSize() ;
|
||||||
|
|
||||||
if ( GetPeer() )
|
if ( GetPeer() )
|
||||||
{
|
{
|
||||||
int left, top, right, bottom;
|
int left, top, right, bottom;
|
||||||
GetPeer()->GetLayoutInset( left, top, right, bottom );
|
GetPeer()->GetLayoutInset( left, top, right, bottom );
|
||||||
border -= left;
|
border -= left;
|
||||||
}
|
}
|
||||||
|
|
||||||
return border;
|
return border;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2318,14 +2318,14 @@ long wxWindowMac::MacGetRightBorderSize() const
|
|||||||
{
|
{
|
||||||
// the wx borders are all symmetric in mac themes
|
// the wx borders are all symmetric in mac themes
|
||||||
long border = MacGetWXBorderSize() ;
|
long border = MacGetWXBorderSize() ;
|
||||||
|
|
||||||
if ( GetPeer() )
|
if ( GetPeer() )
|
||||||
{
|
{
|
||||||
int left, top, right, bottom;
|
int left, top, right, bottom;
|
||||||
GetPeer()->GetLayoutInset( left, top, right, bottom );
|
GetPeer()->GetLayoutInset( left, top, right, bottom );
|
||||||
border -= right;
|
border -= right;
|
||||||
}
|
}
|
||||||
|
|
||||||
return border;
|
return border;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2333,14 +2333,14 @@ long wxWindowMac::MacGetTopBorderSize() const
|
|||||||
{
|
{
|
||||||
// the wx borders are all symmetric in mac themes
|
// the wx borders are all symmetric in mac themes
|
||||||
long border = MacGetWXBorderSize() ;
|
long border = MacGetWXBorderSize() ;
|
||||||
|
|
||||||
if ( GetPeer() )
|
if ( GetPeer() )
|
||||||
{
|
{
|
||||||
int left, top, right, bottom;
|
int left, top, right, bottom;
|
||||||
GetPeer()->GetLayoutInset( left, top, right, bottom );
|
GetPeer()->GetLayoutInset( left, top, right, bottom );
|
||||||
border -= top;
|
border -= top;
|
||||||
}
|
}
|
||||||
|
|
||||||
return border;
|
return border;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2348,14 +2348,14 @@ long wxWindowMac::MacGetBottomBorderSize() const
|
|||||||
{
|
{
|
||||||
// the wx borders are all symmetric in mac themes
|
// the wx borders are all symmetric in mac themes
|
||||||
long border = MacGetWXBorderSize() ;
|
long border = MacGetWXBorderSize() ;
|
||||||
|
|
||||||
if ( GetPeer() )
|
if ( GetPeer() )
|
||||||
{
|
{
|
||||||
int left, top, right, bottom;
|
int left, top, right, bottom;
|
||||||
GetPeer()->GetLayoutInset( left, top, right, bottom );
|
GetPeer()->GetLayoutInset( left, top, right, bottom );
|
||||||
border -= bottom;
|
border -= bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
return border;
|
return border;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2530,18 +2530,18 @@ wxHotKeyHandler(EventHandlerCallRef WXUNUSED(nextHandler),
|
|||||||
GetEventParameter( event, kEventParamKeyMacCharCodes, typeChar, NULL, 1, NULL, &charCode );
|
GetEventParameter( event, kEventParamKeyMacCharCodes, typeChar, NULL, 1, NULL, &charCode );
|
||||||
GetEventParameter( event, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode );
|
GetEventParameter( event, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode );
|
||||||
GetEventParameter( event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers );
|
GetEventParameter( event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers );
|
||||||
|
|
||||||
UInt32 keymessage = (keyCode << 8) + charCode;
|
UInt32 keymessage = (keyCode << 8) + charCode;
|
||||||
|
|
||||||
wxKeyEvent wxevent(wxEVT_HOTKEY);
|
wxKeyEvent wxevent(wxEVT_HOTKEY);
|
||||||
wxevent.SetId(hotKeyId.id);
|
wxevent.SetId(hotKeyId.id);
|
||||||
wxTheApp->MacCreateKeyEvent( wxevent, s_hotkeys[i].window , keymessage ,
|
wxTheApp->MacCreateKeyEvent( wxevent, s_hotkeys[i].window , keymessage ,
|
||||||
modifiers , when , 0 ) ;
|
modifiers , when , 0 ) ;
|
||||||
|
|
||||||
s_hotkeys[i].window->HandleWindowEvent(wxevent);
|
s_hotkeys[i].window->HandleWindowEvent(wxevent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return noErr;
|
return noErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2552,11 +2552,11 @@ bool wxWindowMac::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
|
|||||||
if ( s_hotkeys[i].keyId == hotkeyId )
|
if ( s_hotkeys[i].keyId == hotkeyId )
|
||||||
{
|
{
|
||||||
wxLogLastError(wxT("hotkeyId already registered"));
|
wxLogLastError(wxT("hotkeyId already registered"));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool installed = false;
|
static bool installed = false;
|
||||||
if ( !installed )
|
if ( !installed )
|
||||||
{
|
{
|
||||||
@@ -2567,7 +2567,7 @@ bool wxWindowMac::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
|
|||||||
InstallApplicationEventHandler(&wxHotKeyHandler, 1, &eventType, NULL, NULL);
|
InstallApplicationEventHandler(&wxHotKeyHandler, 1, &eventType, NULL, NULL);
|
||||||
installed = true;
|
installed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
UInt32 mac_modifiers=0;
|
UInt32 mac_modifiers=0;
|
||||||
if ( modifiers & wxMOD_ALT )
|
if ( modifiers & wxMOD_ALT )
|
||||||
mac_modifiers |= optionKey;
|
mac_modifiers |= optionKey;
|
||||||
@@ -2577,18 +2577,18 @@ bool wxWindowMac::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
|
|||||||
mac_modifiers |= controlKey;
|
mac_modifiers |= controlKey;
|
||||||
if ( modifiers & wxMOD_CONTROL )
|
if ( modifiers & wxMOD_CONTROL )
|
||||||
mac_modifiers |= cmdKey;
|
mac_modifiers |= cmdKey;
|
||||||
|
|
||||||
EventHotKeyRef hotKeyRef;
|
EventHotKeyRef hotKeyRef;
|
||||||
EventHotKeyID hotKeyIDmac;
|
EventHotKeyID hotKeyIDmac;
|
||||||
|
|
||||||
hotKeyIDmac.signature = 'WXMC';
|
hotKeyIDmac.signature = 'WXMC';
|
||||||
hotKeyIDmac.id = hotkeyId;
|
hotKeyIDmac.id = hotkeyId;
|
||||||
|
|
||||||
if ( RegisterEventHotKey(wxCharCodeWXToOSX((wxKeyCode)keycode), mac_modifiers, hotKeyIDmac,
|
if ( RegisterEventHotKey(wxCharCodeWXToOSX((wxKeyCode)keycode), mac_modifiers, hotKeyIDmac,
|
||||||
GetApplicationEventTarget(), 0, &hotKeyRef) != noErr )
|
GetApplicationEventTarget(), 0, &hotKeyRef) != noErr )
|
||||||
{
|
{
|
||||||
wxLogLastError(wxT("RegisterHotKey"));
|
wxLogLastError(wxT("RegisterHotKey"));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2597,10 +2597,10 @@ bool wxWindowMac::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
|
|||||||
v.ref = hotKeyRef;
|
v.ref = hotKeyRef;
|
||||||
v.keyId = hotkeyId;
|
v.keyId = hotkeyId;
|
||||||
v.window = this;
|
v.window = this;
|
||||||
|
|
||||||
s_hotkeys.push_back(v);
|
s_hotkeys.push_back(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2615,14 +2615,14 @@ bool wxWindowMac::UnregisterHotKey(int hotkeyId)
|
|||||||
if ( UnregisterEventHotKey(ref) != noErr )
|
if ( UnregisterEventHotKey(ref) != noErr )
|
||||||
{
|
{
|
||||||
wxLogLastError(wxT("UnregisterHotKey"));
|
wxLogLastError(wxT("UnregisterHotKey"));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2631,7 +2631,7 @@ bool wxWindowMac::UnregisterHotKey(int hotkeyId)
|
|||||||
bool wxWindowMac::OSXHandleKeyEvent( wxKeyEvent& event )
|
bool wxWindowMac::OSXHandleKeyEvent( wxKeyEvent& event )
|
||||||
{
|
{
|
||||||
bool handled = false;
|
bool handled = false;
|
||||||
|
|
||||||
// moved the ordinary key event sending AFTER the accel evaluation
|
// moved the ordinary key event sending AFTER the accel evaluation
|
||||||
|
|
||||||
#if wxUSE_ACCEL
|
#if wxUSE_ACCEL
|
||||||
@@ -2665,7 +2665,7 @@ bool wxWindowMac::OSXHandleKeyEvent( wxKeyEvent& event )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // wxUSE_ACCEL
|
#endif // wxUSE_ACCEL
|
||||||
|
|
||||||
if ( !handled )
|
if ( !handled )
|
||||||
{
|
{
|
||||||
handled = HandleWindowEvent( event ) ;
|
handled = HandleWindowEvent( event ) ;
|
||||||
@@ -2738,9 +2738,9 @@ void wxWidgetImpl::RemoveAssociations(wxWidgetImpl* impl)
|
|||||||
|
|
||||||
void wxWidgetImpl::RemoveAssociation(WXWidget control)
|
void wxWidgetImpl::RemoveAssociation(WXWidget control)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( control != NULL, wxT("attempt to remove a NULL WXWidget from control map") );
|
wxCHECK_RET( control != NULL, wxT("attempt to remove a NULL WXWidget from control map") );
|
||||||
|
|
||||||
wxWinMacControlList.erase(control);
|
wxWinMacControlList.erase(control);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxIMPLEMENT_ABSTRACT_CLASS(wxWidgetImpl, wxObject);
|
wxIMPLEMENT_ABSTRACT_CLASS(wxWidgetImpl, wxObject);
|
||||||
|
Reference in New Issue
Block a user