--- a/FlyByHelp.st Fri Jan 17 20:34:56 2020 +0100
+++ b/FlyByHelp.st Sat Jan 18 15:37:06 2020 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 2001 by eXept Software AG
All Rights Reserved
@@ -147,7 +145,10 @@
pushAction:
"/ app enqueueDelayedAction:
[
- |editor m canDefineTranslationForLabel canDefineTranslationForHelpText menuItem i viewsApp|
+ |editor m canDefineTranslationForLabel canDefineTranslationForHelpText
+ pointInMenu menuItem i viewsApp classBrowser|
+
+ classBrowser := SystemBrowser default.
viewsApp := aView application. "/ could be different from top-app (if embedded)
@@ -162,12 +163,21 @@
label:(((aView fullXPath ? 'unnamed') contractTo:120) allGray)).
aView isMenu ifTrue:[
- menuItem := aView itemAtPoint:aPoint.
+ Transcript showCR:'view %1 @ %2' with:aView with:aPoint.
+ menuItem := aView grabMenuItemAtPoint:aPoint.
menuItem notNil ifTrue:[
m addItem:(MenuItem
label:(('MenuItem''s NameKey: ',(menuItem nameKey printString)) allGray)).
m addItem:(MenuItem
label:(('MenuItem''s Value: ',(menuItem itemValue printString contractTo:40)) allGray)).
+ (app notNil
+ and:[menuItem itemValue isSymbol
+ and:[app respondsTo:menuItem itemValue]]
+ ) ifTrue:[
+ m addItem:(MenuItem
+ label:('Browse MenuItem''s Action')
+ itemValue:[ classBrowser openInClass:app class theNonMetaclass selector:menuItem itemValue]).
+ ].
].
].
@@ -237,12 +247,12 @@
m addSeparator.
m addItem:(i := MenuItem
label:('Browse Application (%1)' bindWith:(viewsApp ? app) className)
- itemValue:[ SystemBrowser default openInClass:(viewsApp ? app) class]).
+ itemValue:[ classBrowser openInClass:(viewsApp ? app) class]).
i enabled:((viewsApp ? app) notNil).
m addItem:(i := MenuItem
label: 'Browse Application''s helpSpec'
- itemValue:[ SystemBrowser default openInClass:(viewsApp ? app) class theMetaclass selector:#helpSpec]).
+ itemValue:[ classBrowser openInClass:(viewsApp ? app) class theMetaclass selector:#helpSpec]).
i enabled:((viewsApp ? app) notNil and:[(viewsApp ? app) class theMetaclass includesSelector:#helpSpec]).
m addItem:(i := MenuItem
@@ -254,7 +264,7 @@
m addSeparator.
m addItem:(MenuItem
label:('Browse Top Application (%1)' bindWith:app className)
- itemValue:[ SystemBrowser default openInClass:app class]).
+ itemValue:[ classBrowser openInClass:app class]).
m addItem:(MenuItem
label: 'UI Painter on Top Application'
@@ -427,7 +437,7 @@
currentView := prevView.
^ false
].
- 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