#UI_ENHANCEMENT
authorClaus Gittinger <cg@exept.de>
Fri, 15 Jan 2016 04:14:17 +0100
changeset 4883 6f06b55d32b0
parent 4882 51391729251d
child 4884 6b936b2f4a5c
child 4929 4d15a7e35554
#UI_ENHANCEMENT class: MenuPanel class definition added: #flyByHelpSpecProvider: changed: #flyByHelpSpec #flyByHelpTextForKey: + pluggable flybyhelp provider
MenuPanel.st
--- a/MenuPanel.st	Tue Dec 22 04:41:52 2015 +0000
+++ b/MenuPanel.st	Fri Jan 15 04:14:17 2016 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1997 by eXept Software AG
 	      All Rights Reserved
@@ -29,7 +27,8 @@
 		lastItem hasPerformed focusComesByTab lastDrawnScrollerNextBounds
 		buttonActiveBackgroundColor buttonEnteredBackgroundColor
 		buttonPassiveBackgroundColor maxExtent sizeFixed extraMargin
-		buttonActiveLevel buttonPassiveLevel buttonEnteredLevel'
+		buttonActiveLevel buttonPassiveLevel buttonEnteredLevel
+		pluggableHelpSpecProvider'
 	classVariableNames:'InitialSelectionQuerySignal Images LigthenedImages
 		DefaultForegroundColor DefaultBackgroundColor IconIndicationOn
 		IconIndicationOff IconRadioOn IconRadioOff
@@ -4481,7 +4480,16 @@
 flyByHelpSpec
     "allows subclasses to provide texts"
 
-    ^ IdentityDictionary new
+    pluggableHelpSpecProvider notNil ifTrue:[
+        ^ pluggableHelpSpecProvider flyByHelpSpec.
+    ].    
+    ^ nil
+!
+
+flyByHelpSpecProvider:aSpecProvider
+    "pluggable helpspec provider"
+
+    pluggableHelpSpecProvider := aSpecProvider
 !
 
 flyByHelpTextAt:aPoint
@@ -4508,14 +4516,16 @@
 !
 
 flyByHelpTextForKey:aKey
-    |app text|
+    |app text spec|
 
     app := self application.
     app notNil ifTrue:[
-	text := self application flyByHelpTextForKey:aKey.
-	text notNil ifTrue:[^ text].
-    ].
-    ^ self flyByHelpSpec at:aKey ifAbsent:nil
+        text := app flyByHelpTextForKey:aKey.
+        text notNil ifTrue:[^ text].
+    ].
+    spec := self flyByHelpSpec.
+    spec isNil ifTrue:[^ nil].
+    ^ spec at:aKey ifAbsent:nil
 !
 
 helpText