eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'RectangleFromUserController':

Home

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

Class: RectangleFromUserController


Inheritance:

   Object
   |
   +--Controller
      |
      +--ButtonController
         |
         +--RectangleFromUserController

Package:
stx:libwidg
Category:
Interface-Support-Controllers
Version:
rev: 1.3 date: 2017/04/10 06:41:37
user: cg
file: RectanglefromUserController.st directory: libwidg
module: stx stc-classLibrary: libwidg

Description:


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)    



Class protocol:

utilities
o  dragRectangleIn: aView thenDo: action
drag a rectangle in aView

o  rectangleFromUserIn: aView thenDo: action
drag a rectangle in aView


Instance protocol:

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

o  lastMousePoint

o  startPoint

event handling
o  buttonMotion: buttonState x: x y: y

o  buttonPress: button x: x y: y

o  buttonRelease: button x: x y: y
(comment from inherited method)
button was released - if enabled, perform releaseaction

o  keyPress: key x: x y: y
actually, this is for the escape key (to abort a drag operation)


Examples:


|v c| v := View new openAndWait. c := RectangleFromUserController new. c action:[:rect | Transcript showCR:rect ]. v openAndWait. v controller:c.

ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 29 Mar 2024 07:41:42 GMT