|
|
@@ -672,6 +672,12 @@ public: |
|
|
void redirectPaste (NSObject*) { handleKeyPress (KeyPress ('v', ModifierKeys (ModifierKeys::commandModifier), 'v')); }
|
|
|
void redirectPaste (NSObject*) { handleKeyPress (KeyPress ('v', ModifierKeys (ModifierKeys::commandModifier), 'v')); }
|
|
|
void redirectCut (NSObject*) { handleKeyPress (KeyPress ('x', ModifierKeys (ModifierKeys::commandModifier), 'x')); }
|
|
|
void redirectCut (NSObject*) { handleKeyPress (KeyPress ('x', ModifierKeys (ModifierKeys::commandModifier), 'x')); }
|
|
|
|
|
|
|
|
|
|
|
|
void redirectWillMoveToWindow (NSWindow* newWindow)
|
|
|
|
|
|
{
|
|
|
|
|
|
if ([view window] == window && newWindow == nullptr)
|
|
|
|
|
|
getComponent().removeFromDesktop();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
void sendMouseEvent (NSEvent* ev)
|
|
|
void sendMouseEvent (NSEvent* ev)
|
|
|
{
|
|
|
{
|
|
|
updateModifiers (ev);
|
|
|
updateModifiers (ev);
|
|
|
@@ -1536,6 +1542,8 @@ struct JuceNSViewClass : public ObjCClass<NSView> |
|
|
addMethod (@selector (copy:), copy, "v@:@");
|
|
|
addMethod (@selector (copy:), copy, "v@:@");
|
|
|
addMethod (@selector (cut:), cut, "v@:@");
|
|
|
addMethod (@selector (cut:), cut, "v@:@");
|
|
|
|
|
|
|
|
|
|
|
|
addMethod (@selector (viewWillMoveToWindow:), willMoveToWindow, "v@:@");
|
|
|
|
|
|
|
|
|
addProtocol (@protocol (NSTextInput));
|
|
|
addProtocol (@protocol (NSTextInput));
|
|
|
|
|
|
|
|
|
registerClass();
|
|
|
registerClass();
|
|
|
@@ -1585,6 +1593,11 @@ private: |
|
|
static void paste (id self, SEL, NSObject* s) { if (NSViewComponentPeer* p = getOwner (self)) p->redirectPaste (s); }
|
|
|
static void paste (id self, SEL, NSObject* s) { if (NSViewComponentPeer* p = getOwner (self)) p->redirectPaste (s); }
|
|
|
static void cut (id self, SEL, NSObject* s) { if (NSViewComponentPeer* p = getOwner (self)) p->redirectCut (s); }
|
|
|
static void cut (id self, SEL, NSObject* s) { if (NSViewComponentPeer* p = getOwner (self)) p->redirectCut (s); }
|
|
|
|
|
|
|
|
|
|
|
|
static void willMoveToWindow (id self, SEL, NSWindow* window)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (NSViewComponentPeer* p = getOwner (self)) p->redirectWillMoveToWindow (window);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
static BOOL acceptsFirstMouse (id, SEL, NSEvent*) { return YES; }
|
|
|
static BOOL acceptsFirstMouse (id, SEL, NSEvent*) { return YES; }
|
|
|
static BOOL wantsDefaultClipping (id, SEL) { return YES; } // (this is the default, but may want to customise it in future)
|
|
|
static BOOL wantsDefaultClipping (id, SEL) { return YES; } // (this is the default, but may want to customise it in future)
|
|
|
static BOOL worksWhenModal (id self, SEL) { if (NSViewComponentPeer* p = getOwner (self)) return p->worksWhenModal(); return NO; };
|
|
|
static BOOL worksWhenModal (id self, SEL) { if (NSViewComponentPeer* p = getOwner (self)) return p->worksWhenModal(); return NO; };
|
|
|
|