|
Class: FlyByHelp
Object
|
+--EventListener
|
+--ActiveHelp
|
+--FlyByHelp
- Package:
- stx:libview2
- Category:
- Interface-Help
- Version:
- rev:
1.156
date: 2024/04/09 12:17:34
- 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 is 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 tool 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.
Additional features:
if you press CTRL, the helpKey which was responsible for the helptext
is shown instead of the full text. This helps to find out which text to modify
in case of typing errors or missing translations.
if you press LEFTSHIFT+RIGHTSHIFT+CTRL (in that order), a menu developper menu appears,
but only if Smalltalk is in the debeloper mode (i.e. not in end-user applications).
copyrightCOPYRIGHT (c) 2001 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
accessing
-
currentlyShownView
-
-
flyByHelpTimeoutMillis
-
abort tooltip text generation if the text could not be generated
within this time (generation took too long).
-
flyByHelpTimeoutMillis: nMillis
-
abort tooltip text generation if the text could not be generated
within this time (generation took too long).
-
helpKeyInsteadOfHelpTextQuery
-
-
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
developer menu
-
openDeveloperMenuFor: aView at: aPoint
-
with CTRL+SHIFT, this menu appears
event handling
-
buttonMotion: buttonAndModifierState x: x y: y view: aView
-
DebuggingEvents := true
-
buttonPress: button x: x y: y view: aView
-
DebuggingEvents := true
-
keyPress: key x: x y: y view: aView
-
care for the special keys:
Ctrl (while help is shown)
L-Shift+R-Shift+Ctrl (while nothing is shown)
Usage example(s):
^ super keyPress:key x:x y:y view:aView
|
-
keyRelease: key x: x y: y view: aView
-
DebuggingEvents := true
-
mouseWheelMotion: state x: x y: y amount: amount deltaTime: dTime view: aView
-
DebuggingEvents := true
-
pointerLeave: state view: aView
-
DebuggingEvents := true
help texts
-
helpTextFromModel: aModel view: aView at: aPointOrNil
-
helper: ask aModel for its helpText.
-
helpTextFromView: aView at: aPointOrNil
-
helper: ask aView for its helpText.
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
-
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)
-
showHelp: aHelpText for: view
-
show the help text for aView
-
stopHelpDisplayProcess
-
Timestamp now infoPrint. ' stop' infoPrintCR.
HelpKeyInsteadOfHelpTextQuery
UserPreferences current toolTipShapeStyle:nil
UserPreferences current toolTipShapeStyle:#cartoon
FlyByHelp isActive
FlyByHelp stop
FlyByHelp start
|