((wxWidgetCocoaImpl*)cw->GetPeer())->DoHandleMouseEvent( event);
handled = true;
}
- else if ( [event type] == NSMouseMoved )
- {
- NSPoint nsPoint = [event locationInWindow];
- if ( [event window] != nil )
- nsPoint = [[event window] convertBaseToScreen:nsPoint];
-
- wxPoint pt = wxFromNSPoint(NULL, nsPoint);
- wxWindow* mw = ::wxFindWindowAtPoint(pt);
- if ( mw )
- {
- if (wxTheApp)
- wxTheApp->MacSetCurrentEvent(event, NULL);
- ((wxWidgetCocoaImpl*)mw->GetPeer())->DoHandleMouseEvent( event);
- handled = true;
- }
- }
if ( handled )
{
if (wxTheApp)
[m_macWindow setDelegate:controller];
- [m_macWindow setAcceptsMouseMovedEvents: YES];
-
if ( ( style & wxFRAME_SHAPED) )
{
[m_macWindow setOpaque:NO];
id _lastToolTipOwner;
void* _lastUserData;
- NSTrackingArea* _trackingArea;
}
-- (void) updateTrackingArea;
-- (NSTrackingArea*) trackingArea;
@end // wxNSView
@interface NSView(PossibleMethods)
}
}
-- (void) updateTrackingArea
-{
- if (_trackingArea)
- {
- [self removeTrackingArea: _trackingArea];
- [_trackingArea release];
- }
-
- NSTrackingAreaOptions options = NSTrackingMouseEnteredAndExited|NSTrackingMouseMoved|NSTrackingActiveAlways;
-
- NSTrackingArea* area = [[NSTrackingArea alloc] initWithRect: [self bounds] options: options owner: self userInfo: nil];
- [self addTrackingArea: area];
-
- _trackingArea = area;
-}
-
-- (NSTrackingArea*) trackingArea
-{
- return _trackingArea;
-}
-
/* idea taken from webkit sources: overwrite the methods that (private) NSToolTipManager will use to attach its tracking rectangle
* then when changing the tooltip send fake view-exit and view-enter methods which will lead to a tooltip refresh
*/
NSRect r = wxToNSRect( [m_osxView superview], wxRect(x,y,width, height) );
[m_osxView setFrame:r];
[[m_osxView superview] setNeedsDisplayInRect:r];
-
- wxNSView* wxview = (wxNSView*)m_osxView;
-
- if ([wxview respondsToSelector:@selector(updateTrackingArea)] )
- [wxview updateTrackingArea];
}
void wxWidgetCocoaImpl::GetPosition( int &x, int &y ) const
}
}
-}
+ NSTrackingAreaOptions options = NSTrackingMouseEnteredAndExited|NSTrackingMouseMoved|NSTrackingActiveAlways|NSTrackingInVisibleRect;
+ NSTrackingArea* area = [[NSTrackingArea alloc] initWithRect: NSZeroRect options: options owner: m_osxView userInfo: nil];
+ [m_osxView addTrackingArea: area];
+ [area release];
+ }
bool wxWidgetCocoaImpl::DoHandleCharEvent(NSEvent *event, NSString *text)
{