FlyByHelp.st
changeset 4226 d1dcdcb20574
parent 4220 3cd77e608abb
child 4227 19df2879f53d
equal deleted inserted replaced
4225:280bf6bac009 4226:d1dcdcb20574
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 2001 by eXept Software AG
     4  COPYRIGHT (c) 2001 by eXept Software AG
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
   129 
   131 
   130     "Modified: / 23-12-2011 / 20:37:28 / cg"
   132     "Modified: / 23-12-2011 / 20:37:28 / cg"
   131 !
   133 !
   132 
   134 
   133 keyPress:key x:x y:y view:aView
   135 keyPress:key x:x y:y view:aView
   134     <resource: #keyboard (#Escape)>
   136     <resource: #keyboard (#Escape #Control #Shift)>
   135 
   137 
   136     |prevView|
   138     |prevView|
   137 
   139 
   138     currentHelpView notNil ifTrue:[
   140     currentHelpView notNil ifTrue:[
   139         key == $§ ifTrue:[
   141         key == $§ ifTrue:[
   140             "/ generate a line suitable for the resources file (a null translation)
   142             "/ generate a line suitable for the resources file (a null translation)
   141             "/ into the clipboard; makes it easy to add missing translations to a .rs file,
   143             "/ into the clipboard; makes it easy to add missing translations to a .rs file,
   142             "/ by pressing paragraph whenever you see an untranslated helptext
   144             "/ by pressing paragraph whenever you see an untranslated helptext
   143             aView setClipboardText:(lastHelpText storeString , '    ' , lastHelpText storeString).
   145             aView setClipboardText:(lastHelpText storeString , '    ' , lastHelpText storeString).
   144             self hideHelp.
   146             self hideHelp.
   148             prevView := currentView.
   150             prevView := currentView.
   149             self hideHelp.
   151             self hideHelp.
   150             currentView := prevView.
   152             currentView := prevView.
   151             ^ true
   153             ^ true
   152         ].
   154         ].
   153         (#('Shift' #'Shift_L' #'Shift_R') includes:key) ifTrue:[
   155         (#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[
       
   156             aView device shiftDown ifTrue:[
       
   157                 "/ open a resource-file editor
       
   158                 "open a resource file editor on the package's resources"
       
   159 
       
   160                 aView topView application enqueueDelayedAction:[
       
   161                     Tools::InternationalLanguageTranslationEditor 
       
   162                         openOnPackage:((aView topView application ? aView) class package)
       
   163                 ].    
       
   164             ].    
       
   165             
       
   166             "/ reopen showing the key
       
   167             self initiateHelpFor:aView at:(x@y) now:true.
       
   168             ^ true
       
   169         ].
       
   170         
       
   171         (#('Shift' #'Shift_L' #'Shift_R' #'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[
   154             "/ do not close on those...
   172             "/ do not close on those...
   155             ^ false
   173             ^ false
   156         ].
   174         ].
   157     ].
   175     ].    
   158 
   176 
   159     "/ hideHelp nils the currentView
   177     "/ hideHelp nils the currentView
   160     "/ we restore it, so the tooltip is not shown again for this view
   178     "/ we restore it, so the tooltip is not shown again for this view
   161     "/ until the mouse really leaves the view
   179     "/ until the mouse really leaves the view
   162     "/ let's call this the "do-not-show-in-this-view mode"
   180     "/ let's call this the "do-not-show-in-this-view mode"
   167     ^ false
   185     ^ false
   168     "/ ^ super keyPress:key x:x y:y view:aView
   186     "/ ^ super keyPress:key x:x y:y view:aView
   169 
   187 
   170     "Modified (format): / 25-12-2011 / 10:25:23 / cg"
   188     "Modified (format): / 25-12-2011 / 10:25:23 / cg"
   171     "Modified (format): / 16-04-2018 / 16:53:15 / stefan"
   189     "Modified (format): / 16-04-2018 / 16:53:15 / stefan"
       
   190     "Modified: / 20-02-2019 / 12:09:15 / Claus Gittinger"
       
   191 !
       
   192 
       
   193 keyRelease:key x:x y:y view:aView
       
   194     <resource: #keyboard (#Control)>
       
   195 
       
   196     currentHelpView notNil ifTrue:[
       
   197         (#(#'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[
       
   198             "/ reopen showing the text
       
   199             self initiateHelpFor:aView at:(x@y) now:true.
       
   200             ^ true
       
   201         ].
       
   202         (#('Shift' #'Shift_L' #'Shift_R' #'Control' #'Control_L' #'Control_R') includes:key) ifTrue:[
       
   203             "/ do not close on those...
       
   204             ^ false
       
   205         ].
       
   206     ].
       
   207     ^ super keyRelease:key x:x y:y view:aView
       
   208 
       
   209     "Created: / 20-02-2019 / 11:26:19 / Claus Gittinger"
   172 !
   210 !
   173 
   211 
   174 mouseWheelMotion:state x:x y:y amount:amount deltaTime:dTime view:aView
   212 mouseWheelMotion:state x:x y:y amount:amount deltaTime:dTime view:aView
   175     currentHelpView notNil ifTrue:[
   213     currentHelpView notNil ifTrue:[
   176         self handleMouseIn:aView x:x y:y.
   214         self handleMouseIn:aView x:x y:y.