Hi all,

I am creating a project in which I have to create simple graphic editor.
Christophe and Russell Campbell had kindly advised me to subclassed shape
control and add appropriate properties/methods (pls refer to the thread
entitled 'Drawing ability on VFP Apps' on this ng). I did what they've told
me and my apps managed to 'draw' an object, fill appropriate values to its
properties, and saved those value to a table for further use (--- like load
the drawing).

But I have three problems:
1. How to set the mouse pointer such that:
- it will change to north-south-east-west arrow when the mouse is *in*
the shape
- it will change to north-south arrow when the mouse is *on* the top or
bottom edge of the shape
- it will change to east-west arrow when the mouse is *on* the left or
right edge of the shape.

2. I want to add the ability to 'stretch' the rectangle (like most of
commercial Windows-based applications) by dragging the mouse on the edge of
the shape. How can I do that?
3. And how to add the ability to 'move' the rectangle by dragging the mouse
in the shape?

I am looking forward to hearing from all of you!

TIA,
Willianto

Re: How to move/stretch a shape (in runtime) by dragging the mouse? by Eric

Eric
Thu Aug 07 04:14:23 CDT 2003

Hello, Willianto!
You wrote on Thu, 7 Aug 2003 13:36:40 +0700:

W> 3. And how to add the ability to 'move' the rectangle by dragging the
W> mouse in the shape?

There's a drag & drop sample in Solutions:
HOME() + "\Samples\Solution\Tahoe\Oledd.scx"
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



How to move/stretch a shape (in runtime) by dragging the mouse? by tunsin

tunsin
Thu Aug 07 05:02:27 CDT 2003

I don't ve solution to problem but, i do have a problem
saving pictures into database files. Can u help.

thanks.

tunsin jegede

Re: How to move/stretch a shape (in runtime) by dragging the mouse? by Eric

Eric
Thu Aug 07 05:18:15 CDT 2003

Hello, tunsin!

To store images in a table, use a Binary Memo field and FILETOSTR():
REPLACE yourmemofield WITH FILETOSTR("yourimage.jpg")
Use STRTOFILE() to save the contents of a memofield to file:
STRTOFILE(yourmemofield, "yourimage.jpg")
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Re: How to move/stretch a shape (in runtime) by dragging the mouse? by christophe

christophe
Thu Aug 07 06:33:53 CDT 2003

"Willianto" <willianto@remove-me.telkom-and-me.net> schreef in bericht
news:Oi4WI4KXDHA.3248@tk2msftngp13.phx.gbl...
> Hi all,
>
> I am creating a project in which I have to create simple graphic editor.
> Christophe and Russell Campbell had kindly advised me to subclassed shape
> control and add appropriate properties/methods (pls refer to the thread
> entitled 'Drawing ability on VFP Apps' on this ng). I did what they've
told
> me and my apps managed to 'draw' an object, fill appropriate values to
its
> properties, and saved those value to a table for further use (--- like
load
> the drawing).
>
> But I have three problems:
> 1. How to set the mouse pointer such that:
> - it will change to north-south-east-west arrow when the mouse is *in*

take a look at Object.MousePointer = nType and Object.MouseEnter /
MouseLeave event


> the shape
> - it will change to north-south arrow when the mouse is *on* the top
or
> bottom edge of the shape
> - it will change to east-west arrow when the mouse is *on* the left or
> right edge of the shape.
>
> 2. I want to add the ability to 'stretch' the rectangle (like most of
> commercial Windows-based applications) by dragging the mouse on the edge
of
> the shape. How can I do that?

when a user clicks on a shape or enter the object with the mouse add / show
to each corner
and in the middle of each edge a small ResizeShape ( 5 x 5 pixels).
So you will have 8 ResizeShapes (N, E, S, W = edges, and NE, NW, SE, SW =
corners
or whatever name you want to give them)
and put the right resize code in those ResizeShapes.
Upon entering or clicking those ResizeShapes you could alter the MouseIcon
and in the ResizeShape.MouseDown you could place your code fore altering the
size of the object


> 3. And how to add the ability to 'move' the rectangle by dragging the
mouse
> in the shape?

see Eric answer.

>
> I am looking forward to hearing from all of you!
>
> TIA,
> Willianto
>
>


If you need more help
Well,
you know the way ...

Good luck,


Christophe
Belgium