Пример #1
0
		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);
		}
Пример #2
0
		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);
		}
Пример #3
0
		/// 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();
		}
Пример #4
0
		/// Add a new default hypotrochoid
		public void AddHypotrochoid()
		{
			SpiroInstance si=new Hypotrochoid();
			spiros.Add(si);
		}
Пример #5
0
		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);
		}
Пример #6
0
		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);
		}
Пример #7
0
		// see description in base class
		public override SpiroInstance Clone()
		{
			Hypotrochoid clone = new Hypotrochoid();
			clone.Clone(this);
			return clone;
		}