Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quick question about shape
Message
From
31/05/2001 04:42:15
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
31/05/2001 03:48:08
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00513027
Message ID:
00513034
Views:
14
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>
>is it possible to use shape to make a triangle? or must I use 3 lines to make one? thx in advance!

Hi Jimi,
Rooms and shapes :) AFAIk you can't make a triangle from a shape. You could use lines but you'd have limitations. There is 2 lines in VFP a line object and a line method.

With line method it's easy to draw virtually any shape and syntax is like :

object.Line(Xto, Yto) && Draws a line from current X,Y (CurrentX and CurrentY properties)
object.Line(Xfrom,Yfrom,Xto,Yto) && Start and end x,y parameters

Sounds they're wonderfull ? In a way yes, I created my fastest graphs with them. But wait, big problem 'object' could be a form or _screen and it's a method not object. You just draw. If any object covers it, moving it 'erases' your line. You should redraw when needed. You can't 'bring to front','send to back' etc. It has no methods, events and if you should save drawing you 'have to save-record coordinates while drawing' (quite well with vector apps).

Now you might think it's useless :) It's good to draw a say chart, vector plan, map fast.

Other one (line object) could be used to draw again. It's object, can be moved, sized, zordered has events and methods.
It's somewhat defined with a rectangular region (put one on form to see what I mean). Rectangle's 2 corners define its start and x,y. It's height/width would be tangent, and with sqrt(x2+y2) you could get length too.
One thing you should keep in mind :
Since it's defined by a rectangular 'area' any mouse events would be intercepted as mouse enters its rectangular area. This is the biggest problem and you should write workarounds for it if you need. Other than that mostly what you need is to set height, width and slant (it might be lineslant) properties.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform