FlyByWindowInformation.st
changeset 3583 8eb5579befae
parent 3576 e62c95ddd17b
child 3673 b7e9a220c733
equal deleted inserted replaced
3582:5606394265f9 3583:8eb5579befae
    12 "{ Package: 'stx:libtool2' }"
    12 "{ Package: 'stx:libtool2' }"
    13 
    13 
    14 "{ NameSpace: Smalltalk }"
    14 "{ NameSpace: Smalltalk }"
    15 
    15 
    16 FlyByHelp subclass:#FlyByWindowInformation
    16 FlyByHelp subclass:#FlyByWindowInformation
    17 	instanceVariableNames:'lastApplication lastView cleanupAction finishSemaphore finished'
    17 	instanceVariableNames:'lastApplication lastView cleanupAction finishSemaphore finished
       
    18 		toBrowseAction'
    18 	classVariableNames:''
    19 	classVariableNames:''
    19 	poolDictionaries:''
    20 	poolDictionaries:''
    20 	category:'Interface-Help'
    21 	category:'Interface-Help'
    21 !
    22 !
    22 
    23 
   157         lcKey == $w ifTrue:[
   158         lcKey == $w ifTrue:[
   158             lastView notNil ifTrue:[
   159             lastView notNil ifTrue:[
   159                 obj := lastView topView
   160                 obj := lastView topView
   160             ]
   161             ]
   161         ].
   162         ].
       
   163         lcKey == $u ifTrue:[
       
   164             toBrowseAction notNil ifTrue:[
       
   165                 toBrowseAction value:(SystemBrowser default)
       
   166             ].    
       
   167         ].
       
   168         
   162         obj notNil ifTrue:[
   169         obj notNil ifTrue:[
   163             key isLowercase ifTrue:[
   170             key isLowercase ifTrue:[
   164                 objToInspect := obj
   171                 objToInspect := obj
   165             ] ifFalse:[
   172             ] ifFalse:[
   166                 objToBrowse := obj
   173                 objToBrowse := obj
   176     ].
   183     ].
   177 
   184 
   178     ^ true
   185     ^ true
   179 
   186 
   180     "Modified: / 12-11-2010 / 11:51:04 / cg"
   187     "Modified: / 12-11-2010 / 11:51:04 / cg"
       
   188     "Modified: / 01-08-2018 / 07:42:15 / Claus Gittinger"
   181 ! !
   189 ! !
   182 
   190 
   183 !FlyByWindowInformation methodsFor:'help texts'!
   191 !FlyByWindowInformation methodsFor:'help texts'!
   184 
   192 
   185 helpTextFor:aView at:aPointOrNil
   193 helpTextFor:aView at:aPointOrNil
   195     ^ Text streamContents:[:s |
   203     ^ Text streamContents:[:s |
   196         |topViewToInspect applicationToInspect 
   204         |topViewToInspect applicationToInspect 
   197          masterApplicationToInspect topApplicationToInspect modelToInspect
   205          masterApplicationToInspect topApplicationToInspect modelToInspect
   198          genComponentNameForApplication windowGroupToInspect|
   206          genComponentNameForApplication windowGroupToInspect|
   199 
   207 
       
   208         toBrowseAction := nil. 
   200         genComponentNameForApplication := 
   209         genComponentNameForApplication := 
   201             [:app :s |
   210             [:app :s |
   202                 (app notNil 
   211                 (app notNil 
   203                 and:[ app builder notNil ]) ifTrue:[
   212                 and:[ app builder notNil ]) ifTrue:[
   204                     |components v|
   213                     |components v|
   276                     (helpKey := item activeHelpKey) notNil ifTrue:[
   285                     (helpKey := item activeHelpKey) notNil ifTrue:[
   277                         s nextPutLine:(resources string:'HelpKey: %1' with:helpKey allBold).
   286                         s nextPutLine:(resources string:'HelpKey: %1' with:helpKey allBold).
   278                     ].
   287                     ].
   279                     (itemValue := item itemValue) isSymbol ifTrue:[
   288                     (itemValue := item itemValue) isSymbol ifTrue:[
   280                         s nextPutLine:(resources string:'Action: %1' with:itemValue allBold).
   289                         s nextPutLine:(resources string:'Action: %1' with:itemValue allBold).
       
   290                         (applicationToInspect class implements:itemValue) ifTrue:[
       
   291                             toBrowseAction := [:b | b browseClass:applicationToInspect class selector:itemValue].
       
   292                         ] ifFalse:[    
       
   293                             toBrowseAction := [:b | b browseImplementorsOf:itemValue].
       
   294                         ]
   281                     ] ifFalse:[    
   295                     ] ifFalse:[    
   282                         itemValue isBlock ifTrue:[
   296                         itemValue isBlock ifTrue:[
   283                             s nextPutLine:(resources string:'Action: %1' with:itemValue printString).
   297                             s nextPutLine:(resources string:'Action: %1' with:itemValue printString).
   284                         ]    
   298                         ]    
   285                     ].
   299                     ].
   294         ].
   308         ].
   295         
   309         
   296         s cr.
   310         s cr.
   297         s nextPutLine:'Press:'.
   311         s nextPutLine:'Press:'.
   298 
   312 
   299         "/ use smalltalk at, to avoid dependency on libTool
   313         "/ use Smalltalk-at, to avoid dependency on libTool
   300         (Smalltalk at:#'Tools::ViewTreeInspectorApplication') notNil ifTrue:[
   314         (Smalltalk at:#'Tools::ViewTreeInspectorApplication') notNil ifTrue:[
   301             s nextPutLine:'    ? to show the view''s tree'.
   315             s nextPutLine:'    ? to show the view''s tree'.
   302         ].
   316         ].        
   303         applicationToInspect notNil ifTrue:[
   317         applicationToInspect notNil ifTrue:[
   304             s nextPutLine:'    a to inspect application (A to browse)'.
   318             s nextPutLine:'    a to inspect application (A to browse)'.
   305             masterApplicationToInspect notNil ifTrue:[
   319             masterApplicationToInspect notNil ifTrue:[
   306                 s nextPutLine:'    m to inspect masterApplication (M to browse)'.
   320                 s nextPutLine:'    m to inspect masterApplication (M to browse)'.
   307                 topApplicationToInspect notNil ifTrue:[
   321                 topApplicationToInspect notNil ifTrue:[
   318             s nextPutLine:'    g to inspect windowGroup'.
   332             s nextPutLine:'    g to inspect windowGroup'.
   319         ].
   333         ].
   320         modelToInspect notNil ifTrue:[
   334         modelToInspect notNil ifTrue:[
   321             s nextPutLine:'    o to inspect model (O to browse)'.
   335             s nextPutLine:'    o to inspect model (O to browse)'.
   322         ].
   336         ].
       
   337         toBrowseAction notNil ifTrue:[
       
   338             s nextPutLine:'    u to browse the called user action'.
       
   339         ].    
   323         s cr.
   340         s cr.
   324         s nextPutLine:'RETURN to browse application.'.
   341         s nextPutLine:'RETURN to browse application.'.
   325         s nextPutAll:'ESC or click to leave flyBy-info mode.'.
   342         s nextPutAll:'ESC or click to leave flyBy-info mode.'.
   326     ]
   343     ]
   327 
   344 
   328     "
   345     "
   329      self shownInformationOfViewUnderMouseUntilButtonIsPressed
   346      self shownInformationOfViewUnderMouseUntilButtonIsPressed
   330     "
   347     "
   331 
   348 
   332     "Modified: / 12-11-2010 / 11:54:59 / cg"
   349     "Modified: / 12-11-2010 / 11:54:59 / cg"
   333     "Modified: / 23-07-2018 / 09:18:44 / Claus Gittinger"
   350     "Modified: / 01-08-2018 / 07:43:22 / Claus Gittinger"
   334 ! !
   351 ! !
   335 
   352 
   336 !FlyByWindowInformation methodsFor:'private'!
   353 !FlyByWindowInformation methodsFor:'private'!
   337 
   354 
   338 activeHelpViewForApplication:applicationOrNil text:helpText onDevice:aDevice
   355 activeHelpViewForApplication:applicationOrNil text:helpText onDevice:aDevice