本文整理汇总了C#中Xwt.HBox.PackEnd方法的典型用法代码示例。如果您正苦于以下问题:C# HBox.PackEnd方法的具体用法?C# HBox.PackEnd怎么用?C# HBox.PackEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xwt.HBox
的用法示例。
在下文中一共展示了HBox.PackEnd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SubmitFeedbackWindow
public SubmitFeedbackWindow(string category)
{
Icon = App.Icon;
Title = "Thanks for your feedback!";
Resizable = false;
VBox vbox = new VBox();
var text = new TextEntry()
{
MinWidth = 500,
MinHeight = 200,
MultiLine = true,
Text = ""
};
vbox.PackStart(text);
{
HBox box = new HBox();
Button btn;
box.PackEnd(btn = new Button(" Cancel "));
btn.Clicked += (s, e) => { Close(); };
box.PackEnd(btn = new Button(" Submit "));
btn.Clicked += (s, e) =>
{
string feedback = text.Text;
new Task(() =>
{
if (feedback.Length > 10)
{
string URL = "http://yuhrney.square7.ch/4Plug/feedback.php";
WebClient webClient = new WebClient();
webClient.Proxy = null;
NameValueCollection formData = new NameValueCollection();
formData["feedback"] = string.Format("{3} - {1} {2}\n{5}\n{4}", App.WindowTitle, Environment.OSVersion.Platform, Xwt.Toolkit.CurrentEngine.Type, DateTime.Now.ToString("dd MMM HH:mm:ss", CultureInfo.InvariantCulture), feedback, category).Trim();
byte[] responseBytes = webClient.UploadValues(URL, "POST", formData);
string responsefromserver = Encoding.UTF8.GetString(responseBytes);
Console.WriteLine(responsefromserver);
webClient.Dispose();
}
}).Start();
Close();
};
vbox.PackStart(box);
Content = vbox;
}
}
示例2: Boxes
public Boxes()
{
HBox box1 = new HBox ();
VBox box2 = new VBox ();
box2.PackStart (new SimpleBox (30), BoxMode.None);
box2.PackStart (new SimpleBox (30), BoxMode.None);
box2.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
box1.PackStart (box2, BoxMode.FillAndExpand);
box1.PackStart (new SimpleBox (30), BoxMode.None);
box1.PackStart (new SimpleBox (30), BoxMode.Expand);
PackStart (box1, BoxMode.None);
HBox box3 = new HBox ();
box3.PackEnd (new SimpleBox (30));
box3.PackStart (new SimpleBox (20) {Color = new Color (1, 0.5, 0.5)});
box3.PackEnd (new SimpleBox (40));
box3.PackStart (new SimpleBox (10) {Color = new Color (1, 0.5, 0.5)});
box3.PackEnd (new SimpleBox (30));
box3.PackStart (new SimpleBox (10) {Color = new Color (1, 0.5, 0.5)}, BoxMode.FillAndExpand);
PackStart (box3);
HBox box4 = new HBox ();
Button b = new Button ("Click me");
b.Clicked += delegate {
b.Label = "Button has grown";
};
box4.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
box4.PackStart (b);
box4.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
PackStart (box4);
HBox box5 = new HBox ();
Button b2 = new Button ("Hide / Show");
box5.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
var hsb = new SimpleBox (20);
box5.PackStart (hsb, BoxMode.None);
box5.PackStart (b2);
box5.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
b2.Clicked += delegate {
hsb.Visible = !hsb.Visible;
};
PackStart (box5);
HBox box6 = new HBox ();
for (int n=0; n<15; n++) {
var w = new Label ("TestLabel" + n);
w.MinWidth = 10;
box6.PackStart (w);
}
PackStart (box6);
}
示例3: ReferenceImageVerifierDialog
public ReferenceImageVerifierDialog()
{
Width = 500;
Height = 300;
Table table = new Table ();
table.DefaultRowSpacing = table.DefaultColumnSpacing = 6;
table.Add (nameLabel = new Label (), 0, 0, hexpand:true);
table.Add (new Label ("Reference Image"), 0, 1, hexpand:true);
table.Add (new Label ("Test Image"), 1, 1, hexpand:true);
nameLabel.Font = nameLabel.Font.WithWeight (Xwt.Drawing.FontWeight.Bold);
img1 = new ImageView ();
table.Add (img1, 0, 2, hexpand:true, vexpand:true);
imgDiff = new ImageView ();
table.Add (imgDiff, 1, 2, hexpand:true, vexpand:true);
img2 = new ImageView ();
table.Add (img2, 2, 2, hexpand:true, vexpand:true);
var buttonBox = new HBox ();
table.Add (buttonBox, 0, 3, colspan:2, hexpand:true);
closeButton = new Button ("Close");
validButton = new Button ("Success");
failButton = new Button ("Failure");
buttonBox.PackEnd (closeButton);
buttonBox.PackEnd (failButton);
buttonBox.PackEnd (validButton);
closeButton.Clicked += delegate {
Respond (Command.Ok);
};
failButton.Clicked += delegate {
var info = ReferenceImageManager.ImageFailures[currentImage];
info.Fail ();
ShowNextImage ();
};
validButton.Clicked += delegate {
var info = ReferenceImageManager.ImageFailures[currentImage];
info.Validate ();
ShowNextImage ();
};
Content = table;
ShowNextImage ();
}
示例4: ListView
void IOptionsPanel.Initialize (OptionsDialog dialog, object dataObject)
{
this.ExpandHorizontal = true;
this.ExpandVertical = true;
this.HeightRequest = 400;
list = new ListView ();
store = new ListStore (language, completeOnSpace, completeOnChars);
var languageColumn = list.Columns.Add (GettextCatalog.GetString ("Language"), language);
languageColumn.CanResize = true;
var checkBoxCellView = new CheckBoxCellView (completeOnSpace);
checkBoxCellView.Editable = true;
var completeOnSpaceColumn = list.Columns.Add (GettextCatalog.GetString ("Complete on space"), checkBoxCellView);
completeOnSpaceColumn.CanResize = true;
var textCellView = new TextCellView (completeOnChars);
textCellView.Editable = true;
var doNotCompleteOnColumn = list.Columns.Add (GettextCatalog.GetString ("Do complete on"), textCellView);
doNotCompleteOnColumn.CanResize = true;
list.DataSource = store;
PackStart (list, true, true);
var hbox = new HBox ();
var button = new Button ("Reset to default");
button.Clicked += delegate {
FillStore (CompletionCharacters.GetDefaultCompletionCharacters ());
};
hbox.PackEnd (button, false, false);
PackEnd (hbox, false, true);
FillStore (CompletionCharacters.GetCompletionCharacters ());
}
示例5: BuildGui
void BuildGui()
{
this.Title = GettextCatalog.GetString("Select Work Item");
VBox content = new VBox();
HBox mainBox = new HBox();
queryView.Columns.Add(new ListViewColumn(string.Empty, new TextCellView(titleField)));
queryView.DataSource = queryStore;
queryView.WidthRequest = 200;
BuildQueryView();
mainBox.PackStart(queryView);
workItemList.WidthRequest = 400;
workItemList.HeightRequest = 400;
workItemList.ShowCheckboxes = true;
mainBox.PackStart(workItemList, true, true);
content.PackStart(mainBox, true, true);
HBox buttonBox = new HBox();
Button okButton = new Button(GettextCatalog.GetString("Ok"));
okButton.WidthRequest = Constants.ButtonWidth;
okButton.Clicked += (sender, e) => Respond(Command.Ok);
buttonBox.PackEnd(okButton);
content.PackStart(buttonBox);
//this.Resizable = false;
this.Content = content;
AttachEvents();
}
示例6: LauncherWindow
public LauncherWindow()
{
this.Title = "TrueCraft Launcher";
this.Width = 1200;
this.Height = 576;
this.User = new TrueCraftUser();
MainContainer = new HBox();
WebScrollView = new ScrollView();
WebView = new WebView("http://truecraft.io/updates");
LoginView = new LoginView(this);
OptionView = new OptionView(this);
MultiplayerView = new MultiplayerView(this);
SingleplayerView = new SingleplayerView(this);
InteractionBox = new VBox();
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TrueCraft.Launcher.Content.truecraft_logo.svg"))
TrueCraftLogoImage = new ImageView(Image.FromStream(stream));
WebScrollView.Content = WebView;
MainContainer.PackStart(WebScrollView, true);
InteractionBox.PackStart(TrueCraftLogoImage);
InteractionBox.PackEnd(LoginView);
MainContainer.PackEnd(InteractionBox);
this.Content = MainContainer;
}
示例7: DragDrop
public DragDrop()
{
HBox box = new HBox ();
SimpleBox b1 = new SimpleBox (30);
box.PackStart (b1, BoxMode.None);
b2 = new Button ("Drop here");
box.PackEnd (b2, BoxMode.None);
b1.ButtonPressed += delegate {
var d = b1.CreateDragOperation ();
d.Data.AddValue ("Hola");
var img = Image.FromResource (GetType(), "class.png");
d.SetDragImage (img, (int)img.Size.Width, (int)img.Size.Height);
d.AllowedActions = DragDropAction.All;
d.Start ();
};
b2.SetDragDropTarget (TransferDataType.Text, TransferDataType.Uri);
PackStart (box);
b2.DragDrop += HandleB2DragDrop;
b2.DragOver += HandleB2DragOver;
}
示例8: MainView
public MainView(IPresenterFactory presenterFactory)
{
_notebook = presenterFactory.InstantiatePresenter<MainNotebook>();
_notebook.Add(presenterFactory.InstantiatePresenter<MenuPageView>(this));
_notebook.Add(presenterFactory.InstantiatePresenter<ModsPageView>(this));
_notebook.Add(presenterFactory.InstantiatePresenter<BlueprintsPageView>(this));
_notebook.Add(presenterFactory.InstantiatePresenter<SavegamesPageView>(this));
_notebook.Add(presenterFactory.InstantiatePresenter<TasksPageView>(this));
PackStart(presenterFactory.InstantiatePresenter<MainHeaderView>());
var sideBox = new VBox
{
MinWidth = 280,
WidthRequest = 280
};
_sidebarContainer = new SidebarContainer();
sideBox.PackStart(_sidebarContainer, true, true);
var box = new HBox();
box.PackStart(_notebook, true);
box.PackEnd(sideBox);
PackStart(box, true, true);
_notebook.HandleSizeChangeOnTabChange = true;
_notebook.HandleSizeUpdate();
}
示例9: SplashWindow
public SplashWindow()
{
Icon = App.Icon;
Width = 550;
Title = "4Plug First Use";
Resizable = false;
VBox V = new VBox();
Content = V;
Label lbl;
lbl = new Label("A small introduction.") { Font = Font.FromName("Segoe UI Light 24"), TextColor = PluginType.Vpk.GetColor() };
V.PackStart(lbl);
lbl = new Label("This tool allows you to quickly enable/disable mods as well as install new ones.");
V.PackStart(lbl);
lbl = new Label(""); V.PackStart(lbl);
lbl = new Label("This is what a mod looks like in 4Plug!") { Font = Font.FromName("Segoe UI Light 24"), TextColor = PluginType.Unknown.GetColor() };
V.PackStart(lbl);
lbl = new Label("You can enable/disable mods by clicking on the image.");
V.PackStart(lbl);
//lbl = new Label("Uninstalled mods are saved in the \"custom_\" instead of the \"custom\" folder of you game.");
//V.PackStart(lbl);
lbl = new Label("");
DummyPluginWidget dummy = new DummyPluginWidget(lbl);
dummy.MarginTop += 16;
dummy.MarginBottom += 8;
V.PackStart(dummy);
V.PackStart(lbl);
lbl = new Label(""); V.PackStart(lbl);
{
HBox box = new HBox();
Button btn;
btn = new Button(" Got it! ");
box.PackEnd(btn);
btn.Clicked += (s, e) => { Close(); };
Label lbl2;
lbl2 = new Label(" Feel free to leave feedback (mainmenu -> submit feedback) later ");
box.PackStart(lbl2);
//btn.Clicked += (s, e) => { new SubmitFeedbackWindow("via Splash Window").Run(); };
V.PackStart(box);
}
}
示例10: LauncherWindow
public LauncherWindow()
{
this.Title = "TrueCraft Launcher";
this.Width = 1200;
this.Height = 576;
this.User = new TrueCraftUser();
MainContainer = new HBox();
WebScrollView = new ScrollView();
WebView = new WebView("http://truecraft.io/updates");
LoginView = new LoginView(this);
OptionView = new OptionView(this);
MultiplayerView = new MultiplayerView(this);
SingleplayerView = new SingleplayerView(this);
WebScrollView.Content = WebView;
MainContainer.PackStart(WebScrollView, true);
MainContainer.PackEnd(LoginView);
this.Content = MainContainer;
}
示例11: HelpWindow
public HelpWindow()
{
VBox mainContent = new VBox ();
_messageDisplay = new RichTextView {
WidthRequest = 500
};
ScrollView scroller = new ScrollView (_messageDisplay) {
VerticalScrollPolicy = ScrollPolicy.Automatic,
HorizontalScrollPolicy = ScrollPolicy.Never,
HeightRequest = 500
};
mainContent.PackStart (scroller);
HBox buttonRow = new HBox ();
Button ok = new Button {
Label = I18N._ ("Close"),
Image = Icons.Ok
};
ok.Clicked += (sender, args) => Close ();
buttonRow.PackEnd (ok);
mainContent.PackEnd (buttonRow);
Content = mainContent;
Width = 400;
}
示例12: BuildContent
void BuildContent(string license)
{
double textWidth = 480;
double textHeight = 480;
VBox mainContent = new VBox ();
RichTextView textView = new RichTextView ();
textView.LoadText (license, TextFormat.Markdown);
textView.MinWidth = textWidth;
ScrollView scroller = new ScrollView (textView);
scroller.HorizontalScrollPolicy = ScrollPolicy.Never;
scroller.VerticalScrollPolicy = ScrollPolicy.Automatic;
scroller.MinHeight = textHeight;
scroller.MinWidth = textWidth + textView.MarginLeft + textView.MarginRight + 20;
mainContent.PackStart (scroller);
HBox buttonRow = new HBox ();
Button ok = new Button { Label = I18N._ ("Close"), Image = Icons.Ok };
ok.Clicked += (sender, args) => Close ();
buttonRow.PackEnd (ok);
mainContent.PackEnd (buttonRow);
Content = mainContent;
}
示例13: ColorPopover
public ColorPopover(ColorPicker picker)
{
this.picker = picker;
OriginalColor = picker.Color;
var h = new HBox();
var leftBox = new VBox();
h.PackStart(leftBox);
Content = h;
{
HBox box = new HBox();
box.PackStart(new Label("R") { WidthRequest = 50 });
box.PackStart(rSlider = new HSlider() { WidthRequest = 100, MinimumValue = 0, MaximumValue = 255 });
box.PackStart(rText = new TextEntry() { WidthRequest = 50 });
leftBox.PackStart(box);
}
{
HBox box = new HBox();
box.PackStart(new Label("G") { WidthRequest = 50 });
box.PackStart(gSlider = new HSlider() { WidthRequest = 100, MinimumValue = 0, MaximumValue = 255 });
box.PackStart(gText = new TextEntry() { WidthRequest = 50 });
leftBox.PackStart(box);
}
{
HBox box = new HBox();
box.PackStart(new Label("B") { WidthRequest = 50 });
box.PackStart(bSlider = new HSlider() { WidthRequest = 100, MinimumValue = 0, MaximumValue = 255 });
box.PackStart(bText = new TextEntry() { WidthRequest = 50 });
leftBox.PackStart(box);
}
{
HBox box = new HBox();
box.PackStart(new Label("Alpha") { WidthRequest = 50 });
box.PackStart(aSlider = new HSlider() { WidthRequest = 100, MinimumValue = 0, MaximumValue = 255 });
box.PackStart(aText = new TextEntry() { WidthRequest = 50 });
leftBox.PackStart(box);
}
EventHandler setSlider = (s, e) => { if (enableEvents) SetColor(Color.FromBytes((byte)rSlider.Value, (byte)gSlider.Value, (byte)bSlider.Value, (byte)aSlider.Value), (Widget)s); };
rSlider.ValueChanged += setSlider;
gSlider.ValueChanged += setSlider;
bSlider.ValueChanged += setSlider;
aSlider.ValueChanged += setSlider;
rText.Changed += (s, e) => { if (enableEvents) { byte i; if (byte.TryParse(rText.Text, out i)) SetColor(Color.FromBytes(i, (byte)gSlider.Value, (byte)bSlider.Value, (byte)aSlider.Value), rText); } };
gText.Changed += (s, e) => { if (enableEvents) { byte i; if (byte.TryParse(gText.Text, out i)) SetColor(Color.FromBytes((byte)rSlider.Value, i, (byte)bSlider.Value, (byte)aSlider.Value), gText); } };
bText.Changed += (s, e) => { if (enableEvents) { byte i; if (byte.TryParse(bText.Text, out i)) SetColor(Color.FromBytes((byte)rSlider.Value, (byte)gSlider.Value, i, (byte)aSlider.Value), bText); } };
aText.Changed += (s, e) => { if (enableEvents) { byte i; if (byte.TryParse(aText.Text, out i)) SetColor(Color.FromBytes((byte)rSlider.Value, (byte)gSlider.Value, (byte)bSlider.Value, i), aText); } };
{
HBox box = new HBox();
TextEntry text;
hexText = text = new TextEntry();
text.Changed += (s, e) =>
{
if (enableEvents)
{
Color c;
if (App.TryParseColor(hexText.Text, out c))
SetColor(c, hexText);
}
};
box.PackStart(text);
sourceText = text = new TextEntry();
text.Changed += (s, e) =>
{
if (enableEvents)
{
Color c;
if (App.TryParseColor(sourceText.Text, out c))
SetColor(c, sourceText);
}
};
box.PackStart(text);
leftBox.PackStart(box);
}
{
HBox box = new HBox();
Button btn;
btn = new Button(" Reset to Default ");
btn.Clicked += (s, e) => { picker.Color = picker.DefaultColor; };
box.PackEnd(btn);
btn = new Button(" Discard Changes ");
btn.Clicked += (s, e) => { picker.Color = OriginalColor; };
box.PackEnd(btn);
leftBox.PackStart(box);
}
}
示例14: Build
void Build ()
{
Title = Catalog.GetString ("Add Packages");
Width = 820;
Height = 520;
Padding = new WidgetSpacing ();
// Top part of dialog:
// Package sources and search.
var topHBox = new HBox ();
topHBox.Margin = new WidgetSpacing (8, 5, 6, 5);
packageSourceComboBox = new ComboBox ();
packageSourceComboBox.MinWidth = 200;
topHBox.PackStart (packageSourceComboBox);
packageSearchEntry = new SearchTextEntry ();
packageSearchEntry.WidthRequest = 187;
topHBox.PackEnd (packageSearchEntry);
this.HeaderContent = topHBox;
// Middle of dialog:
// Packages and package information.
var mainVBox = new VBox ();
Content = mainVBox;
var middleHBox = new HBox ();
middleHBox.Spacing = 0;
var middleFrame = new FrameBox ();
middleFrame.Content = middleHBox;
middleFrame.BorderWidth = new WidgetSpacing (0, 0, 0, 1);
middleFrame.BorderColor = lineBorderColor;
mainVBox.PackStart (middleFrame, true, true);
// Error information.
var packagesListVBox = new VBox ();
packagesListVBox.Spacing = 0;
errorMessageHBox = new HBox ();
errorMessageHBox.Margin = new WidgetSpacing ();
errorMessageHBox.BackgroundColor = Colors.Orange;
errorMessageHBox.Visible = false;
var errorImage = new ImageView ();
errorImage.Margin = new WidgetSpacing (10, 0, 0, 0);
errorImage.Image = ImageService.GetIcon (Stock.Warning, Gtk.IconSize.Menu);
errorImage.HorizontalPlacement = WidgetPlacement.End;
errorMessageHBox.PackStart (errorImage);
errorMessageLabel = new Label ();
errorMessageLabel.TextColor = Colors.White;
errorMessageLabel.Margin = new WidgetSpacing (5, 5, 5, 5);
errorMessageLabel.Wrap = WrapMode.Word;
errorMessageHBox.PackStart (errorMessageLabel, true);
packagesListVBox.PackStart (errorMessageHBox);
// Packages list.
middleHBox.PackStart (packagesListVBox, true, true);
packagesListView = new ListView ();
packagesListView.BorderVisible = false;
packagesListView.HeadersVisible = false;
packagesListVBox.PackStart (packagesListView, true, true);
// Loading spinner.
var loadingSpinnerHBox = new HBox ();
loadingSpinnerHBox.HorizontalPlacement = WidgetPlacement.Center;
var loadingSpinner = new Spinner ();
loadingSpinner.Animate = true;
loadingSpinner.MinWidth = 20;
loadingSpinnerHBox.PackStart (loadingSpinner);
loadingSpinnerLabel = new Label ();
loadingSpinnerLabel.Text = Catalog.GetString ("Loading package list...");
loadingSpinnerHBox.PackEnd (loadingSpinnerLabel);
loadingSpinnerFrame = new FrameBox ();
loadingSpinnerFrame.Visible = false;
loadingSpinnerFrame.BackgroundColor = Colors.White;
loadingSpinnerFrame.Content = loadingSpinnerHBox;
loadingSpinnerFrame.BorderWidth = new WidgetSpacing ();
packagesListVBox.PackStart (loadingSpinnerFrame, true, true);
// No packages found label.
var noPackagesFoundHBox = new HBox ();
noPackagesFoundHBox.HorizontalPlacement = WidgetPlacement.Center;
var noPackagesFoundLabel = new Label ();
noPackagesFoundLabel.Text = Catalog.GetString ("No matching packages found.");
noPackagesFoundHBox.PackEnd (noPackagesFoundLabel);
noPackagesFoundFrame = new FrameBox ();
noPackagesFoundFrame.Visible = false;
noPackagesFoundFrame.BackgroundColor = Colors.White;
noPackagesFoundFrame.Content = noPackagesFoundHBox;
noPackagesFoundFrame.BorderWidth = new WidgetSpacing ();
packagesListVBox.PackStart (noPackagesFoundFrame, true, true);
// Package information
packageInfoVBox = new VBox ();
var packageInfoFrame = new FrameBox ();
packageInfoFrame.BackgroundColor = packageInfoBackgroundColor;
packageInfoFrame.BorderWidth = new WidgetSpacing ();
//.........这里部分代码省略.........
示例15: BuildContent
void BuildContent()
{
_configTable = new Table { MinWidth = 300 };
ScrollView scrollView = new ScrollView (_configTable) {
ExpandHorizontal = true,
ExpandVertical = true,
HorizontalScrollPolicy = ScrollPolicy.Never,
MinHeight = 300,
MinWidth = 300
};
HBox buttonBox = new HBox ();
_addButton = new Button (I18N._ ("Add")) { Image = Icons.Add };
_okButton = new Button (I18N._ ("Save")) { Image = Icons.Ok };
_cancelButton = new Button (I18N._ ("Cancel")) {
Image = Icons.Cancel,
Style = ButtonStyle.Flat
};
_undoButton = new Button (I18N._ ("Undo")) {
Image = Icons.Undo,
Style = ButtonStyle.Flat,
Visible = false
};
buttonBox.PackEnd (_okButton);
buttonBox.PackEnd (_addButton);
buttonBox.PackStart (_cancelButton);
buttonBox.PackStart (_undoButton);
VBox box = new VBox ();
box.PackStart (scrollView, true, true);
box.PackEnd (buttonBox);
Content = box;
}