本文整理汇总了C#中Eto.Forms.DynamicLayout.AddCentered方法的典型用法代码示例。如果您正苦于以下问题:C# DynamicLayout.AddCentered方法的具体用法?C# DynamicLayout.AddCentered怎么用?C# DynamicLayout.AddCentered使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eto.Forms.DynamicLayout
的用法示例。
在下文中一共展示了DynamicLayout.AddCentered方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: 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 ());
}
示例3: AboutDialog
public AboutDialog()
{
this.MinimumSize = new Size(250, 250);
var smallFont = new Font(SystemFont.Default, 10);
var largeFont = new Font(SystemFont.Bold, 14);
var version = GetType().Assembly.GetName().Version;
var versionString = string.Format("Version {0}.{1} ({2}.{3})", version.Major, version.Minor, version.Build, version.Revision);
var layout = new DynamicLayout();
layout.AddCentered(new ImageView { Image = Icon.FromResource ("JabbR.Desktop.Resources.JabbR.ico"), Size = new Size(128, 128) }, yscale: true);
layout.AddCentered(new Label { Text = Application.Instance.Name, Font = largeFont });
layout.AddCentered(new Label { Text = versionString, Font = smallFont }, new Padding(2));
layout.AddCentered(new Label { Text = "Copyright © 2013 Curtis Wensley", Font = smallFont }, new Padding(2));
if (!Generator.IsMac)
{
layout.AddCentered(CloseButton());
}
Content = layout;
}
示例4: 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 ());
}
示例5: About
public About()
{
this.Title = AltStrRes.AboutAltman;
this.Resizable = false;
//this.Size = new Size(300, 300);
var layout = new DynamicLayout { Padding = new Padding(0, 0), Spacing = new Size(5, 5) };
layout.AddCentered(new ImageView
{
Image = Icons.AltmanAboutPng
}, padding: null, xscale: true, yscale: false);
//Version
layout.Add(new Label
{
Text = "Version",
Font = new Font(SystemFont.Bold, 10),
});
layout.Add(new Label
{
Text = " " + AppEnvironment.AppVersion,
Font = new Font(SystemFont.Default, 10),
});
//License
layout.Add(new Label
{
Text = "License",
Font = new Font(SystemFont.Bold, 10),
});
layout.Add(new Label
{
Text = " " + "Released under the GNU General Public License v2",
Font = new Font(SystemFont.Default, 10),
});
//Copyright
layout.Add(new Label
{
Text = "Copyright",
Font = new Font(SystemFont.Bold, 10),
});
layout.Add(new Label
{
Text = " " + "(C) 2013-2014 by KeePwn",
Font = new Font(SystemFont.Default, 10),
});
layout.AddCentered(CloseButton());
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();
//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;
}
示例7: RuntimeSection
public RuntimeSection ()
{
var layout = new DynamicLayout (this);
layout.AddCentered (ToggleButton ());
layout.Add (MainTable ());
}
示例8: CreateDialog
Dialog CreateDialog()
{
var dialog = new Dialog();
dialog.DisplayMode = DisplayMode;
var layout = new DynamicLayout();
layout.AddCentered(new Label { Text = "Content" }, yscale: true);
dialog.DefaultButton = new Button { Text = "Default Button" };
dialog.AbortButton = new Button { Text = "Abort Button" };
dialog.DefaultButton.Click += delegate
{
MessageBox.Show("Default button clicked");
};
dialog.AbortButton.Click += delegate
{
MessageBox.Show("Abort button clicked");
dialog.Close();
};
layout.BeginVertical();
layout.AddRow(null, dialog.DefaultButton, dialog.AbortButton);
layout.EndVertical();
dialog.Content = layout;
return dialog;
}
示例9: Vertical
Control Vertical()
{
var control = SetInitialValue();
control.Size = new Size(-1, 150);
control.Orientation = SliderOrientation.Vertical;
var layout = new DynamicLayout();
layout.AddCentered(control);
return layout;
}
示例10: RuntimeSection
public RuntimeSection()
{
var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };
layout.AddCentered(ToggleButton());
layout.Add(MainTable());
Content = layout;
}
示例11: Init
void Init()
{
_textAreaInput = new TextArea();
_textAreaInput.Font = new Font(FontFamilies.Monospace, 10);
_dropDownServices = new DropDown {Width = 200};
_dropDownServices.SelectedIndexChanged += DropDownServicesSelectedIndexChanged;
_radioButtonEncode = new RadioButton {Text = "Encode"};
_radioButtonEncode.CheckedChanged += _radioButtonEncode_CheckedChanged;
_radioButtonDecode = new RadioButton(_radioButtonEncode) {Text = "Decode"};
_buttonRun = new Button { Text = "Run" };
_buttonRun.Click += _buttonRun_Click;
_textAreaOutput = new TextArea();
_textAreaOutput.Font = new Font(FontFamilies.Monospace, 10);
var inputLayout = new DynamicLayout {Padding = new Padding(5, 5, 5, 0), Spacing = new Size(5, 5)};
inputLayout.AddSeparateRow(_textAreaInput);
var outputLayout = new DynamicLayout {Padding = new Padding(5, 5), Spacing = new Size(5, 5)};
outputLayout.BeginVertical();
outputLayout.BeginHorizontal();
outputLayout.AddCentered(_radioButtonEncode, horizontalCenter: false);
outputLayout.AddCentered(_radioButtonDecode, horizontalCenter: false);
outputLayout.Add(null);
outputLayout.AddCentered(_dropDownServices, horizontalCenter: false);
outputLayout.AddCentered(_buttonRun, horizontalCenter: false);
outputLayout.EndHorizontal();
outputLayout.EndVertical();
outputLayout.AddSeparateRow(_textAreaOutput);
var layout = new Splitter
{
Panel1 = inputLayout,
Panel2 = outputLayout,
Orientation = SplitterOrientation.Vertical,
Position = 130
};
Content = layout;
}
示例12: About
public About()
{
this.Title = "About Eto Test";
this.Resizable = true;
var layout = new DynamicLayout { Padding = new Padding(20, 5), Spacing = new Size(10, 10) };
layout.AddCentered(new ImageView
{
Image = Icon.FromResource ("Eto.Test.TestIcon.ico", GetType())
}, padding: null, xscale: true, yscale: true);
layout.Add(new Label
{
Text = "Test Application",
Font = new Font(SystemFont.Bold, 20),
HorizontalAlign = HorizontalAlign.Center
});
#if PCL
var version = GetType().GetTypeInfo().Assembly.GetName().Version;
#else
var version = Assembly.GetEntryAssembly().GetName().Version;
#endif
layout.Add(new Label
{
Text = string.Format("Version {0}", version),
Font = new Font(SystemFont.Default, 10),
HorizontalAlign = HorizontalAlign.Center
});
layout.Add(new Label
{
Text = "Copyright 2013 by Curtis Wensley aka Eto",
Font = new Font(SystemFont.Default, 10),
HorizontalAlign = HorizontalAlign.Center
});
layout.AddCentered(CloseButton());
Content = layout;
}
示例13: SplitterSection
public SplitterSection()
{
var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };
layout.Add(null);
var xthemed = new CheckBox { Text = "Use Themed Splitter" };
layout.AddCentered(xthemed);
layout.AddSeparateRow(null, Test1WithSize(), Test1AutoSize(), null);
layout.AddSeparateRow(null, Test1WithFullScreenAndSize(), Test1FullScreenAndAutoSize(), null);
layout.AddSeparateRow(null, Test2WithSize(), Test2AutoSize(), null);
layout.AddCentered(TestDynamic());
layout.AddCentered(TestInitResize());
layout.AddCentered(TestHiding());
layout.Add(null);
Content = layout;
xthemed.CheckedChanged += (s, e) =>
{
useThemed = xthemed.Checked == true;
};
}
示例14: PenSection
public PenSection()
{
PenThickness = 4;
var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };
layout.AddSeparateRow(null, PenJoinControl(), PenCapControl(), DashStyleControl(), null);
if (Platform.Supports<NumericUpDown>())
layout.AddSeparateRow(null, PenThicknessControl(), null);
layout.AddCentered(GetDrawable());
Content = layout;
}
示例15: PickFontFamily
Control PickFontFamily()
{
var fontFamilyName = new TextBox { Text = "Times, serif", Size = new Size (200, -1) };
var button = new Button { Text = "Set" };
button.Click += (sender, e) => {
try
{
UpdatePreview(new Font(fontFamilyName.Text, selectedFont.Size));
}
catch (Exception ex)
{
Log.Write(this, "Exception: {0}", ex);
}
};
var layout = new DynamicLayout(Padding.Empty);
layout.BeginHorizontal();
layout.AddCentered(fontFamilyName, Padding.Empty, Size.Empty);
layout.AddCentered(button, Padding.Empty, Size.Empty);
return layout;
}