Example to use Object2D (and ToolBar)


I forgot why, but I was fooling around with Object2D and ended with the sample that is available there (project with icons, photo and OS logos) that works on OS X and Windows.

And: some days ago, I misunderstand a question and write code to give info to the Conversation.

I moved the code a bit, add a Button to access it and you can get the window Control / ToolBar data when you click in the previous to last (to the right) Button (Icon) in the ToolBar.

Below are the two OS screen shots (OS X and Windows XP):

Nota: Clear and Copy (Clipboard) icons are not mine. PDF icon comes from Acrobat, Quit (OS X and Windows XP) comes from the OS.
Open and Save Icons (Windows XP) uses the OS based folder Icon with own Green Arrow.

Please, note the non apparent complexity of what I called Salomon (Solomon / Schlomo) and David buttons. In both cases, you can see small triangles and an octogon (Salomon) / an Hexagon (David). I am not sure about the David art measures: I’ve done it without references. Salomon artwork is just a square plus a second one with a 45° rotation.

Here is the basic code to draw an arc with comments:

[code]// Draw an arc starting at 0
// with a black border
// and fill it using yellow

Dim Arc As New ArcShape
Dim mSavePicture As New Picture (500,500)
Dim Pi As Double

// Fill Pi
Pi = 3.14159265

// Fill the properties
Arc.Width = 300 // The usual Width
Arc.Height = 300 // The usual Height
Arc.StartAngle = 0 // Draw the arc at position 0 (3h15mn / 90°)
Arc.ArcAngle = Pi / 2 // Angle or the Arc [Pi / 2 = 1.5707963 rad]
Arc.FillColor = RGB(255,255,0,127) // Yellow with half transparency
Arc.Rotation = 0 // No rotation
Arc.Border = 100 // Border: 100% Opaque (0: 100% transparent)
Arc.BorderWidth = 5 // Width of the Border

// Store the ArcShape
mSavePicture.Graphics.DrawObject Arc, 200,200
Self.Backdrop = mSavePicture

// Place a copy of the graphic in the Clipboard
// So I can Paste it in my Report
Dim Clip As New Clipboard

Clip.Picture = mSavePicture