Added Cocoa_acceptsFirstMouse.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott
2005-09-23 15:27:42 +00:00
parent 3d012d1bf1
commit c05e07cb8c
2 changed files with 11 additions and 0 deletions

View 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)

View 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);