Widget CreateButtonBox() { var buttons = new HButtonBox { Layout = ButtonBoxStyle.End, Spacing = 18 }; var copy = new Button(Stock.Copy); copy.Clicked += CopyClicked; copy.Show(); buttons.PackStart(copy, false, true, 0); var close = new Button(Stock.Close); close.Activated += CloseClicked; close.Clicked += CloseClicked; close.Show(); buttons.PackStart(close, false, true, 0); buttons.Show(); return(buttons); }
public NewSearchPage() : base(0.5f, 0.5f, 0f, 0f) { base.SetPadding(36, 36, 36, 36); base.FocusGrabbed += base_FocusGrabbed; mainVBox = new VBox(); Label label = new Label(); label.Xalign = 0; label.Markup = "<span size=\"x-large\" weight=\"bold\">Search for files...</span>"; mainVBox.PackStart(label, false, false, 0); label.Show(); searchEntry = new FileSearchEntry(); searchEntry.WidthRequest = 400; mainVBox.PackStart(searchEntry, false, false, 6); searchEntry.Show(); searchButton = new Button("_Search"); searchButton.Image = new Image(Stock.Find, IconSize.Button); searchButton.Clicked += searchButton_Clicked; searchButton.Show(); HButtonBox buttonBox = new HButtonBox(); buttonBox.Layout = ButtonBoxStyle.End; buttonBox.PackStart(searchButton, false, false, 0); mainVBox.PackStart(buttonBox, false, false, 0); buttonBox.Show(); base.Add(mainVBox); mainVBox.Show(); }
public HistogramViewWindow(Gdk.Pixbuf[] img, Gdk.Pixbuf[] thumbs, int[] cat) { this.img = img; this.cat = cat; Glade.XML gxml = new Glade.XML(Assembly.GetExecutingAssembly(), "HistogramView.glade", "HVWindow", null); gxml.BindFields(this); HVWindow.DeleteEvent += CloseWindow; CloseButton.Clicked += CloseWindow; CounterText.Text = String.Format(Catalog.GetPluralString("<i>Viewing {0} image histogram</i>", "<i>Viewing {0} image histograms</i>", img.Length), img.Length); CounterText.UseMarkup = true; ShowImage(0); HButtonBox hb = new HButtonBox(); hb.Layout = ButtonBoxStyle.Start; for (int i = 0; i < thumbs.Length; i++) { ImageButton b = new ImageButton(new Image(thumbs[i]), i); b.Clicked += OnClicked; hb.PackEnd(b, false, false, 0); } ImageListSocket.AddWithViewport(hb); HVWindow.ShowAll(); }
public DialogWidget(params object[]data) : base() { box = new VBox (); actionArea = new HButtonBox (); actionArea.LayoutStyle = ButtonBoxStyle.End; buttons = new Button[data.Length / 2]; response_ids = new int[data.Length / 2]; for (int i = 0; i < data.Length; i += 2) { Button button = new Button (data[i] as string); button.Clicked += OnClicked; actionArea.PackStart (button, false, false, 4); buttons[i / 2] = button; response_ids[i / 2] = (int) data[i + 1]; } PackStart (box, true, true, 4); PackStart (actionArea, false, true, 4); ShowAll (); }
public ExceptionCaughtDialog(ExceptionInfo val, ExceptionCaughtMessage msg) { Title = GettextCatalog.GetString("Exception Caught"); ex = val; widget = new ExceptionCaughtWidget(val); this.msg = msg; VBox box = new VBox(); box.Spacing = 6; box.PackStart(widget, true, true, 0); HButtonBox buttonBox = new HButtonBox(); buttonBox.BorderWidth = 6; var copy = new Gtk.Button(GettextCatalog.GetString("Copy to Clipboard")); buttonBox.PackStart(copy, false, false, 0); copy.Clicked += HandleCopyClicked; var close = new Gtk.Button(GettextCatalog.GetString("Close")); buttonBox.PackStart(close, false, false, 0); close.Clicked += (sender, e) => msg.Close(); close.Activated += (sender, e) => msg.Close(); box.PackStart(buttonBox, false, false, 0); VBox.Add(box); DefaultWidth = 500; DefaultHeight = 350; box.ShowAll(); ActionArea.Hide(); }
void ShowEditor(Editor editor) { SetupEditor(editor); current_editor = editor; buttons.Hide(); // Top label var vbox = new VBox(false, 4); var label = new Label { Markup = $"<big><b>{editor.Label}</b></big>" }; vbox.PackStart(label, false, false, 5); // Optional config widget var config = editor.ConfigurationWidget(); if (config != null) { // This is necessary because GtkBuilder widgets need to be // reparented. if (config.Parent != null) { config.Reparent(vbox); } else { vbox.PackStart(config, false, false, 0); } } // Apply / Cancel buttons var tool_buttons = new HButtonBox { LayoutStyle = ButtonBoxStyle.End, Spacing = 5, BorderWidth = 5, Homogeneous = false }; var cancel = new Button(Stock.Cancel); cancel.Clicked += HandleCancel; tool_buttons.Add(cancel); var apply = new Button(editor.ApplyLabel) { // FIXME, Theme icon //Image = new Image (GtkUtil.TryLoadIcon (Settings.Global.IconTheme, editor.IconName, 22, 0)) }; apply.Clicked += (s, e) => { Apply(editor); }; tool_buttons.Add(apply); // Pack it all together vbox.PackEnd(tool_buttons, false, false, 0); active_editor = vbox; widgets.Add(active_editor); active_editor.ShowAll(); }
private void FillButtonBoxes() { buttonBox = new HButtonBox(); //buttonBox.Layout = ButtonBoxStyle.Spread; //buttonBox.LayoutStyle = ButtonBoxStyle.Spread; //buttonBox.Spacing = 6; switch (CurrentButtons) { case Buttons.Answer: CreateAnswerButtons(); break; case Buttons.Category: CreateCategoryButtons(); break; case Buttons.Question: CreateQuestionButtons(); break; case Buttons.End: CreateEndButtons(); break; default: break; } }
public MainWindow() : base(WindowType.Toplevel) { VBox vBox = new VBox(); _swf = new Swfdec.GtkWidget(new Player(null)); _swf.SetSizeRequest(400, 300); vBox.PackStart(_swf); HButtonBox btnBox = new HButtonBox(); Button btnOpen = new Button(); btnOpen.Label = "Open"; btnOpen.Clicked += ButtonOpenClicked; btnBox.Add(btnOpen); vBox.PackStart(btnBox, false, false, 3); Add(vBox); WindowPosition = Gtk.WindowPosition.Center; DeleteEvent += OnDeleteEvent; }
/// <summary> /// Set up the UI inside the Window /// </summary> private void InitializeWidgets(Manager simiasManager) { this.SetDefaultSize(480, 550); // Create an extra vbox to add the spacing EventBox prefsWindow = new EventBox(); prefsWindow.ModifyBg(StateType.Normal, this.Style.Background(StateType.Normal)); VBox winBox = new VBox(); //this.Add (winBox); prefsWindow.Add(winBox); this.Add(prefsWindow); winBox.BorderWidth = 7; winBox.Spacing = 7; this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png")); this.WindowPosition = Gtk.WindowPosition.Center; //----------------------------- // Set up the Notebook (tabs) //----------------------------- PrefNoteBook = new Notebook(); generalPage = new PrefsGeneralPage(this, ifws); PrefNoteBook.AppendPage(generalPage, new Label(Util.GS("General"))); accountsPage = new PrefsAccountsPage(this); PrefNoteBook.AppendPage(accountsPage, new Label(Util.GS("Accounts"))); /*migrationPage =*/ new MigrationPage(this, ifws); // PrefNoteBook.AppendPage( migrationPage, new Label(Util.GS("Migration"))); PrefNoteBook.SwitchPage += new SwitchPageHandler(OnSwitchPageEvent); winBox.PackStart(PrefNoteBook, true, true, 0); HButtonBox buttonBox = new HButtonBox(); buttonBox.BorderWidth = 10; buttonBox.Spacing = 10; buttonBox.Layout = ButtonBoxStyle.Edge; winBox.PackStart(buttonBox, false, false, 0); Button helpButton = new Button(Gtk.Stock.Help); buttonBox.PackStart(helpButton); helpButton.Clicked += new EventHandler(HelpEventHandler); Button closeButton = new Button(Gtk.Stock.Close); buttonBox.PackStart(closeButton); closeButton.Clicked += new EventHandler(CloseEventHandler); }
public Contact(Hashtable contact) : base(false, 10) { HBox hbox; Table table; Button button; HButtonBox hbuttonbox; this.contact = contact; // Create header containing an icon and display name hbox = new HBox(); hbox.Spacing = 10; hbox.PackStart(Beagle.Images.GetWidget("person.png"), false, false, 0); hbox.PackStart(new VLabel(String.Format("<b><span size='large'>{0} \"{1}\" {2}</span></b>", GetValue("FirstName"), GetValue("NickName"), GetValue("LastName")), false)); PackStart(hbox, false, false, 0); PackStart(new HSeparator(), false, false, 0); // Create a table containing some user information table = new Table(5, 2, false); PackStart(table, false, false, 0); table.Attach(new VLabel(String.Format("<b>{0}</b>", Catalog.GetString("Primary E-Mail:")), false), 0, 1, 0, 1, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink, 10, 0); table.Attach(new VLabel(GetValue("PrimaryEmail"), true), 1, 2, 0, 1); table.Attach(new VLabel(String.Format("<b>{0}</b>", Catalog.GetString("Screen name:")), false), 0, 1, 1, 2, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink, 10, 0); table.Attach(new VLabel(GetValue("_AimScreenName"), true), 1, 2, 1, 2); table.Attach(new VLabel(String.Format("<b>{0}</b>", Catalog.GetString("Home phone:")), false), 0, 1, 2, 3, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink, 10, 0); table.Attach(new VLabel(GetValue("HomePhone"), true), 1, 2, 2, 3); table.Attach(new VLabel(String.Format("<b>{0}</b>", Catalog.GetString("Mobile phone:")), false), 0, 1, 3, 4, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink, 10, 0); table.Attach(new VLabel(GetValue("CellularNumber"), true), 1, 2, 3, 4); table.Attach(new VLabel(String.Format("<b>{0}</b>", Catalog.GetString("Web page:")), false), 0, 1, 4, 5, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink, 10, 0); table.Attach(new VLabel(GetValue("WebPage2"), true), 1, 2, 4, 5); // Add a button row with some informational buttons hbuttonbox = new HButtonBox(); hbuttonbox.Layout = ButtonBoxStyle.End; PackEnd(hbuttonbox, false, false, 0); button = new Button(Catalog.GetString("Send E-Mail")); button.Clicked += OnSendEmail; hbuttonbox.Add(button); button = new Button(Catalog.GetString("Details...")); button.Clicked += OnDetails; hbuttonbox.Add(button); }
void ShowEditor(Editor editor) { SetupEditor(editor); current_editor = editor; buttons.Hide(); // Top label VBox vbox = new VBox(false, 4); Label label = new Label(); label.Markup = string.Format("<big><b>{0}</b></big>", editor.Label); vbox.PackStart(label, false, false, 5); // Optional config widget Widget config = editor.ConfigurationWidget(); if (config != null) { // This is necessary because GtkBuilder widgets need to be // reparented. if (config.Parent != null) { config.Reparent(vbox); } else { vbox.PackStart(config, false, false, 0); } } // Apply / Cancel buttons HButtonBox tool_buttons = new HButtonBox(); tool_buttons.LayoutStyle = ButtonBoxStyle.End; tool_buttons.Spacing = 5; tool_buttons.BorderWidth = 5; tool_buttons.Homogeneous = false; Button cancel = new Button(Stock.Cancel); cancel.Clicked += HandleCancel; tool_buttons.Add(cancel); Button apply = new Button(editor.ApplyLabel); apply.Image = new Image(GtkUtil.TryLoadIcon(FSpot.Settings.Global.IconTheme, editor.IconName, 22, 0)); apply.Clicked += (s, e) => { Apply(editor); }; tool_buttons.Add(apply); // Pack it all together vbox.PackEnd(tool_buttons, false, false, 0); active_editor = vbox; widgets.Add(active_editor); active_editor.ShowAll(); }
public TopLevelDialog( ) { vbox = new VBox(); separator = new HSeparator(); buttonBox = new HButtonBox(); vbox.PackEnd(buttonBox, false, false, 0); vbox.PackEnd(separator, false, false, 0); vbox.ShowAll(); Add(vbox); }
private void ChangeBtnPosion() { if (Platform.IsMac) { return; } HButtonBox actionArea = this.ActionArea; ((Box.BoxChild)actionArea[(Widget)this.buttonOk]).Position = 0; ((Box.BoxChild)actionArea[(Widget)this.buttonCancel]).Position = 1; }
private void ChangeBtnPosion() { if (!Platform.IsMac) { HButtonBox actionArea = base.ActionArea; ButtonBox.ButtonBoxChild buttonBoxChild = (ButtonBox.ButtonBoxChild)actionArea[this.buttonOk]; ButtonBox.ButtonBoxChild buttonBoxChild2 = (ButtonBox.ButtonBoxChild)actionArea[this.buttonCancel]; buttonBoxChild.Position = 0; buttonBoxChild2.Position = 1; } }
/// <summary>Constructor</summary> public ListButtonView(ViewBase owner) : base(owner) { vbox = new VBox(false, 0); _mainWidget = vbox; buttonPanel = new HButtonBox(); buttonPanel.Layout = ButtonBoxStyle.Start; listboxView = new ListBoxView(this); scrolledwindow1 = new ScrolledWindow(); scrolledwindow1.Add(listboxView.MainWidget); vbox.PackStart(buttonPanel, false, true, 0); vbox.PackStart(scrolledwindow1, true, true, 0); _mainWidget.ShowAll(); }
private void ChangeBtnPosion() { if (Platform.IsMac) { return; } HButtonBox actionArea = this.ActionArea; ButtonBox.ButtonBoxChild buttonBoxChild1 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonOk]; ButtonBox.ButtonBoxChild buttonBoxChild2 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonCancel]; buttonBoxChild1.Position = 0; buttonBoxChild2.Position = 1; }
public LogWindow(string title, string contents) : base(title) { this.contents = contents; SetDefaultSize(640, 480); VBox vbox = new VBox(false, 2); vbox.BorderWidth = 5; ScrolledWindow scrolledWindow = new ScrolledWindow(); TextView textView = new TextView(); textView.Buffer.Text = contents; textView.Editable = false; scrolledWindow.Add(textView); scrolledWindow.ShowAll(); HButtonBox buttonBox = new HButtonBox(); buttonBox.Layout = ButtonBoxStyle.End; buttonBox.Spacing = 5; Button saveAs = new Button(Stock.SaveAs); saveAs.Clicked += delegate(object obj, EventArgs args) { this.SaveAs(); }; buttonBox.Add(saveAs); Button close = new Button(Stock.Close); close.CanDefault = true; close.Clicked += delegate(object obj, EventArgs args) { this.Close(); }; buttonBox.Add(close); vbox.PackStart(scrolledWindow, true, true, 5); vbox.PackStart(buttonBox, false, false, 5); Add(vbox); ShowAll(); close.GrabDefault(); }
public SparkleWindow() : base("") { Title = "SparkleShare Setup"; BorderWidth = 0; IconName = "folder-sparkleshare"; Resizable = false; WindowPosition = WindowPosition.Center; SetSizeRequest(680, 440); DeleteEvent += delegate(object o, DeleteEventArgs args) { args.RetVal = true; Close(); }; HBox = new HBox(false, 6); VBox = new VBox(false, 0); Wrapper = new VBox(false, 0) { BorderWidth = 30 }; Buttons = CreateButtonBox(); VBox.PackStart(Wrapper, true, true, 0); VBox.PackStart(Buttons, false, false, 0); EventBox box = new EventBox(); Gdk.Color bg_color = new Gdk.Color(); Gdk.Color.Parse("#2e3336", ref bg_color); box.ModifyBg(StateType.Normal, bg_color); string image_path = SparkleHelpers.CombineMore(Defines.DATAROOTDIR, "sparkleshare", "pixmaps", "side-splash.png"); Image side_splash = new Image(image_path) { Yalign = 1 }; box.Add(side_splash); HBox.PackStart(box, false, false, 0); HBox.PackStart(VBox, true, true, 0); base.Add(HBox); }
private void ShowEditor(Editor editor) { SetupEditor(editor); current_editor = editor; buttons.Hide(); // Top label VBox vbox = new VBox(false, 4); Label label = new Label(); label.Markup = String.Format("<big><b>{0}</b></big>", editor.Label); vbox.PackStart(label, false, false, 5); // Optional config widget Widget config = editor.ConfigurationWidget(); if (config != null) { vbox.PackStart(config, false, false, 0); } // Apply / Cancel buttons HButtonBox tool_buttons = new HButtonBox(); tool_buttons.LayoutStyle = ButtonBoxStyle.End; tool_buttons.Spacing = 5; tool_buttons.BorderWidth = 5; tool_buttons.Homogeneous = false; Button cancel = new Button(Stock.Cancel); cancel.Clicked += HandleCancel; tool_buttons.Add(cancel); Button apply = new Button(editor.ApplyLabel); apply.Image = new Image(GtkUtil.TryLoadIcon(FSpot.Global.IconTheme, editor.IconName, 22, (Gtk.IconLookupFlags) 0)); apply.Clicked += delegate { Apply(editor); }; tool_buttons.Add(apply); // Pack it all together vbox.PackEnd(tool_buttons, false, false, 0); active_editor = vbox; widgets.Add(active_editor); active_editor.ShowAll(); }
public SparkleSetupWindow() : base("") { Title = Catalog.GetString("SparkleShare Setup"); BorderWidth = 0; IconName = "folder-sparkleshare"; Resizable = false; WindowPosition = WindowPosition.Center; Deletable = false; SetSizeRequest(680, 440); DeleteEvent += delegate(object o, DeleteEventArgs args) { args.RetVal = true; Close(); }; HBox = new HBox(false, 6); VBox = new VBox(false, 0); Wrapper = new VBox(false, 0) { BorderWidth = 30 }; Buttons = CreateButtonBox(); VBox.PackStart(Wrapper, true, true, 0); VBox.PackStart(Buttons, false, false, 0); EventBox box = new EventBox(); Gdk.Color bg_color = new Gdk.Color(); Gdk.Color.Parse("#000", ref bg_color); box.ModifyBg(StateType.Normal, bg_color); Image side_splash = SparkleUIHelpers.GetImage("side-splash.png"); side_splash.Yalign = 1; box.Add(side_splash); HBox.PackStart(box, false, false, 0); HBox.PackStart(VBox, true, true, 0); base.Add(HBox); }
public IPhoneDeviceConsole() : base("iPhone Device Console") { BorderWidth = 6; //FIXME: persist these values DefaultWidth = 400; DefaultHeight = 400; var vbox = new VBox() { Spacing = 12 }; var bbox = new HButtonBox() { Layout = ButtonBoxStyle.End, }; var closeButton = new Button(Gtk.Stock.Close); var reconnectButton = new Button() { Label = "Reconnect" }; log = new LogView(); this.Add(vbox); vbox.PackEnd(bbox, false, false, 0); vbox.PackEnd(log, true, true, 0); bbox.PackEnd(reconnectButton); bbox.PackEnd(closeButton); closeButton.Clicked += delegate { Destroy(); }; DeleteEvent += delegate { Destroy(); }; reconnectButton.Clicked += delegate { Disconnect(); Connect(); }; ShowAll(); Connect(); }
public AttributeEditorWidget() : base() { sw = new ScrolledWindow(); sw.HscrollbarPolicy = PolicyType.Automatic; sw.VscrollbarPolicy = PolicyType.Automatic; store = new ListStore(typeof(string), typeof(string)); store.SetSortColumnId(0, SortType.Ascending); tv = new TreeView(); tv.Model = store; TreeViewColumn col; col = tv.AppendColumn("Name", new CellRendererText(), "text", 0); col.SortColumnId = 0; CellRendererText cell = new CellRendererText(); cell.Editable = true; cell.Edited += new EditedHandler(OnAttributeEdit); tv.AppendColumn("Value", cell, "text", 1); tv.KeyPressEvent += new KeyPressEventHandler(OnKeyPress); tv.ButtonPressEvent += new ButtonPressEventHandler(OnRightClick); tv.RowActivated += new RowActivatedHandler(OnRowActivated); sw.AddWithViewport(tv); HButtonBox hb = new HButtonBox(); hb.Layout = ButtonBoxStyle.End; applyButton = new Button(); applyButton.Label = "Apply"; applyButton.Image = new Gtk.Image(Stock.Apply, IconSize.Button); applyButton.Clicked += new EventHandler(OnApplyClicked); applyButton.Sensitive = false; hb.Add(applyButton); this.PackStart(sw, true, true, 0); this.PackStart(hb, false, false, 5); this.ShowAll(); }
public void Commit(object obj, EventArgs args) //EventArgs { this.HideAll(); //MAKE SOMETHING RELATED WITH COMMITTING LOGIN DATA string pswStored = "ciaone"; int pswHashStored = pswStored.GetHashCode(); String avviso; if (this.password.Text.GetHashCode() == pswHashStored) { avviso = "Password corretta"; } else { avviso = "Password errata"; password.Text = ""; } Console.WriteLine(avviso); dialog = new Window(WindowType.Toplevel); dialog.Resize(200, 100); dialog.BorderWidth = 20; VBox dialogBox = new VBox(); Label labelDialog = new Label(avviso); Button okPop = new Button("Ok"); HButtonBox dialogButtonBox = new HButtonBox(); dialogButtonBox.Add(okPop); dialogBox.Add(labelDialog); dialogBox.Add(dialogButtonBox); dialog.Add(dialogBox); dialog.SetPosition(WindowPosition.CenterAlways); dialog.ShowAll(); if (avviso.Equals("Password corretta")) { okPop.Clicked += CancelWindowCloser; } else { okPop.Clicked += Revealer; } //THEN QUIT }
public PlayerPage(ICSGameObserverWidget widget, MoveDetails details) : base(widget, details) { HButtonBox box = new HButtonBox (); drawButton = new Button (Catalog. GetString ("Draw")); resignButton = new Button (Catalog. GetString ("Resign")); abortButton = new Button (Catalog. GetString ("Abort")); adjournButton = new Button (Catalog. GetString ("Adjourn")); takebackButton = new Button (Catalog. GetString ("Takeback")); drawButton.Clicked += OnClicked; resignButton.Clicked += OnClicked; abortButton.Clicked += OnClicked; adjournButton.Clicked += OnClicked; takebackButton.Clicked += OnClicked; box.LayoutStyle = ButtonBoxStyle.Start; box.PackStart (drawButton, false, false, 2); box.PackStart (resignButton, false, false, 2); box.PackStart (abortButton, false, false, 2); box.PackStart (adjournButton, false, false, 2); box.PackStart (takebackButton, false, false, 2); box.ShowAll (); PackStart (box, false, true, 2); }
public GladeDialog(Window parentWindow, string dialogName) : base(dialogName) { dialog = (Dialog)base.Window; dialog.Modal = true; dialog.WindowPosition = WindowPosition.CenterOnParent; dialog.TransientFor = parentWindow; // Dialog button order is reversed on windows if (Environment.OSVersion.Platform != PlatformID.Unix) { if (dialog.ActionArea != null) { HButtonBox box = dialog.ActionArea; int count = 0; foreach (Widget widget in box.AllChildren) { box.ReorderChild(widget, ++count); } } } }
private Widget CreateBottomBar() { HButtonBox buttonBox = new HButtonBox(); buttonBox.Layout = ButtonBoxStyle.Edge; toggleSidebarButton = new Button(); toggleSidebarButton.Label = Catalog.GetString("Close Sidebar"); toggleSidebarButton.Relief = ReliefStyle.None; toggleSidebarButton.Clicked += OnToggleSidebarButtonClicked; toggleSidebarButton.Show(); buttonBox.PackStart(toggleSidebarButton, false, false, 0); personHScale = new HScale(1, 3, 1); personHScale.DrawValue = false; personHScale.ValueChanged += OnPersonHScaledValueChanged; personHScale.Show(); buttonBox.PackEnd(personHScale, false, false, 0); buttonBox.Show(); return(buttonBox); }
public ResultView(Gdk.Pixbuf[] img1, Gdk.Pixbuf[] img2, Gdk.Pixbuf[] thumbs, int[] res, int[] cat1, int[] cat2, bool[] match) { this.img1 = img1; this.img2 = img2; this.res = res; this.cat1 = cat1; this.cat2 = cat2; this.match = match; Glade.XML gxml = new Glade.XML(Assembly.GetExecutingAssembly(), "ResultView.glade", "ResultViewWindow", null); gxml.BindFields(this); ResultViewWindow.DeleteEvent += CloseWindow; CloseButton.Clicked += CloseWindow; CounterText.Text = String.Format(Catalog.GetPluralString("<i>Viewing results for {0} image</i>", "<i>Viewing results for {0} images</i>", img2.Length), img2.Length); CounterText.UseMarkup = true; TestIcon.FromPixbuf = new Gdk.Pixbuf(Assembly.GetEntryAssembly(), "image-test-22.png"); BaseIcon.FromPixbuf = new Gdk.Pixbuf(Assembly.GetEntryAssembly(), "image-base-22.png"); SetDisplay(0); HButtonBox hb = new HButtonBox(); hb.Layout = ButtonBoxStyle.Start; for (int i = 0; i < thumbs.Length; i++) { ImageButton b = new ImageButton(new Image(thumbs[i]), i); b.Clicked += OnClicked; hb.PackEnd(b, false, false, 0); } ImageListSocket.AddWithViewport(hb); ResultViewWindow.ShowAll(); }
void InitializeComponent() { var box = new VBox(); var bbox = new HButtonBox(); _btnGetFromEnv = new Button("Get from environment"); _btnGetFromEnv.Activated += BtnGetFromEnvOnActivated; bbox.PackEnd(_btnGetFromEnv, false, false, 0); box.PackStart(bbox, false, false, 0); _cbUseProxy = new CheckButton("Use proxy?"); _cbUseProxy.Toggled += chkUseProxy_CheckedChanged; _cbBypassLocal = new CheckButton("Bypass local addresses?"); box.PackStart(_cbUseProxy, false, false, 0); box.PackStart(_cbBypassLocal, false, false, 0); Table table = new Table(2, 4, false); table.Attach(new Label("Host"), 0, 1, 0, 1); table.Attach(new Label("Port"), 1, 2, 0, 1); table.Attach(new Label("Username"), 2, 3, 0, 1); table.Attach(new Label("Password"), 3, 4, 0, 1); _txtProxyHost = new Entry(); _txtProxyPort = new SpinButton(0, 65535, 1); _txtProxyUser = new Entry(); _txtProxyPassword = new Entry(); _txtProxyPassword.Visibility = false; table.Attach(_txtProxyHost, 0, 1, 1, 2); table.Attach(_txtProxyPort, 1, 2, 1, 2); table.Attach(_txtProxyUser, 2, 3, 1, 2); table.Attach(_txtProxyPassword, 3, 4, 1, 2); box.PackStart(table, false, false, 0); Child = box; ShowAll(); }
protected NumberInputWindow(string title, string message, int min, int max) : base(WindowType.Toplevel) { Modal = true; Title = title; label = new Label(message); spinButton = new SpinButton(min, max, 1); okButton = new Button("Ok"); cancelButton = new Button("Cancel"); vBox = new VBox(); vBox.Add(label); vBox.Add(spinButton); hButtonBox = new HButtonBox(); hButtonBox.Add(cancelButton); hButtonBox.Add(okButton); vBox.Add(hButtonBox); Add(vBox); }
private void build() { var mainBox = new VBox(); qnv = new QuestitionNodeView(); mainBox.PackStart(qnv, true, true, 2); var buttonBox = new HButtonBox { Layout = ButtonBoxStyle.End, Spacing = 6 }; Button buttonAdd = new Button(Stock.Add); buttonAdd.Clicked += ButtonAddClicked; buttonBox.Add(buttonAdd); Button buttonRemove = new Button(Stock.Remove); buttonRemove.Clicked += ButtonRemoveClicked; buttonBox.Add(buttonRemove); Button buttonRefresh = new Button(Stock.Refresh); buttonRefresh.Clicked += ButtonRefreshClicked; buttonBox.Add(buttonRefresh); Button buttonClose = new Button(Stock.Close); buttonClose.Clicked += ButtonCloseClicked; buttonBox.Add(buttonClose); mainBox.PackEnd(buttonBox, false, false, 2); this.Add(mainBox); }
/* * protected void ShowAll() { * if (this.Child != null) * this.Child.ShowAll(); * * this.Show(); * }*/ protected void InitActionArea(out Button btnOk, out Button btnCancel, EventHandler btnOkClicked, EventHandler btnCancelClicked) { // buttonbox HButtonBox bbox = this.ActionArea; bbox.Spacing = 6; // TODO : currently ignored? bug in gtk#? bbox.BorderWidth = 12; // TODO : currently ignored? bug in gtk#? bbox.LayoutStyle = ButtonBoxStyle.End; // cancel button btnCancel = new Button(); btnCancel.CanDefault = true; //btnCancel.CanFocus = true; btnCancel.UseUnderline = true; btnCancel.UseStock = true; btnCancel.Label = Stock.Cancel; if (btnCancelClicked != null) { btnCancel.Clicked += btnCancelClicked; } this.AddActionWidget(btnCancel, -6); // ok button btnOk = new Button(); btnOk.CanDefault = true; //btnCancel.CanFocus = true; btnOk.UseUnderline = true; btnOk.UseStock = true; btnOk.Label = Stock.Ok; if (btnOkClicked != null) { btnOk.Clicked += btnOkClicked; } this.AddActionWidget(btnOk, -5); }
private void DecorateUI() { HButtonBox actionArea = new HButtonBox (); actionArea.LayoutStyle = ButtonBoxStyle.End; Button button = new Button (Stock.Ok); button.Clicked += OnActivated; actionArea.PackStart (button, false, false, 4); serverNameEntry = new Entry (); portEntry = new Entry (); usernameEntry = new Entry (); passwordEntry = new Entry (); passwordEntry.Visibility = false; passwordEntry.Activated += OnActivated; guestLoginCheckButton = new CheckButton (); Table table = new Table (5, 2, false); uint row = 0; // left, right, top, bottom Label label = new Label (Catalog. GetString ("Server")); label.Xalign = 0; uint width = 1; AttachToTable (table, label, 0, row, width); AttachToTable (table, serverNameEntry, 1, row, width); row++; label = new Label (Catalog. GetString ("Port")); label.Xalign = 0; AttachToTable (table, label, 0, row, 1); AttachToTable (table, portEntry, 1, row, 1); row++; label = new Label (Catalog. GetString ("Guest Login")); label.Xalign = 0; AttachToTable (table, label, 0, row, 1); AttachToTable (table, guestLoginCheckButton, 1, row, 1); row++; label = new Label (Catalog. GetString ("Username")); label.Xalign = 0; AttachToTable (table, label, 0, row, 1); AttachToTable (table, usernameEntry, 1, row, 1); row++; label = new Label (Catalog. GetString ("Password")); label.Xalign = 0; AttachToTable (table, label, 0, row, 1); AttachToTable (table, passwordEntry, 1, row, 1); row++; label = new Label (Catalog. GetString ("<big><big><b>Login</b></big></big>")); label.Xalign = 0; label.Xpad = 2; label.UseMarkup = true; VBox vbox = new VBox (); vbox.PackStart (label, false, true, 4); vbox.PackStart (table, false, false, 4); vbox.PackStart (actionArea, false, true, 4); Child = vbox; }
protected virtual void Build() { Gui.Initialize((Widget)this); this.HeightRequest = 175; this.Name = "CocoStudio.ControlLib.Windows.LoginDialog"; this.WindowPosition = WindowPosition.CenterOnParent; VBox vbox = this.VBox; vbox.Name = "dialog1_VBox"; vbox.BorderWidth = 2U; this.evtbx_border = new EventBox(); this.evtbx_border.Name = "evtbx_border"; this.evtbx_border.BorderWidth = 10U; this.table_main = new Table(4U, 2U, false); this.table_main.Name = "table_main"; this.table_main.RowSpacing = 6U; this.table_main.ColumnSpacing = 6U; this.hbox_firstRow = new HBox(); this.hbox_firstRow.Name = "hbox_firstRow"; this.hbox_firstRow.Spacing = 6; this.entry_Name = new Entry(); this.entry_Name.WidthRequest = 250; this.entry_Name.CanFocus = true; this.entry_Name.Name = "entry_Name"; this.entry_Name.IsEditable = true; this.entry_Name.InvisibleChar = '●'; this.hbox_firstRow.Add((Widget)this.entry_Name); Box.BoxChild boxChild1 = (Box.BoxChild) this.hbox_firstRow[(Widget)this.entry_Name]; boxChild1.Position = 0; boxChild1.Expand = false; this.link_RegisterAccount = new LabelLink((string)null); this.link_RegisterAccount.Events = EventMask.ButtonPressMask; this.link_RegisterAccount.Name = "link_RegisterAccount"; this.hbox_firstRow.Add((Widget)this.link_RegisterAccount); Box.BoxChild boxChild2 = (Box.BoxChild) this.hbox_firstRow[(Widget)this.link_RegisterAccount]; boxChild2.Position = 1; boxChild2.Expand = false; boxChild2.Fill = false; this.table_main.Add((Widget)this.hbox_firstRow); Table.TableChild tableChild1 = (Table.TableChild) this.table_main[(Widget)this.hbox_firstRow]; tableChild1.LeftAttach = 1U; tableChild1.RightAttach = 2U; tableChild1.XOptions = AttachOptions.Fill; tableChild1.YOptions = AttachOptions.Fill; this.hbox_fourthRow = new HBox(); this.hbox_fourthRow.Name = "hbox_fourthRow"; this.hbox_fourthRow.Spacing = 6; this.label_remark = new Label(); this.label_remark.Name = "label_remark"; this.label_remark.LabelProp = Catalog.GetString("(请使用CocoaChina账号登陆)"); this.hbox_fourthRow.Add((Widget)this.label_remark); Box.BoxChild boxChild3 = (Box.BoxChild) this.hbox_fourthRow[(Widget)this.label_remark]; boxChild3.Position = 0; boxChild3.Expand = false; boxChild3.Fill = false; this.table_main.Add((Widget)this.hbox_fourthRow); Table.TableChild tableChild2 = (Table.TableChild) this.table_main[(Widget)this.hbox_fourthRow]; tableChild2.TopAttach = 3U; tableChild2.BottomAttach = 4U; tableChild2.LeftAttach = 1U; tableChild2.RightAttach = 2U; tableChild2.XOptions = AttachOptions.Fill; tableChild2.YOptions = AttachOptions.Fill; this.hbox_secondRow = new HBox(); this.hbox_secondRow.Name = "hbox_secondRow"; this.hbox_secondRow.Spacing = 6; this.entry_PassWord = new PassWordEntry(); this.entry_PassWord.CanFocus = true; this.entry_PassWord.Name = "entry_PassWord"; this.entry_PassWord.IsEditable = true; this.entry_PassWord.InvisibleChar = '●'; this.hbox_secondRow.Add((Widget)this.entry_PassWord); ((Box.BoxChild) this.hbox_secondRow[(Widget)this.entry_PassWord]).Position = 0; this.link_ForgotPassword = new LabelLink((string)null); this.link_ForgotPassword.Events = EventMask.ButtonPressMask; this.link_ForgotPassword.Name = "link_ForgotPassword"; this.hbox_secondRow.Add((Widget)this.link_ForgotPassword); Box.BoxChild boxChild4 = (Box.BoxChild) this.hbox_secondRow[(Widget)this.link_ForgotPassword]; boxChild4.Position = 1; boxChild4.Expand = false; boxChild4.Fill = false; this.table_main.Add((Widget)this.hbox_secondRow); Table.TableChild tableChild3 = (Table.TableChild) this.table_main[(Widget)this.hbox_secondRow]; tableChild3.TopAttach = 1U; tableChild3.BottomAttach = 2U; tableChild3.LeftAttach = 1U; tableChild3.RightAttach = 2U; tableChild3.XOptions = AttachOptions.Fill; tableChild3.YOptions = AttachOptions.Fill; this.hbox_thirdRow = new HBox(); this.hbox_thirdRow.Name = "hbox_thirdRow"; this.hbox_thirdRow.Spacing = 6; this.checkbutton_password = new CheckButton(); this.checkbutton_password.CanFocus = true; this.checkbutton_password.Name = "checkbutton_password"; this.checkbutton_password.Label = Catalog.GetString("记住密码"); this.checkbutton_password.DrawIndicator = true; this.checkbutton_password.UseUnderline = true; this.hbox_thirdRow.Add((Widget)this.checkbutton_password); Box.BoxChild boxChild5 = (Box.BoxChild) this.hbox_thirdRow[(Widget)this.checkbutton_password]; boxChild5.Position = 0; boxChild5.Expand = false; this.checkbutton_AutoLogin = new CheckButton(); this.checkbutton_AutoLogin.CanFocus = true; this.checkbutton_AutoLogin.Name = "checkbutton_AutoLogin"; this.checkbutton_AutoLogin.Label = Catalog.GetString("自动登陆"); this.checkbutton_AutoLogin.DrawIndicator = true; this.checkbutton_AutoLogin.UseUnderline = true; this.hbox_thirdRow.Add((Widget)this.checkbutton_AutoLogin); Box.BoxChild boxChild6 = (Box.BoxChild) this.hbox_thirdRow[(Widget)this.checkbutton_AutoLogin]; boxChild6.Position = 1; boxChild6.Expand = false; this.table_main.Add((Widget)this.hbox_thirdRow); Table.TableChild tableChild4 = (Table.TableChild) this.table_main[(Widget)this.hbox_thirdRow]; tableChild4.TopAttach = 2U; tableChild4.BottomAttach = 3U; tableChild4.LeftAttach = 1U; tableChild4.RightAttach = 2U; tableChild4.XOptions = AttachOptions.Fill; tableChild4.YOptions = AttachOptions.Fill; this.label_Name = new Label(); this.label_Name.Name = "label_Name"; this.label_Name.Xalign = 1f; this.label_Name.LabelProp = Catalog.GetString("用户名"); this.table_main.Add((Widget)this.label_Name); Table.TableChild tableChild5 = (Table.TableChild) this.table_main[(Widget)this.label_Name]; tableChild5.XOptions = AttachOptions.Fill; tableChild5.YOptions = AttachOptions.Fill; this.label_PassWord = new Label(); this.label_PassWord.Name = "label_PassWord"; this.label_PassWord.Xalign = 1f; this.label_PassWord.LabelProp = Catalog.GetString("密码"); this.table_main.Add((Widget)this.label_PassWord); Table.TableChild tableChild6 = (Table.TableChild) this.table_main[(Widget)this.label_PassWord]; tableChild6.TopAttach = 1U; tableChild6.BottomAttach = 2U; tableChild6.XOptions = AttachOptions.Fill; tableChild6.YOptions = AttachOptions.Fill; this.evtbx_border.Add((Widget)this.table_main); vbox.Add((Widget)this.evtbx_border); Box.BoxChild boxChild7 = (Box.BoxChild)vbox[(Widget)this.evtbx_border]; boxChild7.Position = 0; boxChild7.Expand = false; boxChild7.Fill = false; HButtonBox actionArea = this.ActionArea; actionArea.Name = "dialog1_ActionArea"; actionArea.Spacing = 10; actionArea.BorderWidth = 5U; actionArea.LayoutStyle = ButtonBoxStyle.End; this.buttonCancel = new Button(); this.buttonCancel.CanDefault = true; this.buttonCancel.CanFocus = true; this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.UseStock = true; this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget((Widget)this.buttonCancel, -6); ButtonBox.ButtonBoxChild buttonBoxChild1 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonCancel]; buttonBoxChild1.Expand = false; buttonBoxChild1.Fill = false; this.buttonOk = new Button(); this.buttonOk.CanDefault = true; this.buttonOk.CanFocus = true; this.buttonOk.Name = "buttonOk"; this.buttonOk.UseStock = true; this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget((Widget)this.buttonOk, -5); ButtonBox.ButtonBoxChild buttonBoxChild2 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonOk]; buttonBoxChild2.Position = 1; buttonBoxChild2.Expand = false; buttonBoxChild2.Fill = false; if (this.Child != null) { this.Child.ShowAll(); } this.DefaultWidth = 412; this.DefaultHeight = 191; this.Show(); }