• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Forms.DynamicLayout类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Eto.Forms.DynamicLayout的典型用法代码示例。如果您正苦于以下问题:C# DynamicLayout类的具体用法?C# DynamicLayout怎么用?C# DynamicLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DynamicLayout类属于Eto.Forms命名空间,在下文中一共展示了DynamicLayout类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: RemoveItemsIndividuallyShouldClearParent

		public void RemoveItemsIndividuallyShouldClearParent()
		{
			TestBase.Invoke(() =>
			{
				var layout = new DynamicLayout();

				var items = new Control[] { new Label(), new Button(), new TextBox() };

				foreach (var item in items)
					layout.Add(item);

				CollectionAssert.AreEqual(items, layout.Children, "#1. Items do not match");

				foreach (var item in items)
					Assert.AreEqual(layout, item.Parent, "#2. Items should have parent set to dynamic layout");

				layout.Rows.RemoveAt(0);
				Assert.IsNull(items[0].Parent, "#3. Item should have parent cleared when removed from dynamic layout");

				layout.Rows[0] = new Button();
				Assert.IsNull(items[1].Parent, "#4. Item should have parent cleared when replaced with another item in the dynamic layout");

				Assert.AreEqual(layout, items[2].Parent, "#5. Item should not have changed parent as it is still in the dynamic layout");
			});
		}
开发者ID:picoe,项目名称:Eto,代码行数:25,代码来源:DynamicLayoutTests.cs


示例2: About

		public About ()
		{
			this.Title = "About Eto Test";
#if DESKTOP
			this.Resizable = true;
#endif

			var layout = new DynamicLayout (this);

			layout.AddCentered(new ImageView{
				Image = Icon.FromResource ("Eto.Test.TestIcon.ico"),
				Size = new Size(128, 128)
			}, true, true);
			
			layout.Add (new Label{
				Text = "Test Application",
				Font = new Font(FontFamily.Sans, 16, FontStyle.Bold),
				HorizontalAlign = HorizontalAlign.Center
			});

			var version = Assembly.GetEntryAssembly ().GetName ().Version;
			layout.Add (new Label {
				Text = string.Format("Version {0}", version),
				HorizontalAlign = HorizontalAlign.Center
			});
			
			
			layout.Add (new Label{
				Text = "Copyright 2011 by Curtis Wensley aka Eto",
				HorizontalAlign = HorizontalAlign.Center
			});

			layout.AddCentered (CloseButton ());
		}
开发者ID:hultqvist,项目名称:Eto,代码行数:34,代码来源:About.cs


示例3: TreeViewSection

		public TreeViewSection()
		{
			var layout = new DynamicLayout();
			
			layout.BeginHorizontal();
			layout.Add(new Label());
			layout.BeginVertical();
			layout.BeginHorizontal();
			layout.Add(null);
			layout.Add(allowExpanding = new CheckBox{ Text = "Allow Expanding", Checked = true });
			layout.Add(allowCollapsing = new CheckBox{ Text = "Allow Collapsing", Checked = true });
			layout.Add(RefreshButton());
			layout.Add(null);
			layout.EndHorizontal();
			layout.EndVertical();
			layout.EndHorizontal();

			treeView = ImagesAndMenu();

			layout.AddRow(new Label{ Text = "Simple" }, Default());
			layout.BeginHorizontal();
			layout.Add(new Panel());
			layout.BeginVertical();
			layout.AddSeparateRow(InsertButton(), AddChildButton(), RemoveButton(), ExpandButton(), CollapseButton(), null);
			layout.AddSeparateRow(LabelEditCheck(), EnabledCheck(), null);
			layout.EndVertical();
			layout.EndHorizontal();
			layout.AddRow(new Label{ Text = "With Images\n&& Context Menu" }, treeView);
			layout.AddRow(new Panel(), HoverNodeLabel());

			layout.Add(null, false, true);

			Content = layout;
		}
开发者ID:alexandrebaker,项目名称:Eto,代码行数:34,代码来源:TreeViewSection.cs


示例4: PrintDialogSection

		public PrintDialogSection()
		{
			this.DataContext = settings;

			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };

			layout.BeginVertical();
			layout.BeginHorizontal();
			layout.Add(null);
			layout.BeginVertical(Padding.Empty);
			layout.AddSeparateRow(null, ShowPrintDialog(), null);
			layout.AddSeparateRow(null, PrintFromGraphicsWithDialog(), null);
			layout.AddSeparateRow(null, PrintFromGraphics(), null);
			layout.EndBeginVertical();
			layout.Add(PrintDialogOptions());
			layout.Add(null);
			layout.EndVertical();
			layout.Add(null);
			layout.EndHorizontal();
			layout.EndVertical();
			layout.AddSeparateRow(null, PageRange(), Settings(), null);

			layout.Add(null);
			Content = layout;
		}
开发者ID:GilbertoBotaro,项目名称:Eto,代码行数:25,代码来源:PrintDialogSection.cs


示例5: TransformSection

		public TransformSection()
		{
			image = TestIcons.TestIcon;
			font = Fonts.Sans(10);

			var layout = new DynamicLayout();

			var drawable = new Drawable { Size = canvasSize };
			drawable.Paint += (sender, pe) => {
				pe.Graphics.FillRectangle(Brushes.Black, pe.ClipRectangle);
				MatrixTests(pe.Graphics);
			};
			layout.AddRow(new Label { Text = "Matrix" }, drawable);

			drawable = new Drawable { Size = canvasSize };
			drawable.Paint += (sender, pe) => {
				pe.Graphics.FillRectangle(Brushes.Black, pe.ClipRectangle);
				DirectTests(pe.Graphics);
			};
			layout.AddRow(new Label { Text = "Direct" }, drawable);
			layout.Add(null);

			var m = Matrix.Create();
			m.Scale(100, 100);
			var m2 = m.Clone();
			m2.Translate(10, 10);

			if (m == m2)
				throw new Exception("Grr!");

			Content = layout;
		}
开发者ID:gene-l-thomas,项目名称:Eto,代码行数:32,代码来源:TransformSection.cs


示例6: TabControlSection

		public TabControlSection ()
		{
			var layout = new DynamicLayout (this);
			
			layout.Add (DefaultTabs ());
			
		}
开发者ID:hultqvist,项目名称:Eto,代码行数:7,代码来源:TabControlSection.cs


示例7: ExpandedHeight

		Control ExpandedHeight()
		{
			var layout = new DynamicLayout();

			layout.Add(new Label { BackgroundColor = Colors.Red, Text = "Expanded Height" });
			return new Scrollable { ExpandContentWidth = false, Content = layout };
		}
开发者ID:gene-l-thomas,项目名称:Eto,代码行数:7,代码来源:TableLayoutExpansion.cs


示例8: JabbRAuthDialog

        public JabbRAuthDialog(string serverAddress, string appName)
        {
            this.ServerAddress = serverAddress;
            this.AppName = appName;
            this.DisplayMode = DialogDisplayMode.Attached;
            
            this.ClientSize = defaultSize;
            this.Resizable = true;
            this.Title = "JabbR Login";
            
            var baseDir = Path.Combine(EtoEnvironment.GetFolderPath(EtoSpecialFolder.ApplicationResources), "Styles", "default");
            webserver = new HttpServer(baseDir);
            LocalhostTokenUrl = new Uri(webserver.Url, "Authorize");
            webserver.StaticContent.Add("/", AuthHtml(true));
            webserver.StaticContent.Add("/Authorize", GetUserIDHtml());
            webserver.ReceivedRequest += HandleReceivedRequest;
            
            
            web = new WebView();
            web.DocumentLoaded += HandleDocumentLoaded;
            web.Url = webserver.Url;
            
            var layout = new DynamicLayout();
            layout.Add(web, yscale: true);
            layout.AddSeparateRow(Padding.Empty).Add(null, this.CancelButton());

            Content = layout;
        }
开发者ID:modulexcite,项目名称:JabbR.Desktop,代码行数:28,代码来源:JabbRAuthDialog.cs


示例9: Generate

		public override Control Generate (DynamicLayout layout)
		{
			if (rows.Count == 0)
				return null;
			int cols = rows.Max (r => r.Items.Count);

			if (Container == null) {
				Container = new Panel ();
				this.Layout = new TableLayout (Container, cols, rows.Count);
			}
			else {
				this.Layout = new TableLayout (null, cols, rows.Count);
				Container.SetInnerLayout ();
			}
			var tableLayout = this.Layout;
			var padding = this.Padding ?? layout.DefaultPadding;
			if (padding != null)
				tableLayout.Padding = padding.Value;

			var spacing = this.Spacing ?? layout.DefaultSpacing;
			if (spacing != null)
				tableLayout.Spacing = spacing.Value;

			for (int cy = 0; cy < rows.Count; cy++) {
				var row = rows[cy];
				for (int cx = 0; cx < row.Items.Count; cx++) {
					var item = row.Items[cx];
					item.Generate (layout, tableLayout, cx, cy);
				}
			}
			return Container;
		}
开发者ID:hultqvist,项目名称:Eto,代码行数:32,代码来源:DynamicTable.cs


示例10: BrushSection

		public BrushSection()
		{
			var layout = new DynamicLayout();
			brush = solidBrush = Brushes.LightSkyBlue;
			gradientBrush = new LinearGradientBrush(Colors.AliceBlue, Colors.Black, new PointF(0, 0), new PointF(100f, 100f));
			//gradientBrush = new LinearGradientBrush (new RectangleF (0, 0, 50, 50), Colors.AliceBlue, Colors.Black, 10);
			gradientBrush.Wrap = GradientWrapMode.Repeat;
			textureBrush = new TextureBrush(image, 0.5f);
			brush = textureBrush;

			ScaleX = 100f;
			ScaleY = 100f;

			drawable = new Drawable { Size = new Size(300, 200) };

			drawable.Paint += (sender, pe) => Draw(pe.Graphics);

			layout.AddSeparateRow(null, BrushControl(), UseBackgroundColorControl(), null);
			if (Platform.Supports<NumericUpDown>())
			{
				matrixRow = layout.AddSeparateRow(null, new Label { Text = "Rot" }, RotationControl(), new Label { Text = "Sx" }, ScaleXControl(), new Label { Text = "Sy" }, ScaleYControl(), new Label { Text = "Ox" }, OffsetXControl(), new Label { Text = "Oy" }, OffsetYControl(), null);
				matrixRow.Table.Visible = false;
			}
			gradientRow = layout.AddSeparateRow(null, GradientWrapControl(), null);
			gradientRow.Table.Visible = false;
			layout.AddSeparateRow(null, drawable, null);
			layout.Add(null);

			this.Content = layout;
		}
开发者ID:gene-l-thomas,项目名称:Eto,代码行数:30,代码来源:BrushSection.cs


示例11: TreeGridViewSection

		public TreeGridViewSection()
		{
			var layout = new DynamicLayout();
		
			layout.BeginHorizontal();
			layout.Add(new Label());
			layout.BeginVertical();
			layout.BeginHorizontal();
			layout.Add(null);
			layout.Add(allowExpanding = new CheckBox{ Text = "Allow Expanding", Checked = true });
			layout.Add(allowCollapsing = new CheckBox{ Text = "Allow Collapsing", Checked = true });
			layout.Add(null);
			layout.EndHorizontal();
			layout.EndVertical();
			layout.EndHorizontal();
			
			layout.AddRow(new Label{ Text = "Simple" }, Default());
			
			layout.AddRow(new Label{ Text = "With Images\n&& Context Menu" }, ImagesAndMenu());
			layout.AddRow(new Label{ Text = "Disabled" }, Disabled());
			
			layout.Add(null, false, true);

			Content = layout;
		}
开发者ID:Exe0,项目名称:Eto,代码行数:25,代码来源:TreeGridViewSection.cs


示例12: Init

        void Init()
        {
            //_textBoxUrl
            _textBoxUrl = new TextBox();

            //_buttonReadFile
            _buttonReadFile = new Button { Text = StrRes.GetString("StrLoad", "Load") };
            _buttonReadFile.Click += _buttonReadFile_Click;

            //_buttonSaveFile
            _buttonSaveFile = new Button {Text = StrRes.GetString("StrSave","Save")};
            _buttonSaveFile.Click += _buttonSaveFile_Click;

            //_textAreaBody
            _textAreaBody = new TextArea();

            var layout = new DynamicLayout { Padding = new Padding(5, 5), Spacing = new Size(5, 5) };
            layout.BeginVertical();
            layout.BeginHorizontal();
            layout.AddCentered(_textBoxUrl, xscale: true, horizontalCenter: false);
            layout.AddCentered(_buttonReadFile, horizontalCenter: false);
            layout.AddCentered(_buttonSaveFile, horizontalCenter: false);
            layout.EndBeginHorizontal();
            layout.EndVertical();

            layout.AddRow(_textAreaBody);

            Content = layout;
        }
开发者ID:aaaaaaaannn,项目名称:Altman,代码行数:29,代码来源:FileEditerPanel.UI.cs


示例13: VerticalSection

		Control VerticalSection()
		{
			var layout = new DynamicLayout { BackgroundColor = Colors.Blue };
			layout.Add(new Panel { Size = new Size(50, 60), BackgroundColor = Colors.Lime });
			layout.Add(new Panel { Size = new Size(50, 60), BackgroundColor = Colors.Lime });
			return layout;
		}
开发者ID:Exe0,项目名称:Eto,代码行数:7,代码来源:RuntimeSection.cs


示例14: BadgeLabelSection

		public BadgeLabelSection ()
		{
			var layout = new DynamicLayout (this);

			layout.AddRow (null, SetBadgeLabel (), null);
			layout.Add (null);
		}
开发者ID:majorsilence,项目名称:Eto,代码行数:7,代码来源:BadgeLabelSection.cs


示例15: TextureBrushesSection

		public TextureBrushesSection()
		{
			var layout = new DynamicLayout();
			for (var i = 0; i < 10; ++i)
			{
				var w = image.Size.Width / 3; // same as height
				var img = image;
				if (i > 0)
					img = img.Clone(new Rectangle((i - 1) % 3 * w, (i - 1) / 3 * w, w, w));

				var brush = new TextureBrush(img);
				var drawable = new Drawable { Size = image.Size * 2 };

				drawable.Paint += (s, e) => {
					var destRect = new RectangleF(new PointF(100, 100), image.Size);
					var temp = brush.Transform; // save state
					brush.Transform = Matrix.FromRotation(90);
					e.Graphics.TranslateTransform(destRect.Location);
					e.Graphics.FillRectangle(brush, new RectangleF(destRect.Size));
					brush.Transform = temp;
				};
				layout.AddRow(drawable);
			}
			layout.Add(null);
			Content = layout;
		}
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:26,代码来源:TextureBrushesSection.cs


示例16: GridViewSection

		public GridViewSection()
		{
			var layout = new DynamicLayout();

			layout.AddRow(new Label { Text = "Default" }, Default());
			layout.AddRow(new Label { Text = "No Header,\nNon-Editable" }, NoHeader());
#if DESKTOP
			layout.BeginHorizontal();
			layout.Add(new Label { Text = "Context Menu\n&& Multi-Select\n&& Filter" });
			layout.BeginVertical();
			layout.Add(filterText = new SearchBox { PlaceholderText = "Filter" });
			var withContextMenuAndFilter = WithContextMenuAndFilter();
			layout.Add(withContextMenuAndFilter);
			layout.EndVertical();
			layout.EndHorizontal();

			var selectionGridView = Default(addItems: false);
			layout.AddRow(new Label { Text = "Selected Items" }, selectionGridView);

			// hook up selection of main grid to the selection grid
			withContextMenuAndFilter.SelectionChanged += (s, e) =>
			{
				var items = new DataStoreCollection();
				items.AddRange(withContextMenuAndFilter.SelectedItems);
				selectionGridView.DataStore = items;
			};
#endif

			Content = layout;
		}
开发者ID:Exe0,项目名称:Eto,代码行数:30,代码来源:GridViewSection.cs


示例17: PixelOffsetSection

		public PixelOffsetSection()
		{
			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };

			var drawable = new Drawable { Size = canvasSize };
			drawable.Paint += (sender, pe) =>
			{
				pe.Graphics.FillRectangle(Brushes.Black, pe.ClipRectangle);
				pe.Graphics.PixelOffsetMode = PixelOffsetMode.None;
				Draw(pe.Graphics);
			};
			layout.AddRow(new Label { Text = "None (Default)" }, drawable);

			drawable = new Drawable { Size = canvasSize };
			drawable.Paint += (sender, pe) =>
			{
				pe.Graphics.FillRectangle(Brushes.Black, pe.ClipRectangle);
				pe.Graphics.PixelOffsetMode = PixelOffsetMode.Half;
				Draw(pe.Graphics);
			};
			layout.AddRow(new Label { Text = "Half" }, drawable);
			layout.Add(null);

			Content = layout;
		}
开发者ID:mhusen,项目名称:Eto,代码行数:25,代码来源:PixelOffsetSection.cs


示例18: ChannelListDialog

		public ChannelListDialog (Server server)
		{
			this.ClientSize = new Size (600, 400);
			this.Resizable = true;
			this.Title = "Channel List";
			
			grid = new GridView {
				AllowMultipleSelection = false
			};
			grid.MouseDoubleClick += HandleMouseDoubleClick;
			grid.Columns.Add (new GridColumn { DataCell = new TextBoxCell ("Name"), HeaderText = "Channel", Width = 150, AutoSize = false });
			grid.Columns.Add (new GridColumn { DataCell = new TextBoxCell ("UserCount"), HeaderText = "Users", Width = 60, AutoSize = false });
			grid.Columns.Add (new GridColumn { DataCell = new TextBoxCell ("Topic"), HeaderText = "Topic", Width = 350, AutoSize = false });
			
			var layout = new DynamicLayout (this);
			
			layout.Add (grid, yscale: true);
			layout.BeginVertical ();
			layout.AddRow (null, this.CancelButton (), this.OkButton ("Join Channel", CanJoin));
			layout.EndVertical ();
			
			var channelTask = server.GetChannelList ();
			channelTask.ContinueWith (task => {
				Application.Instance.AsyncInvoke (delegate {
					grid.DataStore = new GridItemCollection (task.Result.OrderBy (r => r.Name).OrderByDescending (r => r.UserCount));
				});
			}, System.Threading.Tasks.TaskContinuationOptions.OnlyOnRanToCompletion);
		}
开发者ID:neiz,项目名称:JabbR.Eto,代码行数:28,代码来源:ChannelListDialog.cs


示例19: Init

        void Init()
        {
	        _tbxShellData = new TextArea {Size = new Size(-1, 200)};
            _tbxMsg = new TextBox();
	        _btnShowMsgInStatus = new Button {Text = "Show Msg In Status", Width = 150};
            _btnShowMsgInStatus.Click+=btn_showMsgInStatus_Click;
			_btnShowMessageBox = new Button { Text = "Show Msg In Message", Width = 150 };
            _btnShowMessageBox.Click+=btn_showMessageBox_Click;
			_btnCreateNewTabPage = new Button { Text = "Create New TabPage", Width = 150 };
            _btnCreateNewTabPage.Click+=btn_createNewTabPage_Click;

			// Test
	        var btnTest = new Button {Text = "Test", Width = 150};
			btnTest.Click += btnTest_Click;

	        var layout = new DynamicLayout {Padding = new Padding(10, 10), Size = new Size(10, 10)};
            layout.AddRow(new Label() { Text = "ShellData"});
			layout.AddRow(_tbxShellData);
			layout.AddSeparateRow(new Label() { Text = "Msg", VerticalAlign = VerticalAlign.Middle }, _tbxMsg, null);
	        layout.AddAutoSized(_btnShowMsgInStatus);
	        layout.AddAutoSized(_btnShowMessageBox);
	        layout.AddAutoSized(_btnCreateNewTabPage);
			layout.AddAutoSized(btnTest);
			layout.Add(null);

            this.Content = layout;
        }
开发者ID:kevins1022,项目名称:Altman,代码行数:27,代码来源:DoNetPluginTest.cs


示例20: RuntimeSection

		public RuntimeSection ()
		{
			var layout = new DynamicLayout (this);

			layout.AddCentered (ToggleButton ());
			layout.Add (MainTable ());
		}
开发者ID:hultqvist,项目名称:Eto,代码行数:7,代码来源:RuntimeSection.cs



注:本文中的Eto.Forms.DynamicLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.Label类代码示例发布时间:2022-05-24
下一篇:
C# Forms.Control类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap