|
Class: RectangleFromUserController
Object
|
+--Controller
|
+--ButtonController
|
+--RectangleFromUserController
- Package:
- stx:libwidg
- Category:
- Interface-Support-Controllers
- Version:
- rev:
1.8
date: 2022/03/08 22:46:45
- user: cg
- file: RectanglefromUserController.st directory: libwidg
- module: stx stc-classLibrary: libwidg
drags a rectangle.
An instance of me can be installed temporarily as controller of any view,
to let the user select a rectangular area from the view.
Use the utility method:
dragRectangleIn:aView thenDo:action
which does exactly that for your (and cares to restore any original controller)
copyrightCOPYRIGHT (c) 2017 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.
utilities
-
dragRectangleIn: aView thenDo: action
-
drag a rectangle in aView
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
pointFromUserIn: aView thenDo: action
-
wait for a single click in aView
-
rectangleFromUserIn: aView thenDo: action
-
drag a rectangle in aView
accessing
-
action: aBlock
-
set the block which will be called when the rectangle drag is finished.
The block will be called with a nil arg, if escape is pressed
-
lastMousePoint
-
-
pointOnly: aBoolean
-
only wait for a single point click; not a rectangle
-
startPoint
-
event handling
-
buttonMotion: buttonState x: x y: y
-
-
buttonPress: button x: x y: y
-
(comment from inherited method)
simulate momentary loss of focus to force accept into models in other components
-
buttonRelease: button x: x y: y
-
(comment from inherited method)
button was released - if enabled, perform releaseaction
-
finishDragging
-
-
keyPress: key x: x y: y
-
actually, this is for the escape key (to abort a drag operation)
Usage example(s):
super keyPress:key x:x y:y.
|
-
keyRelease: key x: x y: y
-
actually, this is for the escape key (to abort a drag operation)
|v c|
v := View new.
c := RectangleFromUserController new.
c action:[:rect | Transcript showCR:rect ].
v openAndWaitUntilVisible.
v controller:c.
|