eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'PointFromUserController':

Home

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

Class: PointFromUserController


Inheritance:

   Object
   |
   +--Controller
      |
      +--ButtonController
         |
         +--PointFromUserController

Package:
stx:libwidg
Category:
Interface-Support-Controllers
Version:
rev: 1.4 date: 2022/03/08 22:47:51
user: cg
file: PointFromUserController.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)    


copyright

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

Class protocol:

utilities
o  pointFromUserIn: aView thenDo: action
wait for a button press in aView


Instance protocol:

accessing
o  action: aBlock
set the block which will be called when the point has been picked.
The block will be called with a nil arg, if escape is pressed

o  pressPoint

event handling
o  buttonPress: button x: x y: y
(comment from inherited method)
simulate momentary loss of focus to force accept into models in other components

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 openAndWaitUntilVisible.
c := PointFromuserController new.
c action:[:point | Transcript showCR:point ].
v openAndWait.

v controller:c.


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