|
Class: FlyByHelp
Object
|
+--EventListener
|
+--ActiveHelp
|
+--FlyByHelp
- Package:
- stx:libview2
- Category:
- Interface-Help
- Version:
- rev:
1.85
date: 2018/04/16 15:31:54
- user: stefan
- file: FlyByHelp.st directory: libview2
- module: stx stc-classLibrary: libview2
an instance of me is used to provide tooltips
(sigh: smalltalk was ahead of its time in the early 90's:
initially called 'activeHelp', then renamed to 'flyByHelp'
and now commonly known as tooltip).
I will watch the mouse movements via an event hook, and determine
where the mouse pointer is. Then ask the underlying view about its
helpText and display it in a little floating popup view.
The hool is installed via:
FlyByHelp start
and possibly deactivated/uninstalled via:
FlyByHelp stop
There can be only one FlyByHelp at any time - the start/stop methods
assure that.
accessing
-
currentlyShownView
-
-
maxNumberOfColumns
-
-
maxNumberOfLines
-
defaults
-
flyByHelpTimeoutMillis
-
abort flyby help text generation, if no text can be generated within that
time delta. This is used to abort long-lasting parsing/scanning/analysis in
large methods when the mouse is moved over some syntactic constructs, and
it takes too long to parse...
The returned time is given in ms
event handling
-
buttonMotion: buttonAndModifierState x: x y: y view: aView
-
the help-bubble itself
-
buttonPress: button x: x y: y view: aView
-
hideHelp nils the currentView
-
keyPress: key x: x y: y view: aView
-
generate a line suitable for the resources file (a null translation)
usage example(s):
^ super keyPress:key x:x y:y view:aView
|
-
mouseWheelMotion: state x: x y: y amount: amount deltaTime: dTime view: aView
-
-
pointerLeave: state view: aView
-
clear the do-not-show-in-this-view mode (see keyPress)
help texts
-
helpTextFromModel: aModel view: aView at: aPointOrNil
-
helper: ask aModel for its helpText.
-
helpTextFromView: aView at: aPointOrNil
-
helper: ask aView for its helpText.
private
-
hideIfPointerLeft: aView
-
hide help, if the pointer is not in aView
-
initiateHelpFor: aView at: aPointOrNil now: showItNow
-
ask aView for helpText, passing x/y coordinates;
start a timeout process to display this helpText after some delay;
Normally used internally, but can also be used by widgets to force
re-negotiation of the displayed helpText
(for example in a menu, when the selection changes)
queries
-
currentlyShownView
-
-
toolTipFollowsMouse
-
if true, the tooltip-window moves with the pointer
so that it stays away from (does not cover) the mouse pointer
show & hide help
-
activeHelpViewForApplication: applicationOrNil text: helpText onDevice: aDevice
-
(ActiveHelpView for:'Hello' onDevice:Display) open
-
hideHelp
-
hide the help text
-
showHelp: aHelpText for: view
-
show the help text for aView
-
stopHelpDisplayProcess
-
UserPreferences current toolTipShapeStyle:nil
UserPreferences current toolTipShapeStyle:#cartoon
FlyByHelp isActive
FlyByHelp stop
FlyByHelp start
|