VW 2.5 Rubberbanding, howto? 
Author Message
 VW 2.5 Rubberbanding, howto?

I want to develop an application with VW 2.5 where the user can stretch the
size of an object on a canvas.

Any clearly documented code samples or other references would be appreciated.

Thanks.



Thu, 07 Jan 1999 03:00:00 GMT  
 VW 2.5 Rubberbanding, howto?

Quote:

> I want to develop an application with VW 2.5 where the user can stretch the
> size of an object on a canvas.

> Any clearly documented code samples or other references would be appreciated.

Mike if you look at Rectangle class>>fromUser I think you will
find an example. This code provides the dragging rectangle used
by many VW tools. Also see fromUser: and fromUser:phase:  These
methods end up over in the Screen class where you might have
finer control to perform your wishes. But over here in Rectangle
it worries about the cursor look/feel and give you back a
rectangle at the end when the user is done with his mouse
buttons.

You need to choose between stretching a rectangle representing
your object in realtime or the object itself. With the right
hardware/software you can of course stretch objects in realtime.
But I think on a normal PC you'll need to stick to rectanagles
to avoid agressive flicker...

--
John M McIntosh
1-800-477-2659
VisualWorks/VisualAge Corporate Smalltalk Consulting



Thu, 07 Jan 1999 03:00:00 GMT  
 VW 2.5 Rubberbanding, howto?

Quote:

> I want to develop an application with VW 2.5 where the user can stretch the
> size of an object on a canvas.

> Any clearly documented code samples or other references would be appreciated.

There are basically two ways to do that. It depends on the hardware platform
supposed to run your image.

Fist look at the methods in the protocol "user interaction" in class Screen.
I think
"dragShape:lineWidth:offset:gridPhase:gridSpacing:boundedBy:whileButton:isDown:" is exactly what you are looking for.

Be advised that the methods visual behaviour is slightly different on PCs
vs. Workstations.

The stated messages are implemented using an XOR-technique directly on the
screen buffer. This makes them especially fast while not using lots of CPU
power (applying an XOR twice restores the original value, so the application
or others do not have to repair damages). However, there is one problem with
these messages: their usability depends on the currently displayed screen
colors or screen palette respectively. This is because an XOR will lead to
some (relatively arbitratry pixel value according to the currently active
screen palette) color value which might not be visible enough.

A better approach is to display lines explicitly and remove them by
invalidating the corresponding sections on the screen. Using the standard
VisualWorks repertoire, it is not possible to invalidate screen sections of
other applications. So this might be problem in your context besides the
CPU power used to handle this fluently.

--
Thilo Schmid
KHK Software
Frankfurt, Germany



Fri, 08 Jan 1999 03:00:00 GMT  
 VW 2.5 Rubberbanding, howto?

Hi Mike,

You can subclass the UIPainter (the canvas builder)
I have done it and it works fine.

Eli.

Quote:

---------------Original Message---------------

I want to develop an application with VW 2.5 where the user can stretch the
size of an object on a canvas.

Any clearly documented code samples or other references would be appreciated.

Thanks.

----------End of Original Message----------

-------------------------------------
Name: Eli Hodos
SPL WorldGroup (Israel) LTD
Phone: 972-3-5388314
Fax:   972-3-5335511

Date: 07/23/96
Time: 10:22:02

This message was sent by Chameleon
-------------------------------------



Sat, 09 Jan 1999 03:00:00 GMT  
 VW 2.5 Rubberbanding, howto?


writes:

Quote:
>Subject: VW 2.5 {*filter*}banding, howto?

>Date: Sun, 21 Jul 1996 15:47:05 UNDEFINED
>>I want to develop an application with VW 2.5 where the user can stretch the
>size of an object on a canvas.

>Any clearly documented code samples or other references would be appreciated.

mike

i can recommend you to read:

the smalltalk developer's guide to visualworks
tim howard
isbn 013442526x

"a controller method that allows the user to dynamically draw a line on
the controller's view"

getLineFromUser

        |line initialPoint|
        initialPoint := self sensor cursorPoint.
        line := Array with: initialPoint with: initialPoint.
        Cursor crossHair showWhile: [[self sensor redButtonPressed]
                whileTrue: [
                        Screen default
                                displayShape: line
                                at: self sensor globalOrigin
                                forMilliseconds: 50.
                        self viewHasCursor
                                ifTrue: [line at: 2 put: self sensor
cursorPoint]
                                ifFalse: [nil]]]




Mon, 11 Jan 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Help: VW Smalltalk 2.5

2. VW 2.5 startup screen HELP

3. Stone Age text editing in VW 2.5

4. Sound in VW 2.5

5. VWave 1.0 (VW 2.5 may apply)

6. VW 2.5 MultiRow Select Table Widget Needed

7. VW 2.5 menuBar hide, show

8. VW 2.5 automated testing tools

9. Sound in VW 2.5

10. PC Serial Port from VW 2.5

11. HELP: VW 2.5 Mac -> WinNT Port

12. VW 2.5 on MAC

 

 
Powered by phpBB® Forum Software