本文整理汇总了C#中Eto.Forms.DynamicLayout.Add方法的典型用法代码示例。如果您正苦于以下问题:C# DynamicLayout.Add方法的具体用法?C# DynamicLayout.Add怎么用?C# DynamicLayout.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eto.Forms.DynamicLayout
的用法示例。
在下文中一共展示了DynamicLayout.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VerticalSection
Control VerticalSection ()
{
var layout = new DynamicLayout (new Panel { BackgroundColor = Color.Blue });
layout.Add (new Panel { Size = new Size (50, 60), BackgroundColor = Color.Green });
layout.Add (new Panel { Size = new Size (50, 60), BackgroundColor = Color.Green });
return layout.Container;
}
示例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 ());
}
示例3: TestProperties
Control TestProperties()
{
var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5) };
DateTimePicker min, max, current, setValue;
Button setButton;
layout.AddRow("Min Value", min = new DateTimePicker());
layout.AddRow("Max Value", max = new DateTimePicker());
layout.BeginHorizontal();
layout.Add("Set to value");
layout.BeginVertical(Padding.Empty);
layout.BeginHorizontal();
layout.AddAutoSized(setValue = new DateTimePicker());
layout.Add(setButton = new Button { Text = "Set" });
layout.EndHorizontal();
layout.EndVertical();
layout.EndHorizontal();
layout.AddRow("Value", current = new DateTimePicker());
min.ValueChanged += (sender, e) => current.MinDate = min.Value ?? DateTime.MinValue;
max.ValueChanged += (sender, e) => current.MaxDate = max.Value ?? DateTime.MaxValue;
setButton.Click += (sender, e) => current.Value = setValue.Value;
LogEvents(current);
return layout;
}
示例4: 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;
}
示例5: 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;
}
示例6: CreateLayout
protected virtual Control CreateLayout()
{
var layout = new DynamicLayout(Padding.Empty, Size.Empty);
layout.Add(History, yscale: true);
layout.Add(new Panel { Content = TextEntry, Padding = new Padding(10) });
return layout;
}
示例7: About
public About ()
{
this.Title = "About Eto Test";
#if DESKTOP
this.Resizable = true;
#endif
var layout = new DynamicLayout (this, new Padding (20, 5), new Size(10, 10));
layout.AddCentered(new ImageView{
Image = Icon.FromResource ("Eto.Test.TestIcon.ico")
}, true, true);
layout.Add (new Label{
Text = "Test Application",
Font = new Font(SystemFont.Bold, 16),
HorizontalAlign = HorizontalAlign.Center
});
var version = Assembly.GetEntryAssembly ().GetName ().Version;
layout.Add (new Label {
Text = string.Format("Version {0}", version),
Font = new Font(SystemFont.Default, 8),
HorizontalAlign = HorizontalAlign.Center
});
layout.Add (new Label{
Text = "Copyright 2011 by Curtis Wensley aka Eto",
Font = new Font(SystemFont.Default, 8),
HorizontalAlign = HorizontalAlign.Center
});
layout.AddCentered (CloseButton ());
}
示例8: TestProperties
Control TestProperties()
{
var layout = new DynamicLayout();
DateTimePicker min, max, current, setValue;
Button setButton;
layout.AddRow(new Label { Text = "Min Value" }, min = new DateTimePicker());
layout.AddRow(new Label { Text = "Max Value" }, max = new DateTimePicker());
layout.BeginHorizontal();
layout.Add(new Label { Text = "Set to value" });
layout.BeginVertical();
layout.BeginHorizontal();
layout.AddAutoSized(setValue = new DateTimePicker());
layout.Add(setButton = new Button { Text = "Set" });
layout.EndHorizontal();
layout.EndVertical();
layout.EndHorizontal();
layout.AddRow(new Label { Text = "Value" }, current = new DateTimePicker());
min.ValueChanged += (sender, e) => current.MinDate = min.Value ?? DateTime.MinValue;
max.ValueChanged += (sender, e) => current.MaxDate = max.Value ?? DateTime.MaxValue;
setButton.Click += (sender, e) => current.Value = setValue.Value;
LogEvents(current);
return layout;
}
示例9: AddHeaders
static void AddHeaders(DynamicLayout layout)
{
layout.BeginHorizontal();
layout.Add(null, xscale: false);
layout.Add(new Label { Text = "Bitmap", HorizontalAlign = HorizontalAlign.Center }, xscale: true);
layout.Add(new Label { Text = "Icon", HorizontalAlign = HorizontalAlign.Center }, xscale: true);
layout.EndHorizontal();
}
示例10: GetWindow
protected override Forms.Window GetWindow()
{
// Add splitters like this:
// |---------------------------
// | | | |
// | P0 | P2 | P4 |
// | -------| | | <== These are on MainPanel
// | P1 |------| |
// | | P3 | |
// |---------------------------
// | status0..4, | <== These are on StatusPanel
// ----------------------------
Label[] status = new Label[] { new Label(), new Label(), new Label(), new Label(), new Label() };
// Status bar
var statusPanel = new Panel { };
var statusLayout = new DynamicLayout(Padding.Empty, Size.Empty);
statusLayout.BeginHorizontal();
for (var i = 0; i < status.Length; ++i)
statusLayout.Add(status[i], xscale: true);
statusLayout.EndHorizontal();
statusPanel.Content = statusLayout;
// Splitter windows
Panel[] p = new Panel[] { new Panel(), new Panel(), new Panel(), new Panel(), new Panel() };
var colors = new Color[] { Colors.PaleTurquoise, Colors.Olive, Colors.NavajoWhite, Colors.Purple, Colors.Orange };
var count = 0;
for (var i = 0; i < p.Length; ++i)
{
var temp = i;
//p[i].BackgroundColor = colors[i];
var button = new Button { Text = "Click to update status " + i.ToString(), BackgroundColor = colors[i] };
button.Click += (s, e) => status[temp].Text = "New count: " + (count++).ToString();
p[i].Content = button;
}
var p0_1 = new Splitter { Panel1 = p[0], Panel2 = p[1], Orientation = SplitterOrientation.Vertical, Position = 200 };
var p2_3 = new Splitter { Panel1 = p[2], Panel2 = p[3], Orientation = SplitterOrientation.Vertical, Position = 200 };
var p01_23 = new Splitter { Panel1 = p0_1, Panel2 = p2_3, Orientation = SplitterOrientation.Horizontal, Position = 200};
var p0123_4 = new Splitter { Panel1 = p01_23, Panel2 = p[4], Orientation = SplitterOrientation.Horizontal, Position = 400 };
// Main panel
var mainPanel = new Panel();
mainPanel.Content = p0123_4;
// Form's content
var layout = new DynamicLayout();
layout.Add(mainPanel, yscale: true);
layout.Add(statusPanel);
layout.Generate();
var form = new Form
{
Size = new Size(800, 600),
Content = layout
};
return form;
}
示例11: ContextMenuSection
public ContextMenuSection ()
{
var layout = new DynamicLayout(this);
layout.Add (null, null, true);
layout.AddRow (null, ContextMenuPanel(), null);
layout.Add (null, null, true);
}
示例12: UnitTestSection
public UnitTestSection()
{
var layout = new DynamicLayout();
var button = new Button { Text = "Start Tests" };
layout.Add(null);
layout.Add(button);
layout.Add(null);
Content = layout;
button.Click += (s, e) =>
{
button.Enabled = false;
var thread = new Thread(() =>
{
using (Generator.ThreadStart())
{
var oldOut = Console.Out;
var oldErr = Console.Error;
var output = new EventStringWriter();
output.Flushed += val => Application.Instance.Invoke(() =>
{
foreach (var line in val.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries))
Log.Write(null, line);
output.Clear();
});
Console.SetOut(output);
Console.SetError(output);
try
{
var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
#if DESKTOP
var consoleRunner = NUnit.ConsoleRunner.Runner.Main(new[]
{
"-noshadow",
"-nothread",
"-nologo",
"-nodots",
"-domain=None",
"-work=" + dir,
typeof(Eto.Test.UnitTests.Startup).Assembly.Location
});
#endif
}
finally
{
Console.SetOut(oldOut);
Console.SetError(oldErr);
Application.Instance.Invoke(() => button.Enabled = true);
}
}
});
thread.Start();
};
}
示例13: LoginSection
Control LoginSection ()
{
var layout = new DynamicLayout (loginSection = new GroupBox{ Text = "Login"});
layout.Add (null);
layout.AddRow (new Label { Text = "UserName" }, EditUserName ());
layout.AddRow (new Label { Text = "Password" }, EditPassword ());
layout.Add (null);
return layout.Container;
}
示例14: DockLayoutExpansion
public DockLayoutExpansion()
{
var layout = new DynamicLayout();
defaultScrollable = new Scrollable();
layout.AddSeparateRow(null, ExpandContentWidth(), ExpandContentHeight(), null);
layout.Add(Default(), yscale: true);
layout.Add(ExpandedWidth(), yscale: true);
layout.Add(ExpandedHeight(), yscale: true);
Content = layout;
}
示例15: TableLayoutExpansion
public TableLayoutExpansion()
{
var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };
defaultScrollable = new Scrollable();
layout.AddSeparateRow(null, ExpandContentWidth(), ExpandContentHeight(), null);
layout.Add(Default(), yscale: true);
layout.Add(ExpandedWidth(), yscale: true);
layout.Add(ExpandedHeight(), yscale: true);
Content = layout;
}