eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'FlyByHelp':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: FlyByHelp


Inheritance:

   Object
   |
   +--EventListener
      |
      +--ActiveHelp
         |
         +--FlyByHelp

Package:
stx:libview2
Category:
Interface-Help
Version:
rev: 1.113 date: 2019/08/01 12:23:28
user: cg
file: FlyByHelp.st directory: libview2
module: stx stc-classLibrary: libview2

Description:


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).


Class protocol:

accessing
o  currentlyShownView

o  helpKeyInsteadOfHelpTextQuery

o  maxNumberOfColumns

o  maxNumberOfLines


Instance protocol:

defaults
o  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
o  openDeveloperMenuFor: aView at: aPoint
with CTRL+SHIFT, this menu appears

event handling
o  buttonMotion: buttonAndModifierState x: x y: y view: aView
DebuggingEvents := true

o  buttonPress: button x: x y: y view: aView
DebuggingEvents := true

o  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

o  keyRelease: key x: x y: y view: aView
DebuggingEvents := true

o  mouseWheelMotion: state x: x y: y amount: amount deltaTime: dTime view: aView
DebuggingEvents := true

o  pointerLeave: state view: aView
DebuggingEvents := true

help texts
o  helpTextFromModel: aModel view: aView at: aPointOrNil
helper: ask aModel for its helpText.

o  helpTextFromView: aView at: aPointOrNil
helper: ask aView for its helpText.

queries
o  currentlyShownView

o  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
o  activeHelpViewForApplication: applicationOrNil text: helpText onDevice: aDevice
(ActiveHelpView for:'Hello' onDevice:Display) open

o  hideHelp
hide the help text

o  hideIfPointerLeft: aView
hide help, if the pointer is not in aView

o  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)

o  showHelp: aHelpText for: view
show the help text for aView

o  stopHelpDisplayProcess


Private classes:

    HelpKeyInsteadOfHelpTextQuery

Examples:


UserPreferences current toolTipShapeStyle:nil UserPreferences current toolTipShapeStyle:#cartoon FlyByHelp isActive FlyByHelp stop FlyByHelp start

ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 02 Dec 2021 03:58:39 GMT