#FEATURE by cg
class: FlyByHelp
added: #keyRelease:x:y:view:
changed: #keyPress:x:y:view:
SHIFT-Control opens a resource editor
--- a/FlyByHelp.st Wed Feb 20 12:23:48 2019 +0100
+++ b/FlyByHelp.st Wed Feb 20 12:24:12 2019 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 2001 by eXept Software AG
All Rights Reserved
@@ -131,12 +133,12 @@
!
keyPress:key x:x y:y view:aView
- <resource: #keyboard (#Escape)>
+ <resource: #keyboard (#Escape #Control #Shift)>
|prevView|
currentHelpView notNil ifTrue:[
- key == $§ ifTrue:[
+ key == $§ ifTrue:[
"/ generate a line suitable for the resources file (a null translation)
"/ into the clipboard; makes it easy to add missing translations to a .rs file,
"/ by pressing paragraph whenever you see an untranslated helptext
@@ -150,11 +152,27 @@
currentView := prevView.
^ true
].
- (#('Shift' #'Shift_L' #'Shift_R') includes:key) ifTrue:[
+ (#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[
+ aView device shiftDown ifTrue:[
+ "/ open a resource-file editor
+ "open a resource file editor on the package's resources"
+
+ aView topView application enqueueDelayedAction:[
+ Tools::InternationalLanguageTranslationEditor
+ openOnPackage:((aView topView application ? aView) class package)
+ ].
+ ].
+
+ "/ reopen showing the key
+ self initiateHelpFor:aView at:(x@y) now:true.
+ ^ true
+ ].
+
+ (#('Shift' #'Shift_L' #'Shift_R' #'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[
"/ do not close on those...
^ false
].
- ].
+ ].
"/ hideHelp nils the currentView
"/ we restore it, so the tooltip is not shown again for this view
@@ -169,6 +187,26 @@
"Modified (format): / 25-12-2011 / 10:25:23 / cg"
"Modified (format): / 16-04-2018 / 16:53:15 / stefan"
+ "Modified: / 20-02-2019 / 12:09:15 / Claus Gittinger"
+!
+
+keyRelease:key x:x y:y view:aView
+ <resource: #keyboard (#Control)>
+
+ currentHelpView notNil ifTrue:[
+ (#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[
+ "/ reopen showing the text
+ self initiateHelpFor:aView at:(x@y) now:true.
+ ^ true
+ ].
+ (#('Shift' #'Shift_L' #'Shift_R' #'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[
+ "/ do not close on those...
+ ^ false
+ ].
+ ].
+ ^ super keyRelease:key x:x y:y view:aView
+
+ "Created: / 20-02-2019 / 11:26:19 / Claus Gittinger"
!
mouseWheelMotion:state x:x y:y amount:amount deltaTime:dTime view:aView