]> git.saurik.com Git - wxWidgets.git/commitdiff
Added Cocoa_acceptsFirstMouse.
authorDavid Elliott <dfe@tgwbd.org>
Fri, 23 Sep 2005 15:27:42 +0000 (15:27 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Fri, 23 Sep 2005 15:27:42 +0000 (15:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cocoa/NSView.h
src/cocoa/NSView.mm

index 50a583c5d2f0f0492cb903fe0944849dadc01ea2..7fb9c79dd18600243fdb88f9365de1767199d4e7 100644 (file)
@@ -32,6 +32,8 @@ public:
     virtual wxWindow* GetWxWindow() const
     {  return NULL;    }
     virtual void Cocoa_FrameChanged(void) = 0;
+    virtual bool Cocoa_acceptsFirstMouse(bool &acceptsFirstMouse, WX_NSEvent theEvent)
+    {   return false; }
     virtual bool Cocoa_drawRect(const NSRect &rect)
     {   return false; }
     virtual bool Cocoa_mouseDown(WX_NSEvent theEvent)
index 364fa030594906b1508ac51100ad67b02f055c17..72c68998689456aef19bd57569c14ca9492be65d 100644 (file)
@@ -79,6 +79,15 @@ void wxCocoaNSView::DisassociateNSView(WX_NSView cocoaNSView)
 WX_IMPLEMENT_POSER(wxPoserNSView);
 @implementation wxPoserNSView : NSView
 
+- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
+{
+    bool acceptsFirstMouse = false;
+    wxCocoaNSView *win = wxCocoaNSView::GetFromCocoa(self);
+    if(!win || !win->Cocoa_acceptsFirstMouse(acceptsFirstMouse, theEvent))
+        acceptsFirstMouse = [super acceptsFirstMouse:theEvent];
+    return acceptsFirstMouse;
+}
+
 - (void)drawRect: (NSRect)rect
 {
     wxCocoaNSView *win = wxCocoaNSView::GetFromCocoa(self);