diff options
Diffstat (limited to 'cocoa')
-rw-r--r-- | cocoa/ScintillaCocoa.h | 1 | ||||
-rw-r--r-- | cocoa/ScintillaCocoa.mm | 10 | ||||
-rw-r--r-- | cocoa/ScintillaView.h | 3 | ||||
-rw-r--r-- | cocoa/ScintillaView.mm | 23 |
4 files changed, 2 insertions, 35 deletions
diff --git a/cocoa/ScintillaCocoa.h b/cocoa/ScintillaCocoa.h index c857fd21a..c9f8fde8a 100644 --- a/cocoa/ScintillaCocoa.h +++ b/cocoa/ScintillaCocoa.h @@ -87,7 +87,6 @@ private: NSEvent* lastMouseEvent; id<ScintillaNotificationProtocol> delegate; - bool delegateHasCommand; SciNotifyFunc notifyProc; intptr_t notifyObj; diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index 79332eda6..beae1cace 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -385,7 +385,6 @@ ScintillaCocoa::ScintillaCocoa(InnerView* view, MarginView* viewMargin) timerTarget = [[TimerTarget alloc] init: this]; lastMouseEvent = NULL; delegate = NULL; - delegateHasCommand = false; notifyObj = NULL; notifyProc = NULL; capturedMouse = false; @@ -1664,11 +1663,6 @@ void ScintillaCocoa::UpdateForScroll() { void ScintillaCocoa::SetDelegate(id<ScintillaNotificationProtocol> delegate_) { delegate = delegate_; - delegateHasCommand = false; - if (delegate) - { - delegateHasCommand = [(id)delegate respondsToSelector: @selector(command:ctrlID:)]; - } } //-------------------------------------------------------------------------------------------------- @@ -1695,8 +1689,6 @@ void ScintillaCocoa::NotifyChange() if (notifyProc != NULL) notifyProc(notifyObj, WM_COMMAND, Platform::LongFromTwoShorts(GetCtrlID(), SCEN_CHANGE), (uintptr_t) this); - if (delegateHasCommand) - [delegate command:SCEN_CHANGE idFrom:GetCtrlID()]; } //-------------------------------------------------------------------------------------------------- @@ -1706,8 +1698,6 @@ void ScintillaCocoa::NotifyFocus(bool focus) if (notifyProc != NULL) notifyProc(notifyObj, WM_COMMAND, Platform::LongFromTwoShorts(GetCtrlID(), (focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS)), (uintptr_t) this); - if (delegateHasCommand) - [delegate command:(focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS) idFrom:GetCtrlID()]; Editor::NotifyFocus(focus); } diff --git a/cocoa/ScintillaView.h b/cocoa/ScintillaView.h index 653f111d3..63b5cf4e9 100644 --- a/cocoa/ScintillaView.h +++ b/cocoa/ScintillaView.h @@ -46,8 +46,6 @@ extern NSString *const SCIUpdateUINotification; @protocol ScintillaNotificationProtocol - (void)notification: (Scintilla::SCNotification*)notification; -@optional -- (void)command:(int)command idFrom:(int)idFrom; @end /** @@ -129,7 +127,6 @@ extern NSString *const SCIUpdateUINotification; - (void) suspendDrawing: (BOOL) suspend; - (void) notification: (Scintilla::SCNotification*) notification; -- (void) command:(int) command idFrom:(int) idFrom; // Scroller handling - (void) setMarginWidth: (int) width; diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index ce0123982..3bdc9646a 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -1014,29 +1014,10 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) } break; } - } -} - -//-------------------------------------------------------------------------------------------------- - -/** - * Method receives notifications from Scintilla for gaining and losing focus and for changes. - * A delegate can be set to receive all notifications. - */ -- (void) command:(int)command idFrom:(int)idFrom -{ - if ((mDelegate != nil) && ([(id)mDelegate respondsToSelector:@selector(command:ctrlID:)])) - { - [mDelegate command:command idFrom:idFrom]; - } - - // Notifications for the editor itself. - switch (command) - { - case SCEN_KILLFOCUS: + case SCN_FOCUSOUT: [self sendNotification: NSTextDidEndEditingNotification]; break; - case SCEN_SETFOCUS: // Nothing to do for now. + case SCN_FOCUSIN: // Nothing to do for now. break; } } |