|
|
|
@ -4,6 +4,7 @@ class WindowBaseImpl; |
|
|
|
|
|
|
|
@interface AvnView : NSView |
|
|
|
-(AvnView*) initWithParent: (WindowBaseImpl*) parent; |
|
|
|
-(NSEvent*) lastMouseDownEvent; |
|
|
|
@end |
|
|
|
|
|
|
|
@interface AvnWindow : NSWindow <NSWindowDelegate> |
|
|
|
@ -11,9 +12,6 @@ class WindowBaseImpl; |
|
|
|
-(void) setCanBecomeKeyAndMain; |
|
|
|
@end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class WindowBaseImpl : public ComSingleObject<IAvnWindowBase, &IID_IAvnWindowBase> |
|
|
|
{ |
|
|
|
public: |
|
|
|
@ -64,6 +62,18 @@ public: |
|
|
|
[View setNeedsDisplayInRect:[View frame]]; |
|
|
|
} |
|
|
|
|
|
|
|
virtual void BeginMoveDrag () |
|
|
|
{ |
|
|
|
auto lastEvent = [View lastMouseDownEvent]; |
|
|
|
|
|
|
|
if(lastEvent == nullptr) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
[Window performWindowDragWithEvent:lastEvent]; |
|
|
|
} |
|
|
|
|
|
|
|
protected: |
|
|
|
virtual NSWindowStyleMask GetStyle() |
|
|
|
{ |
|
|
|
@ -74,8 +84,6 @@ protected: |
|
|
|
{ |
|
|
|
[Window setStyleMask:GetStyle()]; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
@implementation AvnView |
|
|
|
@ -86,6 +94,11 @@ protected: |
|
|
|
NSEvent* _lastMouseDownEvent; |
|
|
|
} |
|
|
|
|
|
|
|
- (NSEvent*) lastMouseDownEvent |
|
|
|
{ |
|
|
|
return _lastMouseDownEvent; |
|
|
|
} |
|
|
|
|
|
|
|
-(AvnView*) initWithParent: (WindowBaseImpl*) parent |
|
|
|
{ |
|
|
|
self = [super init]; |
|
|
|
|