本文整理汇总了C#中Eto.Forms.DynamicLayout.BeginHorizontal方法的典型用法代码示例。如果您正苦于以下问题:C# DynamicLayout.BeginHorizontal方法的具体用法?C# DynamicLayout.BeginHorizontal怎么用?C# DynamicLayout.BeginHorizontal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eto.Forms.DynamicLayout
的用法示例。
在下文中一共展示了DynamicLayout.BeginHorizontal方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: MyForm
public MyForm()
{
this.ClientSize = new Size(600, 400);
this.Title = "Dynamic Layout";
// Using a DynamicLayout for a simple table is actually a lot easier to maintain than using a TableLayout
// and having to specify the x/y co-ordinates for each control added.
// 1. Create a new DynamicLayout object
var layout = new DynamicLayout();
// 2. Begin a horizontal row of controls
layout.BeginHorizontal();
// 3. Add controls for each column. We are setting xscale to true to make each column use an equal portion
// of the available space.
layout.Add(new Label { Text = "First Column" }, xscale: true);
layout.Add(new Label { Text = "Second Column" }, xscale: true);
layout.Add(new Label { Text = "Third Column" }, xscale: true);
// 4. End the horizontal section
layout.EndHorizontal();
// 5. To add a new row, begin another horizontal section and add more controls:
layout.BeginHorizontal();
layout.Add(new TextBox { Text = "Second Row, First Column" });
layout.Add(new ComboBox { DataStore = new ListItemCollection { new ListItem { Text = "Second Row, Second Column" } } });
layout.Add(new CheckBox { Text = "Second Row, Third Column" });
layout.EndHorizontal();
// 6. By default, the last row & column of a table expands to fill the rest of the space. We can add one
// last row with nothing in it to make the space empty. Since we are not in a horizontal group, calling
// Add() adds a new row.
layout.Add(null);
// 7. Set the content of the form to use the layout
Content = layout;
GenerateActions();
}
示例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: HorizontalSection
Control HorizontalSection ()
{
var layout = new DynamicLayout (new Panel { BackgroundColor = Color.Blue });
layout.BeginHorizontal ();
layout.Add (new Panel { Size = new Size (50, 60), BackgroundColor = Color.Green });
layout.Add (new Panel { Size = new Size (50, 60), BackgroundColor = Color.Green });
layout.EndHorizontal ();
return layout.Container;
}
示例12: OnPreLoad
protected override void OnPreLoad(EventArgs e)
{
var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };
var options = CreateOptions();
if (options != null)
layout.Add(options);
layout.BeginVertical();
layout.AddRow(null, LabelControl(), ButtonControl(), new Panel(), null);
layout.AddRow(null, TextBoxControl(), PasswordBoxControl());
layout.BeginHorizontal();
layout.Add(null);
layout.Add(TextAreaControl());
if (Platform.Supports<ListBox>())
layout.Add(ListBoxControl());
layout.EndHorizontal();
layout.AddRow(null, CheckBoxControl(), RadioButtonControl());
layout.AddRow(null, DateTimeControl(), NumericUpDownControl());
layout.AddRow(null, DropDownControl(), ComboBoxControl());
layout.BeginHorizontal();
layout.Add(null);
layout.Add(ColorPickerControl());
if (Platform.Supports<GroupBox>())
layout.Add(GroupBoxControl());
layout.EndHorizontal();
layout.AddRow(null, LinkButtonControl(), SliderControl());
layout.AddRow(null, DrawableControl(), ImageViewControl());
layout.EndVertical();
layout.Add(null);
Content = layout;
base.OnPreLoad(e);
}
示例13: MessageBoxSection
public MessageBoxSection()
{
MessageBoxText = "Some message";
MessageBoxCaption = "Some caption";
AttachToParent = true;
var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };
layout.AddSeparateRow(null, new Label { Text = "Caption" }, CaptionBox(), null);
layout.AddSeparateRow(null, new Label { Text = "Text" }, TitleBox(), null);
layout.BeginVertical();
layout.BeginHorizontal();
layout.Add(null);
layout.Add(new Label { Text = "Type", VerticalAlignment = VerticalAlignment.Center, TextAlignment = TextAlignment.Right });
layout.Add(MessageBoxTypeCombo());
layout.Add(AttachToParentCheckBox());
layout.Add(null);
layout.EndHorizontal();
layout.EndBeginVertical();
layout.BeginHorizontal();
layout.Add(null);
layout.Add(new Label { Text = "Buttons", VerticalAlignment = VerticalAlignment.Center, TextAlignment = TextAlignment.Right });
layout.Add(MessageBoxButtonsCombo());
layout.Add(new Label { Text = "Default Button", VerticalAlignment = VerticalAlignment.Center, TextAlignment = TextAlignment.Right });
layout.Add(MessageBoxDefaultButtonCombo());
layout.Add(null);
layout.EndHorizontal();
layout.EndVertical();
layout.AddSeparateRow(null, ShowDialogButton(), null);
layout.Add(null);
Content = layout;
}
示例14: MessageBoxSection
public MessageBoxSection()
{
MessageBoxText = "Some message";
MessageBoxCaption = "Some caption";
AttachToParent = true;
var layout = new DynamicLayout();
layout.AddSeparateRow(null, new Label { Text = "Caption" }, CaptionBox(), null);
layout.AddSeparateRow(null, new Label { Text = "Text" }, TitleBox(), null);
layout.BeginVertical(Padding.Empty);
layout.BeginHorizontal();
layout.Add(null);
layout.Add(new Label { Text = "Type", VerticalAlign = VerticalAlign.Middle, HorizontalAlign = HorizontalAlign.Right });
layout.Add(MessageBoxTypeCombo());
layout.Add(AttachToParentCheckBox());
layout.Add(null);
layout.EndHorizontal();
layout.EndBeginVertical();
layout.BeginHorizontal();
layout.Add(null);
layout.Add(new Label { Text = "Buttons", VerticalAlign = VerticalAlign.Middle, HorizontalAlign = HorizontalAlign.Right });
layout.Add(MessageBoxButtonsCombo());
layout.Add(new Label { Text = "Default Button", VerticalAlign = VerticalAlign.Middle, HorizontalAlign = HorizontalAlign.Right });
layout.Add(MessageBoxDefaultButtonCombo());
layout.Add(null);
layout.EndHorizontal();
layout.EndVertical();
layout.AddSeparateRow(null, ShowDialogButton(), null);
layout.Add(null);
Content = layout;
}
示例15: 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();
//rightMenu_Body
var rightMenuBody = new ContextMenu();
var findCommand = new Command
{
MenuText = StrRes.GetString("StrFind", "Find"),
Shortcut = Keys.F | Application.Instance.CommonModifier
};
findCommand.Executed += findCommand_Executed;
rightMenuBody.Items.Add(findCommand);
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);
// bug in gtk2
layout.ContextMenu = rightMenuBody;
layout.MouseUp += (sender, e) =>
{
if (e.Buttons == MouseButtons.Alternate)
{
layout.ContextMenu.Show(_textAreaBody);
}
};
Content = layout;
}