Пример #1
1
		Control LargeCanvas ()
		{
			var control = new Drawable{
				Size = new Size (1000, 1000),
				BackgroundColor = Colors.Blue
			};
			var image = Bitmap.FromResource ("Eto.Test.TestImage.png");
			control.Paint += delegate(object sender, PaintEventArgs pe) {
				pe.Graphics.FillRectangle (Colors.Black, new Rectangle (150, 150, 100, 100));
				var inc = 400;
				for (int i = 0; i <= control.Size.Width / inc; i++) {
					var pos = i * inc;
					pe.Graphics.DrawLine (Colors.White, new Point (pos, 0), new Point (pos + control.Size.Width, control.Size.Height));
					pe.Graphics.DrawLine (Colors.White, new Point (pos, 0), new Point (pos - control.Size.Width, control.Size.Height));
				}
				var lpos = 100;
				pe.Graphics.DrawLine (Colors.White, new Point (0, lpos), new Point (control.Size.Width, lpos));
				pe.Graphics.DrawLine (Colors.White, new Point (lpos, 0), new Point (lpos, control.Size.Height));
				pe.Graphics.DrawImage (image, 100, 10);
				pe.Graphics.DrawImage (image, 250, 10, 80, 20);
			};
			LogEvents (control);

			var layout = new PixelLayout (new Scrollable {
				Size = new Size (450, 250)
			});
			layout.Add (control, 25, 25);
			return layout.Container;
		}
Пример #2
0
		Control ExpandedHeight()
		{
			var layout = new PixelLayout();

			layout.Add(new Label { BackgroundColor = Colors.Red, Text = "Expanded Height" }, 50, 50);
			return new Scrollable { ExpandContentWidth = false, Content = layout };
		}
Пример #3
0
		void Init()
		{
			var label1 = new Label
			{
				Text = "Welcome to",
				Font = new Font(FontFamilies.Monospace, 30)
			};
			var labelTitle = new Label
			{
				Text = "Altman3",
				Font = new Font(FontFamilies.Monospace, 60)
			};

			var layout = new PixelLayout();
			layout.Add(label1, new Point(70, 50));
			layout.Add(labelTitle, new Point(100, 120));

			var logo = PluginServiceProvider.GetService("ToFingerBinary");
			if (logo != null)
			{
				var rnd = new Random();
				var par = new PluginParameter();
				par.AddParameter("str", rnd.Next(1, 1023));
				var ret = logo(par);
				var tmp = new Label
				{
					Text = ret,
					Font = new Font(FontFamilies.Monospace, 10)
				};
				layout.Add(tmp, new Point(300, 220));
			}

			Content = layout;
		}
Пример #4
0
		public AnchorSection()
		{
			Content = PixelLayout = new PixelLayout();

			Buttons = CreateButtons();
			HandleEvent(SizeChangedEvent);
		}
Пример #5
0
		Control LineScrollable()
		{
			var scrollable = new Scrollable{ Size = new Size(100, 200), Border = BorderType.Line };
			LogEvents (scrollable);
			var playout = new PixelLayout(scrollable);
			playout.Add (new LabelSection{ Size = new Size(400, 400)}, 0, 0);
			return playout.Container;
		}
Пример #6
0
		Control DefaultScrollable()
		{
			var scrollable = new Scrollable{ Size = new Size(100, 200) };
			LogEvents (scrollable);
			var playout = new PixelLayout(scrollable);
			playout.Add (new LabelSection{ Size = new Size(400, 400)}, 0, 0);
			return playout.Container;
		}
Пример #7
0
		Control Default()
		{
			var layout = new PixelLayout();

			layout.Add(new Label { BackgroundColor = Colors.Red, Text = "Expanded Width/Height (default)" }, 50, 50);

			defaultScrollable.Content = layout;
			return defaultScrollable;
		}
Пример #8
0
		Control BezelScrollable()
		{
			var scrollable = new Scrollable { Size = new Size(100, 200), Border = BorderType.Bezel };
			LogEvents(scrollable);
			var playout = new PixelLayout();
			playout.Add(new LabelSection { Size = new Size(400, 400) }, 0, 0);
			scrollable.Content = playout;
			return scrollable;
		}
Пример #9
0
		Control LargeCanvas()
		{
			var control = new Drawable
			{
				Size = new Size (1000, 1000),
				BackgroundColor = Colors.Blue
			};
			var image = TestIcons.TestImage();
			control.Paint += delegate(object sender, PaintEventArgs pe)
			{
				pe.Graphics.FillRectangle(Brushes.Black(), new Rectangle(150, 150, 100, 100));
				var whitePen = Pens.White();
				const int inc = 400;
				for (int i = 0; i <= control.Size.Width / inc; i++)
				{
					var pos = i * inc;
					pe.Graphics.DrawLine(whitePen, new Point(pos, 0), new Point(pos + control.Size.Width, control.Size.Height));
					pe.Graphics.DrawLine(whitePen, new Point(pos, 0), new Point(pos - control.Size.Width, control.Size.Height));
				}
				const int lpos = 100;
				pe.Graphics.DrawLine(whitePen, new Point(0, lpos), new Point(control.Size.Width, lpos));
				pe.Graphics.DrawLine(whitePen, new Point(lpos, 0), new Point(lpos, control.Size.Height));
				pe.Graphics.DrawImage(image, 100, 10);
				pe.Graphics.DrawImage(image, 250, 10, 80, 20);
			};
			LogEvents(control);

			var layout = new PixelLayout();
			layout.Add(control, 25, 25);
			return new Scrollable
			{
				Size = new Size (250, 250),
				Content = layout
			};
		}
Пример #10
0
		public AnchorSection()
		{
			Content = PixelLayout = new PixelLayout();

			Buttons = CreateButtons();
		}
Пример #11
0
		Control PixelLayout()
		{
			var control = new PixelLayout();
			control.Add(new TextArea
			{
				Text = "Some text that is contained in a pixel layout."
			}, Point.Empty);
			return control;
		}