Page 1 of 1

canvas gadget

Posted: Sat Sep 04, 2010 12:41 am
by ehowington
Ok ill post this again since I have not gotten any sorta response on this question I was wondering if there are some sorta examples of a drawing canvas for vector data similar to drawing canvas that FLEX has which you can pan/zoom/scale this canvas with controls. Is there anyone out there wondering the same thing?

Any thoughts on this would be greatly appreciated.

Thank you all in advance.

Re: canvas gadget

Posted: Sat Sep 04, 2010 9:49 am
by srod
Pan, zoom scale... your best bet would probably be to use an Enhanced metafile (Windows) and then play this to an image and seat this within an image gadget etc. Metafiles can be rescaled very easily.

Re: canvas gadget

Posted: Sat Sep 04, 2010 11:07 am
by blueznl
Dunno how far you want to take this, but the g_spot stuff provides with some of that functionality, though originally it was not designed to do so :-)

Re: canvas gadget

Posted: Sat Sep 04, 2010 11:59 am
by Trond
blueznl wrote:Dunno how far you want to take this, but the g_spot stuff provides with some of that functionality, though originally it was not designed to do so :-)
Did you upload it yet?

Re: canvas gadget

Posted: Sat Sep 04, 2010 12:40 pm
by yrret
From http://www.xs4all.nl/~bluez/purebasic/p ... #0_general
29.3 Sweetspot.
Under development.
I'm currently working on a new project called 'Sweetspot'. It's still very much a secret :-)

* Download Sweetspot. (Includes source code!)

* Sweetspot uses the g_spot resizing / 2D library. See g_spot in action on YouTube here and here.

G-spot.

One of Sweetspot's components is an include file called g_spot.pb. I have included it as part of the Sweetspot upload. (There's not much else in there right now.)

Download sweetspot.zip and look for the folder g_spot in there. In it you will find the include file, and a few examples. G-spot includes code to resize gadgets and windows and to do some limited 2D object handling and drawing, panning and zooming.

Re: canvas gadget

Posted: Sat Sep 04, 2010 7:37 pm
by ehowington
looking at this now from what I see on the youtube exactly what I was looking for.

Re: canvas gadget

Posted: Sun Sep 05, 2010 4:16 am
by ehowington
sent ya a small mod to your code :)

Re: canvas gadget

Posted: Sun Sep 05, 2010 9:09 am
by blueznl
I'll upload a newer version tonight.

Re: canvas gadget

Posted: Sun Sep 05, 2010 4:25 pm
by ehowington
awsome love to see it

Re: canvas gadget

Posted: Sun Sep 05, 2010 5:25 pm
by Trond
How does it deal with conflicting rules? Like, setting gadget 1's x to gadget 2's x + 10 and vice versa at the same time.

Edit: "place object left ie. right of reference". That makes no sense. http://en.wikipedia.org/wiki/List_of_Latin_phrases_(I)

Re: canvas gadget

Posted: Fri Sep 10, 2010 10:07 am
by blueznl
Trond wrote: How does it deal with conflicting rules? Like, setting gadget 1's x to gadget 2's x + 10 and vice versa at the same time.
Rules are processed in sequence, ie. a new rule can overrule an old rule. It's silly to do so, but it would't cause issues. Unless, for example, an object points to itself, and is told to move five pixels to the left on every call, ending up in a moving object :-)
Edit: "place object left ie. right of reference". That makes no sense. http://en.wikipedia.org/wiki/List_of_Latin_phrases_(I)
You are right. I think. I'll have a look at that, should probably be 'or' depending on the context.

I just uploaded the file. Though it may look cumbersome it's actually rather easy to implement into existing code, see the included samples.