public AboutDialog() { // // Required for Windows Form Designer support // InitializeComponent(); SpiroInstance si=new Hypotrochoid(65, 20, 28, new Point(75, 75)); si.ShowTrace=false; si.ShowInfo=true; si.Randomise=true; sc.Clear();; sc.AddSpiro(si); }
public SpiroCanvas() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); // set the right-hand arrow char into the button text // (we do this here rather than in designer because it gives // a warning about unicode chars and file encoding) this.spiroMenuButton.Text = "\u25ba"; // make sure we get nice smooth redraws SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.ResizeRedraw, true); // add first spiro SpiroInstance si=new Hypotrochoid(); AddSpiro(si); }
/// Event handler for type change menu item private void ChangeType(object sender, EventArgs e) { SpiroInstance si; if ( CurrentSpiro is Epitrochoid ) si=new Hypotrochoid(); else si=new Epitrochoid(); // clone all values from current si.Clone(CurrentSpiro); // replace current with new spiros[current]=si; Invalidate(); UpdateFloatingButton(); }
/// Add a new default hypotrochoid public void AddHypotrochoid() { SpiroInstance si=new Hypotrochoid(); spiros.Add(si); }
private void OnLoad(object sender, System.EventArgs e) { int xmin=0; int xmax=0; int ymin=0; int ymax=0; for(int x = 0; x <= Screen.AllScreens.GetUpperBound(0); x++) { if(Screen.AllScreens[x].Bounds.Left<xmin) xmin=Screen.AllScreens[x].Bounds.Left; if(Screen.AllScreens[x].Bounds.Top<ymin) ymin=Screen.AllScreens[x].Bounds.Top; if(Screen.AllScreens[x].Bounds.Right>xmax) xmax=Screen.AllScreens[x].Bounds.Right; if(Screen.AllScreens[x].Bounds.Bottom>ymax) ymax=Screen.AllScreens[x].Bounds.Bottom; } Rectangle rectBounds = new Rectangle(xmin, ymin, xmax-xmin, ymax-ymin); this.Bounds = rectBounds; // VisibleRect = new Rectangle(0, 0, Bounds.Width-pictureBox.Width, Bounds.Height-pictureBox.Height); Cursor.Hide(); TopMost = true; SpiroInstance si=new Hypotrochoid(65, 20, 28, new Point(100, 100)); si.ShowTrace=false; si.Randomise=false; si.MaxRandomDiameter=Math.Min(rectBounds.Width, rectBounds.Height) / 4; AutoRandom(si); spiroCanvas1.AddSpiro(si); }
private void SpiroComplete(object sender, EventArgs e) { SpiroInstance si=sender as SpiroInstance; if ( numSpiros < 4 ) { SpiroInstance next; if ( (numSpiros % 2) == 1 ) { next=new Epitrochoid(); } else { next=new Hypotrochoid(); } next.ShowTrace=false; next.Randomise=false; next.MaxRandomDiameter=Math.Min(Bounds.Width, Bounds.Height) / 4; AutoRandom(next); spiroCanvas1.AddSpiro(next); numSpiros++; } AutoRandom(si); }
// see description in base class public override SpiroInstance Clone() { Hypotrochoid clone = new Hypotrochoid(); clone.Clone(this); return clone; }