# HG changeset patch # User Claus Gittinger # Date 1289559369 -3600 # Node ID 34ec9ea82209c5685915e1e521a8f619fb4594d3 # Parent cd54d69eec13a9d88bff8f4a810abacb4d77df6e changed: #helpTextFor:at: #keyPress:x:y:view: better user experience diff -r cd54d69eec13 -r 34ec9ea82209 FlyByWindowInformation.st --- a/FlyByWindowInformation.st Fri Nov 12 11:39:53 2010 +0100 +++ b/FlyByWindowInformation.st Fri Nov 12 11:56:09 2010 +0100 @@ -114,16 +114,27 @@ obj := lastApplication ]. lcKey == $o ifTrue:[ - obj := lastView model + lastView notNil ifTrue:[ + obj := lastView model + ]. ]. lcKey == $m ifTrue:[ - obj := lastApplication masterApplication + lastApplication notNil ifTrue:[ + obj := lastApplication masterApplication + ] + ]. + lcKey == $t ifTrue:[ + lastApplication notNil ifTrue:[ + obj := lastApplication topApplication + ]. ]. lcKey == $v ifTrue:[ obj := lastView ]. - lcKey == $t ifTrue:[ - obj := lastView topView + lcKey == $w ifTrue:[ + lastView notNil ifTrue:[ + obj := lastView topView + ] ]. obj notNil ifTrue:[ key isLowercase ifTrue:[ @@ -143,7 +154,7 @@ ^ true - "Modified: / 12-11-2010 / 11:38:23 / cg" + "Modified: / 12-11-2010 / 11:51:04 / cg" ! ! !FlyByWindowInformation methodsFor:'help texts'! @@ -151,14 +162,20 @@ helpTextFor:aView at:aPointOrNil "generate the text to be shown as popup-flyby info" + |resources| + lastView := aView. lastApplication := aView application. - ^ String streamContents:[:s | - |topViewToInspect applicationToInspect masterApplicationToInspect modelToInspect + resources := self class classResources. + + ^ Text streamContents:[:s | + |topViewToInspect applicationToInspect + masterApplicationToInspect topApplicationToInspect modelToInspect genComponentNameForApplication| - genComponentNameForApplication := [:app :s | + genComponentNameForApplication := + [:app :s | (app notNil and:[ app builder notNil ]) ifTrue:[ |components v| @@ -176,9 +193,9 @@ k := components keyAtValue:v. v == aView ifTrue:[ - s nextPutLine:(' Component: ' , k). + s nextPutLine:(' component: ' , k). ] ifFalse:[ - s nextPutLine:(' Subview of Component: ' , k). + s nextPutLine:(' subview of component: ' , k). ]. ]. ]. @@ -190,9 +207,16 @@ lastApplication notNil ifTrue:[ applicationToInspect := lastApplication. masterApplicationToInspect := lastApplication masterApplication. - masterApplicationToInspect == applicationToInspect ifTrue:[ - masterApplicationToInspect := nil - ]. + masterApplicationToInspect notNil ifTrue:[ + masterApplicationToInspect == applicationToInspect ifTrue:[ + masterApplicationToInspect := nil + ] ifFalse:[ + topApplicationToInspect := masterApplicationToInspect topApplication. + topApplicationToInspect == masterApplicationToInspect ifTrue:[ + topApplicationToInspect := nil + ] + ]. + ] ]. aView model notNil ifTrue:[ modelToInspect := aView model. @@ -202,23 +226,25 @@ ]. ]. - s nextPutLine:('View: ' , aView class name, ' "',aView name printString,'"'). - modelToInspect notNil ifTrue:[ - s nextPutLine:('Model: ' , modelToInspect class name). - ]. - topViewToInspect notNil ifTrue:[ - s nextPutLine:('Topview: ' , topViewToInspect class name). + applicationToInspect notNil ifTrue:[ + s nextPutLine:(resources string:'Application: %1' with:applicationToInspect class name allBold). + genComponentNameForApplication value:applicationToInspect value:s. ]. masterApplicationToInspect notNil ifTrue:[ - s nextPutLine:('Masterapplication: ' , masterApplicationToInspect class name). - genComponentNameForApplication value:masterApplicationToInspect value:s. + s nextPutLine:(resources string:'Master-Application: %1' with:masterApplicationToInspect class name allBold). + "/ genComponentNameForApplication value:masterApplicationToInspect value:s. + ]. + topApplicationToInspect notNil ifTrue:[ + s nextPutLine:(resources string:'Top-Application: %1' with:topApplicationToInspect class name allBold). + "/ genComponentNameForApplication value:topApplicationToInspect value:s. ]. - applicationToInspect notNil ifTrue:[ - s nextPutLine:('Application: ' , applicationToInspect class name). - genComponentNameForApplication value:applicationToInspect value:s. + s nextPutLine:(resources string:'View: %1 "%2"' with:aView class name allBold with:aView name). + topViewToInspect notNil ifTrue:[ + s nextPutLine:(resources string:'Topview: %1' with:topViewToInspect class name allBold). ]. - - "/ identity it as component + modelToInspect notNil ifTrue:[ + s nextPutLine:(resources string:'Model: %1' with:modelToInspect class name allBold). + ]. s cr. s nextPutLine:'Press:'. @@ -227,11 +253,14 @@ s nextPutLine:' a to inspect application (A to browse)'. masterApplicationToInspect notNil ifTrue:[ s nextPutLine:' m to inspect masterApplication (M to browse)'. + topApplicationToInspect notNil ifTrue:[ + s nextPutLine:' t to inspect masterApplication (T to browse)'. + ] ]. ]. s nextPutLine:' v to inspect view (V to browse)'. topViewToInspect notNil ifTrue:[ - s nextPutLine:' t to inspect topView (T to browse)'. + s nextPutLine:' w to inspect topWindow (W to browse)'. ]. modelToInspect notNil ifTrue:[ s nextPutLine:' o to inspect model (O to browse)'. @@ -245,7 +274,7 @@ self shownInformationOfViewUnderMouseUntilButtonIsPressed " - "Modified: / 12-11-2010 / 11:39:34 / cg" + "Modified: / 12-11-2010 / 11:54:59 / cg" ! ! !FlyByWindowInformation methodsFor:'private'!