programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: Size/Move frame

From: Charles Melice <mail_at_forthcad.com>
Date: Wed, 8 Jan 2003 10:26:25 +0100

Glenn,

If you use only the four corners and sides, you can
consider the next method I use to code the cursor position:

: rect.PtCode ( x y rect -- code ) \ 4
>R \ 1[0]2
    DUP R@ rect.Top @ < \ 8
    IF DROP 4
    ELSE R@ rect.Bottom @ >
         IF 8 ELSE 0 THEN
    THEN
    SWAP DUP R@ rect.Left @ <
    IF DROP 1
    ELSE R@ rect.Right @ >
         IF 2 ELSE 0 THEN
    THEN OR
    R> DROP ;

If the cursor(x,y) is above the rectangle, bit 4 of code = 4.
If the cursor(x,y) is also at the right of the rectangle,
bit 2 of code = 2. Then code=4+2=6 = C1.

Now, if you inflate the rectangle with the knot size, you
will have a second code value = C2.

What we can say is :

if
    C1 OR C2 = 0 -> inside: move object.
    C1 AND C2 <> 0 -> ouside: do nothing

    (C1 <> 0) -> outside internal rectangle
    AND (C2 = 0) BUT inside external rectangle.

Charles

----- Original Message -----
From: "Glenn Dixon" <dixong_at_networld.com>
To: <sftalk_at_forth.com>
Sent: Tuesday, January 07, 2003 9:31 PM
Subject: [sftalk] Re: Size/Move frame

> Thank you, Charles. I had forgotten about that file.
>
> Is this really the way others do this? That is, moving and sizing the
> window, changing the cursor shape, etc. 'manually'? I thought this
> would be some sort of a control...
>
> Glenn
>
>
> -----Original Message-----
> From: "Charles Melice" <mail_at_forthcad.com>
> To: <sftalk_at_forth.com>
> Date: Sun, 5 Jan 2003 11:37:41 +0100
> Subject: [sftalk] Re: Size/Move frame
>
> >
> > Hello Glenn,
> >
> > I don't know the official name, but Rick named it "Selection knobs"
> > and give an example in the SwiftForth FAQ and Tutorials : Tools and
> > utilities : Snippets : Selection knobs.
> >
> > http://www.forth.com/cgi-bin/swiftforth?auth=ck81ecb89e617f&file=11
> >
> > Regards,
> > Charles
> >
> >
> > ----- Original Message -----
> > From: "Glenn Dixon" <dixong_at_networld.com>
> > To: <sftalk_at_forth.com>
> > Sent: Friday, January 03, 2003 11:11 PM
> > Subject: [sftalk] Size/Move frame
> >
> >
> > > Hello all,
> > >
> > > Can anyone tell me the name, or better yet give a reference for
> > > implementing the size/move frame that you can get around text
> > windows,
> > > plots, bitmaps, and other objects in Word, Excel, etc.?
> > >
> > > I don't know their official name, but they are the eight tiny black
> > > boxes that appear at each corner and edge of an object when you
> > click
> > > on it. Moving your mouse over the boxes makes the mouse arrow turn
> > to
> > > sizing or moving cursors. I suspect they are something in
> > foundation
> > > classes, but may (also) be a common control.
> > >
> > > Thanks,
> > > Glenn Dixon
> > >
> > >
> > >
> > >
> > > *********************************
> > > Get your free E-Mail and Homepage
> > > Go to http://www.networld.com
> > > *********************************
> > >
> > >
> > ---------------------------------------------------------------------
> > -
> > > sftalk_at_forth.com The SwiftForth programming discussion email
> > list
> > > To unsubscribe, send subject "unsubscribe sftalk" to
> > listar_at_forth.com
> > > For help with listar commands, send subject "help" to
> > listar_at_forth.com
> > > Archives are located at http://www.forth.com/sftalk -- check them
> > out!
> > > Search the archives! Visit http://www.forth.com/search for
> > details.
> >
> > ---------------------------------------------------------------------
> > -
> > sftalk_at_forth.com The SwiftForth programming discussion email
> > list
> > To unsubscribe, send subject "unsubscribe sftalk" to
> > listar_at_forth.com
> > For help with listar commands, send subject "help" to
> > listar_at_forth.com
> > Archives are located at http://www.forth.com/sftalk -- check them
> > out!
> > Search the archives! Visit http://www.forth.com/search for
> > details.
>
>
>
>
> *********************************
> Get your free E-Mail and Homepage
> Go to http://www.networld.com
> *********************************
>
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
> For help with listar commands, send subject "help" to listar_at_forth.com
> Archives are located at http://www.forth.com/sftalk -- check them out!
> Search the archives! Visit http://www.forth.com/search for details.

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/sftalk -- check them out!
Search the archives! Visit http://www.forth.com/search for details.
Received on Wed Jan 08 2003 - 01:25:45 PST

This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:28 PST