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.156 date: 2024/04/09 12:17:34
user: stefan
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).

copyright

COPYRIGHT (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.

Class protocol:

accessing
o  currentlyShownView

o  flyByHelpTimeoutMillis
abort tooltip text generation if the text could not be generated
within this time (generation took too long).

o  flyByHelpTimeoutMillis: nMillis
abort tooltip text generation if the text could not be generated
within this time (generation took too long).

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
Timestamp now infoPrint. ' stop' infoPrintCR.


Private classes:

    HelpKeyInsteadOfHelpTextQuery

Examples:


UserPreferences current toolTipShapeStyle:nil
UserPreferences current toolTipShapeStyle:#cartoon

 FlyByHelp isActive

 FlyByHelp stop
 FlyByHelp start


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 15:12:32 GMT