diff options
| author | Tse Kit Yam <me@kytse.com> | 2016-11-23 10:46:28 +1100 |
|---|---|---|
| committer | Tse Kit Yam <me@kytse.com> | 2016-11-23 10:46:28 +1100 |
| commit | d2c7abab397926735f5a41ca17fd280a409e2940 (patch) | |
| tree | efe207d319eef0ac417295439593a7baf36e20c7 /cocoa/ScintillaCocoa.mm | |
| parent | 4ae76e455aec66826a284356d63cc2b5995c0b2f (diff) | |
| download | scintilla-mirror-d2c7abab397926735f5a41ca17fd280a409e2940.tar.gz | |
Implementation of MarginRightClick event.
Diffstat (limited to 'cocoa/ScintillaCocoa.mm')
| -rw-r--r-- | cocoa/ScintillaCocoa.mm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index 076d6fcde..c283e4e98 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -2455,6 +2455,17 @@ void ScintillaCocoa::MouseDown(NSEvent* event) ButtonDown(Point(location.x, location.y), (int) (time * 1000), shift, command, alt); } +void ScintillaCocoa::RightMouseDown(NSEvent *event) +{ + Point location = ConvertPoint([event locationInWindow]); + NSTimeInterval time = [event timestamp]; + bool command = ([event modifierFlags] & NSCommandKeyMask) != 0; + bool shift = ([event modifierFlags] & NSShiftKeyMask) != 0; + bool alt = ([event modifierFlags] & NSAlternateKeyMask) != 0; + + RightButtonDownWithModifiers(Point(location.x, location.y), (int) (time * 1000), ModifierFlags(shift, command, alt)); +} + //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::MouseMove(NSEvent* event) @@ -2533,6 +2544,16 @@ void ScintillaCocoa::Redo() //-------------------------------------------------------------------------------------------------- +bool ScintillaCocoa::ShouldDisplayPopupOnMargin() +{ + return displayPopupMenu == SC_POPUP_ALL; +} + +bool ScintillaCocoa::ShouldDisplayPopupOnText() +{ + return displayPopupMenu == SC_POPUP_ALL || displayPopupMenu == SC_POPUP_TEXT; +} + /** * Creates and returns a popup menu, which is then displayed by the Cocoa framework. */ |
