// Create a Button Box with the specified parameters private Frame CreateButtonBox(bool horizontal, string title, int spacing, ButtonBoxStyle layout) { Frame frame = new Frame(title); Gtk.ButtonBox bbox; if (horizontal) { bbox = new Gtk.HButtonBox(); } else { bbox = new Gtk.VButtonBox(); } bbox.BorderWidth = 5; frame.Add(bbox); // Set the appearance of the Button Box bbox.Layout = layout; bbox.Spacing = spacing; bbox.Add(new Button(Stock.Ok)); bbox.Add(new Button(Stock.Cancel)); bbox.Add(new Button(Stock.Help)); return(frame); }
private void BuildInterface() { VBox vbox = this.Child as VBox; HButtonBox buttonBox = new HButtonBox (); drawingArea = new DrawingArea (); drawingArea.SetSizeRequest (640, 480); captureButton = new Button ("Capture"); previewButton = new Button ("Preview"); previewButton.Sensitive = false; saveButton = new Button ("Save"); saveButton.Sensitive = false; cancelButton = new Button ("Cancel"); buttonBox.PackStart (captureButton); buttonBox.PackStart (previewButton); buttonBox.PackStart (saveButton); buttonBox.PackStart (cancelButton); buttonBox.LayoutStyle = ButtonBoxStyle.Center; vbox.PackStart (drawingArea); vbox.PackStart (buttonBox, false, true, 8); this.ShowAll (); this.DeleteEvent += new DeleteEventHandler(OnDelete); captureButton.Clicked += new EventHandler (CaptureButtonClicked); previewButton.Clicked += new EventHandler(PreviewButtonClicked); saveButton.Clicked += new EventHandler (SaveButtonClicked); cancelButton.Clicked += new EventHandler (CancelButtonClicked); }
private Gtk.Widget MakeViewPage() { Gtk.VBox vbox = new Gtk.VBox(false, 0); vbox.BorderWidth = 6; textLabel = new Gtk.Label(); textLabel.Xalign = 0; textLabel.UseUnderline = false; textLabel.Justify = Gtk.Justification.Left; textLabel.Wrap = true; textLabel.Text = text; textLabel.Show(); vbox.PackStart(textLabel, true, true, 0); Gtk.HButtonBox hButtonBox = new Gtk.HButtonBox(); hButtonBox.Layout = Gtk.ButtonBoxStyle.End; deleteButton = new Gtk.Button(Gtk.Stock.Delete); deleteButton.Clicked += OnDeleteButtonClicked; deleteButton.Show(); hButtonBox.PackStart(deleteButton, false, false, 0); editButton = new Gtk.Button(Gtk.Stock.Edit); editButton.Clicked += OnEditButtonClicked; editButton.Show(); hButtonBox.PackStart(editButton, false, false, 0); hButtonBox.Show(); vbox.PackStart(hButtonBox, false, false, 0); vbox.Show(); return(vbox); }
private void createButtons() { FakeButtonCloseSerialPort = new Gtk.Button(); Gtk.Button button_close_serial_port = new Gtk.Button("Close serial port (debug)"); button_close_serial_port.Clicked += new EventHandler(on_button_close_serial_port_clicked); Gtk.Button button_OSX_readme = new Gtk.Button("MacOSX Readme"); button_OSX_readme.Clicked += new EventHandler(on_button_OSX_readme_clicked); //---- button close start ---> Gtk.Button button_close = new Gtk.Button("Close Window"); button_close.Clicked += new EventHandler(on_button_close_clicked); Gtk.AccelGroup ag = new Gtk.AccelGroup(); //button can be called clicking Escape key chronopic_register_win.AddAccelGroup(ag); button_close.AddAccelerator ("activate", ag, new Gtk.AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None, Gtk.AccelFlags.Visible)); //<---- button close end //add buttons to containers Gtk.HButtonBox hbox = new Gtk.HButtonBox(); //hbox.Add(button_close_serial_port); if (UtilAll.GetOSEnum() == UtilAll.OperatingSystems.MACOSX) { hbox.Add(button_OSX_readme); } hbox.Add(button_close); vbox_main.Add(hbox); }
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(); }
private void createGui(Gtk.Window app1, ChronopicRegisterPort crp, string labelStr) { chronopic_contacts_real_win = new Window("Chronopic connection"); chronopic_contacts_real_win.AllowGrow = false; chronopic_contacts_real_win.Modal = true; chronopic_contacts_real_win.TransientFor = app1; chronopic_contacts_real_win.BorderWidth = 20; chronopic_contacts_real_win.DeleteEvent += on_delete_event; Gtk.VBox vbox_main = new Gtk.VBox(false, 20); chronopic_contacts_real_win.Add(vbox_main); LogB.Information("Connecting real (starting connection)"); LogB.Information("Press test button on Chronopic"); Gtk.Label labelMessage = new Gtk.Label(); labelMessage.Text = labelStr + "\n" + "\n" + Catalog.GetString("Port") + ": " + crp.Port + "\n" + Catalog.GetString("Serial Number") + ": " + crp.SerialNumber; vbox_main.Add(labelMessage); progressbar = new Gtk.ProgressBar(); vbox_main.Add(progressbar); Gtk.Button button_cancel = new Gtk.Button("Cancel"); button_cancel.Clicked += new EventHandler(on_button_cancel_clicked); Gtk.HButtonBox hbox = new Gtk.HButtonBox(); hbox.Add(button_cancel); vbox_main.Add(hbox); chronopic_contacts_real_win.ShowAll(); }
public SparkleWindow() : base("") { BorderWidth = 0; IconName = "folder-sparkleshare"; Resizable = true; WindowPosition = WindowPosition.Center; SetDefaultSize (640, 480); Buttons = CreateButtonBox (); HBox = new HBox (false, 6); string image_path = SparkleHelpers.CombineMore (Defines.DATAROOTDIR, "sparkleshare", "pixmaps", "side-splash.png"); Image side_splash = new Image (image_path); VBox = new VBox (false, 0); Wrapper = new VBox (false, 0) { BorderWidth = 30 }; VBox.PackStart (Wrapper, true, true, 0); VBox.PackStart (Buttons, false, false, 0); HBox.PackStart (side_splash, false, false, 0); HBox.PackStart (VBox, true, true, 0); base.Add (HBox); }
void BuildLayout () { primary_vbox = new VBox (); var label = new Label ("Super duper test UI!"); label.Show (); primary_vbox.Add (label); var button_box = new HButtonBox (); button_box.Show (); primary_vbox.Add (button_box); var folder_button = new FileChooserButton ("Select import folder", FileChooserAction.SelectFolder); folder_button.FileSet += delegate { folder = folder_button.Uri; Log.Information ("Selected " + folder); }; folder_button.Show (); button_box.Add (folder_button); var import_button = new Button { Label = "Start Import" }; import_button.Activated += StartImport; import_button.Clicked += StartImport; import_button.Show (); button_box.Add (import_button); primary_vbox.Show (); Add (primary_vbox); }
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); }
protected virtual void Build() { Gui.Initialize((Widget)this); this.Name = "Gtk.ColorPickerDialog"; this.Title = Catalog.GetString("dialog1"); this.WindowPosition = WindowPosition.CenterOnParent; this.Resizable = false; VBox vbox = this.VBox; vbox.Name = "dialog1_VBox"; vbox.BorderWidth = 2U; this.eventbox_bg = new EventBox(); this.eventbox_bg.Name = "eventbox_bg"; this.eventbox_bg.BorderWidth = 12U; vbox.Add((Widget)this.eventbox_bg); ((Box.BoxChild)vbox[(Widget)this.eventbox_bg]).Position = 0; 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 = 535; this.DefaultHeight = 294; this.Show(); }
private void createButtons() { Frame frame = new Frame(); frame.ShadowType = ShadowType.In; frame.LabelXalign = 0f; frame.LabelYalign = 0.5f; frame.Label = Catalog.GetString("There is a known problem on macOS:"); Gtk.Label label_macOS = new Gtk.Label( Catalog.GetString("If Chronopic is disconnected after jumps or runs execution,\nthat port will be blocked until restart of machine.")); Gtk.VBox vbox_m = new Gtk.VBox(); vbox_m.PackStart(label_macOS, false, false, 8); Gtk.HBox hbox_m = new Gtk.HBox(); hbox_m.PackStart(vbox_m, false, false, 8); if (UtilAll.GetOSEnum() == UtilAll.OperatingSystems.MACOSX) { frame.Add(hbox_m); vbox_main.Add(frame); } FakeButtonCloseSerialPort = new Gtk.Button(); Gtk.Button button_close_serial_port = new Gtk.Button("Close serial port (debug)"); button_close_serial_port.Clicked += new EventHandler(on_button_close_serial_port_clicked); //---- button close start ---> Gtk.Button button_close = new Gtk.Button("Close Window"); button_close.CanFocus = true; button_close.IsFocus = true; button_close.Clicked += new EventHandler(on_button_close_clicked); Gtk.AccelGroup ag = new Gtk.AccelGroup(); //button can be called clicking Escape key chronopic_register_win.AddAccelGroup(ag); button_close.AddAccelerator ("activate", ag, new Gtk.AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None, Gtk.AccelFlags.Visible)); //<---- button close end //add buttons to containers Gtk.HButtonBox hbox = new Gtk.HButtonBox(); //hbox.Add(button_close_serial_port); hbox.Add(button_close); vbox_main.Add(hbox); }
public SparkleSetupWindow() : base("") { Title = Catalog.GetString ("SparkleShare Setup"); BorderWidth = 0; IconName = "folder-sparkleshare"; Resizable = false; WindowPosition = WindowPosition.Center; Deletable = false; SecondaryTextColor = SparkleUIHelpers.GdkColorToHex (Style.Foreground (StateType.Insensitive)); SecondaryTextColorSelected = SparkleUIHelpers.GdkColorToHex ( MixColors ( new TreeView ().Style.Foreground (StateType.Selected), new TreeView ().Style.Background (StateType.Selected), 0.15 ) ); SetSizeRequest (680, 400); HBox = new HBox (false, 0); VBox = new VBox (false, 0); Wrapper = new VBox (false, 0) { BorderWidth = 0 }; Buttons = CreateButtonBox (); VBox.PackStart (Wrapper, true, true, 0); VBox.PackStart (Buttons, false, false, 15); 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, 30); base.Add (HBox); }
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); }
/// <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(); }
public static void Main(string[] args) { Application.Init(); var window = new Gtk.Window(Gtk.WindowType.Toplevel) { Title = "Treemap Example", BorderWidth = 0, //12, }; window.SetDefaultSize(640, 480); window.DeleteEvent += delegate { Gtk.Application.Quit(); }; window.Show(); var vbox = new Gtk.VBox(false, 6); window.Add(vbox); vbox.Show(); var treemap = new TreeMap.TreeMap() { Model = BuildModel(), TextColumn = 0, WeightColumn = 1, Title = "Treemap Example", }; vbox.PackStart(treemap, true, true, 0); treemap.Show(); var buttonbox = new Gtk.HButtonBox(); buttonbox.BorderWidth = 12; buttonbox.Layout = Gtk.ButtonBoxStyle.End; vbox.PackStart(buttonbox, false, true, 0); buttonbox.Show(); var close = new Gtk.Button(Gtk.Stock.Close); close.CanDefault = true; close.Clicked += delegate { Gtk.Application.Quit(); }; buttonbox.PackStart(close, false, true, 0); window.Default = close; close.Show(); Application.Run(); }
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 Constructors // ============================================ public Window() : base("Search...") { // Initialize Window Options this.SetDefaultSize(320, 250); // Initialize VBox this.vbox = new Gtk.VBox(false, 2); this.Add(this.vbox); // Initialize TopBar this.topbar = new TopBar(); this.vbox.PackStart(this.topbar, false, false, 2); // Initialize Search Results Label Gtk.Label label = new Gtk.Label("<b>Search Results:</b>"); label.UseMarkup = true; label.Xalign = 0.0f; label.Xpad = 5; this.vbox.PackStart(label, false, false, 2); // Initialize Search Results Viewer this.swResultViewer = new Gtk.ScrolledWindow(null, null); this.swResultViewer.ShadowType = Gtk.ShadowType.None; this.swResultViewer.HscrollbarPolicy = Gtk.PolicyType.Automatic; this.swResultViewer.VscrollbarPolicy = Gtk.PolicyType.Always; this.vbox.PackStart(this.swResultViewer, true, true, 2); // Initialize Search Results Viewer this.resultViewer = new ResultViewer(); this.swResultViewer.Add(this.resultViewer); // Initialize Button Box this.vbox.PackStart(new HSeparator(), false, false, 2); this.hbuttonBox = new Gtk.HButtonBox(); this.hbuttonBox.Layout = ButtonBoxStyle.End; this.vbox.PackStart(this.hbuttonBox, false, true, 2); Gtk.Button button; // Find button = new Gtk.Button(Gtk.Stock.Find); this.hbuttonBox.PackEnd(button, false, false, 2); 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 Constructors // ============================================ public ViewerWindow() : base("Download/Upload Viewer") { // Initialize Window SetDefaultSize(440, 300); // Initialize VBox this.vbox = new Gtk.VBox(false, 2); this.Add(this.vbox); // Initialize Notebook this.notebook = new Gtk.Notebook(); this.notebook.ShowTabs = true; this.notebook.Scrollable = true; this.vbox.PackStart(this.notebook, true, true, 2); // Add Download Viewer this.tabDownloads = new TabLabel("<b>Downloads</b>", StockIcons.GetImage("Download", 22)); this.tabDownloads.Button.Sensitive = false; this.downloadViewer = new DownloadViewer(); this.notebook.AppendPage(this.downloadViewer, this.tabDownloads); // Add Uploads Viewer this.tabUploads = new TabLabel("<b>Uploads</b>", StockIcons.GetImage("Upload", 22)); this.tabUploads.Button.Sensitive = false; this.uploadViewer = new UploadViewer(); this.notebook.AppendPage(this.uploadViewer, this.tabUploads); // HButton Box this.hButtonBox = new Gtk.HButtonBox(); this.hButtonBox.Spacing = 4; this.hButtonBox.Layout = ButtonBoxStyle.End; this.hButtonBox.LayoutStyle = ButtonBoxStyle.End; this.vbox.PackStart(this.hButtonBox, false, false, 2); Gtk.Button button; button = new Gtk.Button(Gtk.Stock.Clear); button.Clicked += new EventHandler(OnButtonClear); this.hButtonBox.PackStart(button, false, false, 2); // Show All this.ShowAll(); }
public static void Main(string[] args) { Application.Init (); var window = new Gtk.Window (Gtk.WindowType.Toplevel) { Title = "Treemap Example", BorderWidth = 0,//12, }; window.SetDefaultSize (640, 480); window.DeleteEvent += delegate { Gtk.Application.Quit (); }; window.Show (); var vbox = new Gtk.VBox (false, 6); window.Add (vbox); vbox.Show (); var treemap = new TreeMap.TreeMap () { Model = BuildModel (), TextColumn = 0, WeightColumn = 1, Title = "Treemap Example", }; vbox.PackStart (treemap, true, true, 0); treemap.Show (); var buttonbox = new Gtk.HButtonBox (); buttonbox.BorderWidth = 12; buttonbox.Layout = Gtk.ButtonBoxStyle.End; vbox.PackStart (buttonbox, false, true, 0); buttonbox.Show (); var close = new Gtk.Button (Gtk.Stock.Close); close.CanDefault = true; close.Clicked += delegate { Gtk.Application.Quit (); }; buttonbox.PackStart (close, false, true, 0); window.Default = close; close.Show (); Application.Run (); }
private Gtk.Widget MakeEditPage() { Gtk.VBox vbox = new Gtk.VBox(false, 0); vbox.BorderWidth = 6; Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow(); sw.ShadowType = Gtk.ShadowType.EtchedIn; sw.HscrollbarPolicy = Gtk.PolicyType.Automatic; sw.VscrollbarPolicy = Gtk.PolicyType.Automatic; textView = new Gtk.TextView(); textView.WrapMode = Gtk.WrapMode.Word; textView.Editable = true; textView.Buffer.Text = text; textView.CanFocus = true; textView.NoShowAll = true; textView.SetSizeRequest(-1, 60); sw.Add(textView); sw.Show(); vbox.PackStart(sw, true, true, 0); Gtk.HButtonBox hButtonBox = new Gtk.HButtonBox(); hButtonBox.Layout = Gtk.ButtonBoxStyle.End; cancelButton = new Gtk.Button(Gtk.Stock.Cancel); cancelButton.Clicked += OnEditCanceled; cancelButton.NoShowAll = true; hButtonBox.PackStart(cancelButton, false, false, 0); saveButton = new Gtk.Button(Gtk.Stock.Save); saveButton.Clicked += OnSaveButtonClicked; saveButton.NoShowAll = true; hButtonBox.PackStart(saveButton, false, false, 0); hButtonBox.Show(); vbox.PackStart(hButtonBox, false, false, 6); vbox.Show(); return(vbox); }
public ColorPickerDialog(Color initColor) { this.Build(); this.buttonOk.Name = "MainButton"; this.buttonOk.HasFocus = true; this.SetToDialogStyle((Window)null, true, true, true); if (Platform.IsWindows) { 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; } this.ColorPicker = new ColorSelection(); this.ColorPicker.PreviousColor = initColor; this.ColorPicker.CurrentColor = initColor; this.ColorPicker.HasOpacityControl = false; this.eventbox_bg.Add((Widget)this.ColorPicker); this.ColorPicker.ShowAll(); this.InitKeys(); this.InitMultiLanguage(); }
// Create a Button Box with the specified parameters private Frame CreateButtonBox (bool horizontal, string title, int spacing, ButtonBoxStyle layout) { Frame frame = new Frame (title); Gtk.ButtonBox bbox ; if (horizontal) bbox = new Gtk.HButtonBox (); else bbox = new Gtk.VButtonBox (); bbox.BorderWidth = 5; frame.Add (bbox); // Set the appearance of the Button Box bbox.Layout = layout; bbox.Spacing = spacing; bbox.Add (new Button (Stock.Ok)); bbox.Add (new Button (Stock.Cancel)); bbox.Add (new Button (Stock.Help)); return frame; }
private void ChangeBtnPosion() { HButtonBox actionArea = this.ActionArea; ButtonBox.ButtonBoxChild buttonBoxChild1 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonYes]; ButtonBox.ButtonBoxChild buttonBoxChild2 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonCancel]; ButtonBox.ButtonBoxChild buttonBoxChild3 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonNo]; if (Platform.IsWindows) { buttonBoxChild1.Position = 0; buttonBoxChild3.Position = 1; buttonBoxChild2.Position = 2; } else { if (!Platform.IsMac) { return; } buttonBoxChild3.Position = 0; buttonBoxChild2.Position = 1; buttonBoxChild1.Position = 2; } }
private void createButtons() { label_macOSX = new Gtk.Label(); label_macOSX.Text = Catalog.GetString("There is a known problem with MacOSX:") + "\n" + Catalog.GetString("If Chronopic is disconnected after jumps or runs execution,\nthat port will be blocked until restart of machine.") + "\n\n" + Catalog.GetString("We are working on a solution."); if (UtilAll.GetOSEnum() == UtilAll.OperatingSystems.MACOSX) { vbox_main.Add(label_macOSX); } FakeButtonCloseSerialPort = new Gtk.Button(); Gtk.Button button_close_serial_port = new Gtk.Button("Close serial port (debug)"); button_close_serial_port.Clicked += new EventHandler(on_button_close_serial_port_clicked); //---- button close start ---> Gtk.Button button_close = new Gtk.Button("Close Window"); button_close.Clicked += new EventHandler(on_button_close_clicked); Gtk.AccelGroup ag = new Gtk.AccelGroup(); //button can be called clicking Escape key chronopic_register_win.AddAccelGroup(ag); button_close.AddAccelerator ("activate", ag, new Gtk.AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None, Gtk.AccelFlags.Visible)); //<---- button close end //add buttons to containers Gtk.HButtonBox hbox = new Gtk.HButtonBox(); //hbox.Add(button_close_serial_port); hbox.Add(button_close); vbox_main.Add(hbox); }
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; }
public StructureDatabaseView(string fileName) { this.filename = fileName; hbox = new HBox(); sqlLiteDal = new SqlLiteDal(fileName); lblTable = new Label( MainClass.Languages.Translate("tables")); hbox.PackStart(lblTable, false, false, 10); cbTable = new ComboBox(); cbTable.Changed += new EventHandler(OnComboProjectChanged); CellRendererText textRenderer = new CellRendererText(); cbTable.PackStart(textRenderer, true); cbTable.AddAttribute(textRenderer, "text", 0); cbTable.Model = tablesComboModel; cbTable.WidthRequest = 200; hbox.PackStart(cbTable, false, false, 2); hbox.PackEnd(new Label(""), true, true, 2); HButtonBox hbbAction = new HButtonBox(); hbbAction.LayoutStyle = Gtk.ButtonBoxStyle.Start; hbbAction.Spacing =6; Button btnAddTable = new Button(MainClass.Languages.Translate("add_table")); btnAddTable.Clicked+= delegate(object sender, EventArgs e) { SqlLiteAddTable addtable = new SqlLiteAddTable( filename ); int result = addtable.Run(); if (result == (int)ResponseType.Ok) { GetTables(); } addtable.Destroy(); }; Button btnDeleteTable = new Button(MainClass.Languages.Translate("delete_table")); btnDeleteTable.Clicked+= delegate(object sender, EventArgs e) { if(!CheckSelectTable()) return; MessageDialogs md = new MessageDialogs(MessageDialogs.DialogButtonType.YesNo,MainClass.Languages.Translate("permanently_delete_table", curentTable), "", Gtk.MessageType.Question); int result = md.ShowDialog(); if (result != (int)Gtk.ResponseType.Yes) return; DropTable(); GetTables(); }; Button btnEditTable = new Button(MainClass.Languages.Translate("edit_table")); btnEditTable.Clicked+= delegate(object sender, EventArgs e) { if(!CheckSelectTable()) return; SqlLiteEditTable editTable = new SqlLiteEditTable(filename,curentTable); int result = editTable.Run(); if (result == (int)ResponseType.Ok) { GetTables(); } editTable.Destroy(); }; hbbAction.Add(btnAddTable); hbbAction.Add(btnDeleteTable); hbbAction.Add(btnEditTable); hbox.PackEnd(hbbAction, false, false, 10); this.PackStart(hbox, false, false, 5); ScrolledWindow sw = new ScrolledWindow(); sw.ShadowType = ShadowType.EtchedIn; sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); treeView = new TreeView(tableModel); GenerateColumns(); treeView.RulesHint = true; //treeView.SearchColumn = (int) Column.Description; sw.Add(treeView); this.PackStart(sw, true, true, 5); ScrolledWindow sw2 = new ScrolledWindow (); sw2.ShadowType = ShadowType.EtchedIn; sw2.SetPolicy (PolicyType.Automatic, PolicyType.Automatic); sw2.HeightRequest = 50; textControl = new TextView(); textControl.Editable = false; textControl.HeightRequest = 50; sw2.Add (textControl); this.PackEnd(sw2, false, false, 5); this.ShowAll(); GetTables(); //cbTable.Active = 0; }
private void InitializeWidgets() { this.Spacing = 10; this.BorderWidth = 10; AccTreeView = new iFolderTreeView(); ScrolledWindow sw = new ScrolledWindow(); sw.ShadowType = Gtk.ShadowType.EtchedIn; sw.Add(AccTreeView); this.PackStart(sw, true, true, 0); AccTreeStore = new ListStore(typeof(string)); AccTreeView.Model = AccTreeStore; TreeViewColumn onlineColumn = new TreeViewColumn(); onlineColumn.Title = Util.GS("Online"); onlineToggleButton = new CellRendererToggle(); onlineToggleButton.Xpad = 5; onlineToggleButton.Xalign = 0.5F; onlineColumn.PackStart(onlineToggleButton, true); onlineColumn.SetCellDataFunc(onlineToggleButton, new TreeCellDataFunc(OnlineCellToggleDataFunc)); onlineToggleButton.Toggled += new ToggledHandler(OnlineToggled); AccTreeView.AppendColumn(onlineColumn); TreeViewColumn serverColumn = new TreeViewColumn(); serverColumn.Title = Util.GS("Server Name"); CellRendererText servercr = new CellRendererText(); servercr.Xpad = 5; serverColumn.PackStart(servercr, false); serverColumn.SetCellDataFunc(servercr, new TreeCellDataFunc(ServerCellTextDataFunc)); serverColumn.Resizable = true; serverColumn.MinWidth = 150; AccTreeView.AppendColumn(serverColumn); TreeViewColumn nameColumn = new TreeViewColumn(); nameColumn.Title = Util.GS("User Name"); CellRendererText ncrt = new CellRendererText(); nameColumn.PackStart(ncrt, false); nameColumn.SetCellDataFunc(ncrt, new TreeCellDataFunc(NameCellTextDataFunc)); nameColumn.Resizable = true; nameColumn.MinWidth = 150; AccTreeView.AppendColumn(nameColumn); AccTreeView.Selection.Mode = SelectionMode.Single; AccTreeView.Selection.Changed += new EventHandler(AccSelectionChangedHandler); HButtonBox buttonBox = new HButtonBox(); buttonBox.Spacing = 10; buttonBox.Layout = ButtonBoxStyle.End; this.PackStart(buttonBox, false, false, 0); AddButton = new Button(Gtk.Stock.Add); buttonBox.PackStart(AddButton); AddButton.Clicked += new EventHandler(OnAddAccount); RemoveButton = new Button(Gtk.Stock.Remove); buttonBox.PackStart(RemoveButton); RemoveButton.Clicked += new EventHandler(OnRemoveAccount); DetailsButton = new Button(Gtk.Stock.Properties); buttonBox.PackStart(DetailsButton); DetailsButton.Clicked += new EventHandler(OnDetailsClicked); AccTreeView.RowActivated += new RowActivatedHandler( OnAccTreeRowActivated); }
private void CreateWidgets() { this.SetDefaultSize (500, 400); this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png")); this.WindowPosition = Gtk.WindowPosition.Center; VBox vbox = new VBox (false, 0); this.Add (vbox); vbox.Spacing = 10; vbox.BorderWidth = 10; AccTreeView = new iFolderTreeView(); ScrolledWindow sw = new ScrolledWindow(); sw.ShadowType = Gtk.ShadowType.EtchedIn; sw.Add(AccTreeView); vbox.PackStart(sw, true, true, 0); AccTreeStore = new ListStore(typeof(string)); AccTreeView.Model = AccTreeStore; TreeViewColumn serverColumn = new TreeViewColumn(); serverColumn.Title = Util.GS("User Name"); CellRendererText servercr = new CellRendererText(); servercr.Xpad = 5; serverColumn.PackStart(servercr, false); serverColumn.SetCellDataFunc(servercr, new TreeCellDataFunc(ServerCellTextDataFunc)); serverColumn.Resizable = true; serverColumn.MinWidth = 150; AccTreeView.AppendColumn(serverColumn); TreeViewColumn nameColumn = new TreeViewColumn(); nameColumn.Title = Util.GS("Home Location"); CellRendererText ncrt = new CellRendererText(); nameColumn.PackStart(ncrt, false); nameColumn.SetCellDataFunc(ncrt, new TreeCellDataFunc(NameCellTextDataFunc)); nameColumn.Resizable = true; nameColumn.MinWidth = 175; AccTreeView.AppendColumn(nameColumn); AccTreeView.Selection.Mode = SelectionMode.Single; AccTreeView.Selection.Changed += new EventHandler(AccSelectionChangedHandler); TreeViewColumn statusColumn = new TreeViewColumn(); statusColumn.Title = Util.GS("Status"); CellRendererText scrt = new CellRendererText(); statusColumn.PackStart(scrt, false); statusColumn.SetCellDataFunc(scrt, new TreeCellDataFunc(StatusCellTextDataFunc)); statusColumn.Resizable = true; statusColumn.MinWidth = 75; AccTreeView.AppendColumn(statusColumn); HButtonBox buttonBox = new HButtonBox(); buttonBox.Spacing = 10; buttonBox.Layout = ButtonBoxStyle.End; vbox.PackStart(buttonBox, false, false, 0); MigrateButton = new Button("_Migrate"); buttonBox.PackStart(MigrateButton); MigrateButton.Clicked += new EventHandler(OnMigrateAccount); DetailsButton = new Button(Gtk.Stock.Cancel); buttonBox.PackStart(DetailsButton); this.DetailsButton.Clicked += new EventHandler(OnCancelClicked); }
private void MessageDialog(string msg) { Dialog dialog = new Dialog(); HButtonBox buttons = new HButtonBox(); buttons.PackStart(Button.NewWithLabel("Ok")); dialog.VBox.PackStart(new Label(msg)); dialog.ActionArea.PackStart(buttons); dialog.ShowAll(); }
private void InitGui() { //genre button Gtk.Image square = new Gtk.Image(null, "Wikipedia-logo-small.png"); Gtk.HBox genre_hbox = new HBox(false, 0); genre_hbox.Add(square); genre_hbox.Add(new Label(Catalog.GetString("Genre"))); genre_button = new Gtk.Button(genre_hbox); genre_button.Relief = ReliefStyle.None; // artist Gtk.HBox artist_hbox = new HBox(false, 0); artist_hbox.Add(new Gtk.Image(null, "Wikipedia-logo-small.png")); artist_hbox.Add(new Label(Catalog.GetString("Artist"))); artist_button = new Gtk.Button(artist_hbox); artist_button.Relief = ReliefStyle.None; //album button Gtk.HBox album_hbox = new HBox(false, 0); album_hbox.Add(new Gtk.Image(null, "Wikipedia-logo-small.png")); album_hbox.Add(new Label(Catalog.GetString("Album"))); album_button = new Gtk.Button(album_hbox); album_button.Relief = ReliefStyle.None; //lyrics button Gtk.HBox lyric_hbox = new HBox(false, 0); lyric_hbox.Add(new Gtk.Image(null, "lyrics.png")); lyric_hbox.Add(new Label(Catalog.GetString("Lyrics"))); lyric_button = new Gtk.Button(lyric_hbox); lyric_button.Relief = ReliefStyle.None; // Button bar Gtk.HButtonBox hb = new Gtk.HButtonBox(); hb.Layout = Gtk.ButtonBoxStyle.Start; hb.Spacing = 5; hb.Add(artist_button); hb.Add(album_button); hb.Add(genre_button); hb.Add(lyric_button); // hide/show button hide_show_button = new Gtk.Button(new Gtk.Image(null, "minus.png")); hide_show_button.Relief = ReliefStyle.None; hide_show_button.Clicked += new EventHandler(OnHideShowClicked); this.minimized = false; //search label Gtk.Label search_l = new Gtk.Label(); search_l.Markup = "<b>" + Catalog.GetString("Search") + ":</b>"; // upper hbox Gtk.HBox toolbar = new Gtk.HBox(false, 5); toolbar.PackStart(new Gtk.Image(Stock.Info, IconSize.Menu), false, false, 5); toolbar.PackStart(search_l, false, false, 5); toolbar.PackStart(hb, true, true, 0); toolbar.PackStart(hide_show_button, false, false, 0); this.wb = new ContextBrowser(); //main = new Gtk.VBox(false,5); this.PackStart(toolbar, false, false, 0); this.PackEnd(wb, true, true, 5); //this.Add(main); this.HeightRequest = 400; //hb.Show(); //this.wb.Show(); //this.main.Show(); this.Show(); }
private void InitGui() { //genre button Gtk.Image square = new Gtk.Image(null,"Wikipedia-logo-small.png"); Gtk.HBox genre_hbox = new HBox(false,0); genre_hbox.Add(square); genre_hbox.Add(new Label(Catalog.GetString("Genre"))); genre_button = new Gtk.Button(genre_hbox); genre_button.Relief = ReliefStyle.None; // artist Gtk.HBox artist_hbox = new HBox(false,0); artist_hbox.Add(new Gtk.Image(null,"Wikipedia-logo-small.png")); artist_hbox.Add(new Label(Catalog.GetString("Artist"))); artist_button = new Gtk.Button(artist_hbox); artist_button.Relief = ReliefStyle.None; //album button Gtk.HBox album_hbox = new HBox(false,0); album_hbox.Add(new Gtk.Image(null,"Wikipedia-logo-small.png")); album_hbox.Add(new Label(Catalog.GetString("Album"))); album_button = new Gtk.Button(album_hbox); album_button.Relief = ReliefStyle.None; //lyrics button Gtk.HBox lyric_hbox = new HBox(false,0); lyric_hbox.Add(new Gtk.Image(null,"lyrics.png")); lyric_hbox.Add(new Label(Catalog.GetString("Lyrics"))); lyric_button = new Gtk.Button(lyric_hbox); lyric_button.Relief = ReliefStyle.None; // Button bar Gtk.HButtonBox hb = new Gtk.HButtonBox(); hb.Layout = Gtk.ButtonBoxStyle.Start; hb.Spacing = 5; hb.Add(artist_button); hb.Add(album_button); hb.Add(genre_button); hb.Add(lyric_button); // hide/show button hide_show_button = new Gtk.Button(new Gtk.Image(null,"minus.png")); hide_show_button.Relief = ReliefStyle.None; hide_show_button.Clicked += new EventHandler(OnHideShowClicked); this.minimized = false; //search label Gtk.Label search_l = new Gtk.Label(); search_l.Markup = "<b>"+Catalog.GetString("Search")+":</b>"; // upper hbox Gtk.HBox toolbar = new Gtk.HBox(false,5); toolbar.PackStart(new Gtk.Image(Stock.Info,IconSize.Menu),false,false,5); toolbar.PackStart(search_l,false,false,5); toolbar.PackStart(hb,true,true,0); toolbar.PackStart(hide_show_button,false,false,0); this.wb = new ContextBrowser(); //main = new Gtk.VBox(false,5); this.PackStart(toolbar,false,false,0); this.PackEnd(wb,true,true,5); //this.Add(main); this.HeightRequest = 400; //hb.Show(); //this.wb.Show(); //this.main.Show(); this.Show(); }
public SparkleLog(string path) : base("") { LocalPath = path; string name = System.IO.Path.GetFileName (LocalPath); SetDefaultSize (480, 640); SetPosition (WindowPosition.Center); BorderWidth = 0; // TRANSLATORS: {0} is a folder name, and {1} is a server address Title = String.Format(_("Recent Events in ‘{0}’"), name); IconName = "folder-sparkleshare"; DeleteEvent += delegate { Close (); }; // Adds a hidden menubar that contains to enable keyboard // shortcuts to close the log MenuBar = new MenuBar (); MenuItem file_item = new MenuItem ("File"); Menu file_menu = new Menu (); MenuItem close_1 = new MenuItem ("Close1"); MenuItem close_2 = new MenuItem ("Close2"); // adds specific Ctrl+W and Esc key accelerators to Log Window AccelGroup accel_group = new AccelGroup (); AddAccelGroup (accel_group); // Close on Esc close_1.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.W, Gdk.ModifierType.ControlMask, AccelFlags.Visible)); close_1.Activated += delegate { Close (); }; // Close on Ctrl+W close_2.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None, AccelFlags.Visible)); close_2.Activated += delegate { Close (); }; file_menu.Append (close_1); file_menu.Append (close_2); file_item.Submenu = file_menu; MenuBar.Append (file_item); // Hacky way to hide the menubar, but the accellerators // will simply be disabled when using Hide () MenuBar.HeightRequest = 1; MenuBar.ModifyBg (StateType.Normal, Style.Background (StateType.Normal)); LayoutVertical = new VBox (false, 0); LayoutVertical.PackStart (CreateEventLog (), true, true, 0); HButtonBox dialog_buttons = new HButtonBox { Layout = ButtonBoxStyle.Edge, BorderWidth = 12 }; Button open_folder_button = new Button (_("_Open Folder")) { UseUnderline = true }; open_folder_button.Clicked += delegate (object o, EventArgs args) { Process process = new Process (); process.StartInfo.FileName = Defines.OPEN_COMMAND; process.StartInfo.Arguments = LocalPath.Replace (" ", "\\ "); // Escape space-characters process.Start (); Close (); }; Button close_button = new Button (Stock.Close); close_button.Clicked += delegate { Close (); }; dialog_buttons.Add (open_folder_button); dialog_buttons.Add (close_button); LayoutVertical.PackStart (new HSeparator (), false, false, 0); // We have to hide the menubar somewhere... LayoutVertical.PackStart (MenuBar, false, false, 0); LayoutVertical.PackStart (dialog_buttons, false, false, 0); Add (LayoutVertical); }
void Build () { BorderWidth = 0; WidthRequest = 901; HeightRequest = 632; Name = "wizard_dialog"; Title = GettextCatalog.GetString ("New Project"); WindowPosition = WindowPosition.CenterOnParent; TransientFor = IdeApp.Workbench.RootWindow; projectConfigurationWidget = new GtkProjectConfigurationWidget (); projectConfigurationWidget.Name = "projectConfigurationWidget"; // Top banner of dialog. var topLabelEventBox = new EventBox (); topLabelEventBox.Name = "topLabelEventBox"; topLabelEventBox.HeightRequest = 52; topLabelEventBox.ModifyBg (StateType.Normal, bannerBackgroundColor); topLabelEventBox.ModifyFg (StateType.Normal, whiteColor); topLabelEventBox.BorderWidth = 0; var topBannerTopEdgeLineEventBox = new EventBox (); topBannerTopEdgeLineEventBox.Name = "topBannerTopEdgeLineEventBox"; topBannerTopEdgeLineEventBox.HeightRequest = 1; topBannerTopEdgeLineEventBox.ModifyBg (StateType.Normal, bannerLineColor); topBannerTopEdgeLineEventBox.BorderWidth = 0; var topBannerBottomEdgeLineEventBox = new EventBox (); topBannerBottomEdgeLineEventBox.Name = "topBannerBottomEdgeLineEventBox"; topBannerBottomEdgeLineEventBox.HeightRequest = 1; topBannerBottomEdgeLineEventBox.ModifyBg (StateType.Normal, bannerLineColor); topBannerBottomEdgeLineEventBox.BorderWidth = 0; topBannerLabel = new Label (); topBannerLabel.Name = "topBannerLabel"; Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy (); // UNDONE: VV: Use FontService? font.Size = (int)(font.Size * 1.8); topBannerLabel.ModifyFont (font); topBannerLabel.ModifyFg (StateType.Normal, whiteColor); var topLabelHBox = new HBox (); topLabelHBox.Name = "topLabelHBox"; topLabelHBox.PackStart (topBannerLabel, false, false, 20); topLabelEventBox.Add (topLabelHBox); VBox.PackStart (topBannerTopEdgeLineEventBox, false, false, 0); VBox.PackStart (topLabelEventBox, false, false, 0); VBox.PackStart (topBannerBottomEdgeLineEventBox, false, false, 0); // Main templates section. centreVBox = new VBox (); centreVBox.Name = "centreVBox"; VBox.PackStart (centreVBox, true, true, 0); templatesHBox = new HBox (); templatesHBox.Name = "templatesHBox"; centreVBox.PackEnd (templatesHBox, true, true, 0); // Template categories. var templateCategoriesBgBox = new EventBox (); templateCategoriesBgBox.Name = "templateCategoriesVBox"; templateCategoriesBgBox.BorderWidth = 0; templateCategoriesBgBox.ModifyBg (StateType.Normal, categoriesBackgroundColor); templateCategoriesBgBox.WidthRequest = 220; var templateCategoriesScrolledWindow = new ScrolledWindow (); templateCategoriesScrolledWindow.Name = "templateCategoriesScrolledWindow"; templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never; // Template categories tree view. templateCategoriesTreeView = new TreeView (); templateCategoriesTreeView.Name = "templateCategoriesTreeView"; templateCategoriesTreeView.BorderWidth = 0; templateCategoriesTreeView.HeadersVisible = false; templateCategoriesTreeView.Model = templateCategoriesListStore; templateCategoriesTreeView.SearchColumn = -1; // disable the interactive search templateCategoriesTreeView.AppendColumn (CreateTemplateCategoriesTreeViewColumn ()); templateCategoriesScrolledWindow.Add (templateCategoriesTreeView); templateCategoriesBgBox.Add (templateCategoriesScrolledWindow); templatesHBox.PackStart (templateCategoriesBgBox, false, false, 0); // Templates. var templatesBgBox = new EventBox (); templatesBgBox.ModifyBg (StateType.Normal, templateListBackgroundColor); templatesBgBox.Name = "templatesVBox"; templatesBgBox.WidthRequest = 400; templatesHBox.PackStart (templatesBgBox, false, false, 0); var templatesScrolledWindow = new ScrolledWindow (); templatesScrolledWindow.Name = "templatesScrolledWindow"; templatesScrolledWindow.HscrollbarPolicy = PolicyType.Never; // Templates tree view. templatesTreeView = new TreeView (); templatesTreeView.Name = "templatesTreeView"; templatesTreeView.HeadersVisible = false; templatesTreeView.Model = templatesListStore; templatesTreeView.SearchColumn = -1; // disable the interactive search templatesTreeView.AppendColumn (CreateTemplateListTreeViewColumn ()); templatesScrolledWindow.Add (templatesTreeView); templatesBgBox.Add (templatesScrolledWindow); // Template var templateEventBox = new EventBox (); templateEventBox.Name = "templateEventBox"; templateEventBox.ModifyBg (StateType.Normal, templateBackgroundColor); templatesHBox.PackStart (templateEventBox, true, true, 0); templateVBox = new VBox (); templateVBox.Visible = false; templateVBox.BorderWidth = 20; templateVBox.Spacing = 10; templateEventBox.Add (templateVBox); // Template large image. templateImage = new ImageView (); templateImage.Name = "templateImage"; templateImage.HeightRequest = 140; templateImage.WidthRequest = 240; templateVBox.PackStart (templateImage, false, false, 10); // Template description. templateNameLabel = new Label (); templateNameLabel.Name = "templateNameLabel"; templateNameLabel.WidthRequest = 240; templateNameLabel.Wrap = true; templateNameLabel.Xalign = 0; templateNameLabel.Markup = MarkupTemplateName ("TemplateName"); templateVBox.PackStart (templateNameLabel, false, false, 0); templateDescriptionLabel = new Label (); templateDescriptionLabel.Name = "templateDescriptionLabel"; templateDescriptionLabel.WidthRequest = 240; templateDescriptionLabel.Wrap = true; templateDescriptionLabel.Xalign = 0; templateVBox.PackStart (templateDescriptionLabel, false, false, 0); templateVBox.PackStart (new Label (), true, true, 0); // Template - button separator. var templateSectionSeparatorEventBox = new EventBox (); templateSectionSeparatorEventBox.Name = "templateSectionSeparatorEventBox"; templateSectionSeparatorEventBox.HeightRequest = 1; templateSectionSeparatorEventBox.ModifyBg (StateType.Normal, templateSectionSeparatorColor); VBox.PackStart (templateSectionSeparatorEventBox, false, false, 0); // Buttons at bottom of dialog. var bottomHBox = new HBox (); bottomHBox.Name = "bottomHBox"; VBox.PackStart (bottomHBox, false, false, 0); // Cancel button - bottom left. var cancelButtonBox = new HButtonBox (); cancelButtonBox.Name = "cancelButtonBox"; cancelButtonBox.BorderWidth = 16; cancelButton = new Button (); cancelButton.Name = "cancelButton"; cancelButton.Label = "gtk-cancel"; cancelButton.UseStock = true; cancelButtonBox.PackStart (cancelButton, false, false, 0); bottomHBox.PackStart (cancelButtonBox, false, false, 0); // Previous button - bottom right. var previousNextButtonBox = new HButtonBox (); previousNextButtonBox.Name = "previousNextButtonBox"; previousNextButtonBox.BorderWidth = 16; previousNextButtonBox.Spacing = 9; bottomHBox.PackStart (previousNextButtonBox); previousNextButtonBox.Layout = ButtonBoxStyle.End; previousButton = new Button (); previousButton.Name = "previousButton"; previousButton.Label = GettextCatalog.GetString ("Previous"); previousButton.Sensitive = false; previousNextButtonBox.PackEnd (previousButton); // Next button - bottom right. nextButton = new Button (); nextButton.Name = "nextButton"; nextButton.Label = GettextCatalog.GetString ("Next"); previousNextButtonBox.PackEnd (nextButton); // Remove default button action area. VBox.Remove (ActionArea); if (Child != null) { Child.ShowAll (); } Show (); templatesTreeView.HasFocus = true; Resizable = false; }
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 (); }
protected virtual void Build() { Gui.Initialize((Widget)this); this.Name = "Gtk.MessageBoxDialog"; this.WindowPosition = WindowPosition.CenterOnParent; this.Resizable = false; this.AllowGrow = false; VBox vbox = this.VBox; vbox.Name = "dialog1_VBox"; vbox.BorderWidth = 2U; this.vbox_main = new VBox(); this.vbox_main.Name = "vbox_main"; this.vbox_main.Spacing = 6; this.vbox_main.BorderWidth = 15U; this.vbox_top = new VBox(); this.vbox_top.Name = "vbox_top"; this.vbox_top.Spacing = 6; this.vbox_main.Add((Widget)this.vbox_top); ((Box.BoxChild) this.vbox_main[(Widget)this.vbox_top]).Position = 0; this.alignment_label = new Alignment(0.5f, 0.5f, 1f, 1f); this.alignment_label.Name = "alignment_label"; this.alignment_label.TopPadding = 18U; this.alignment_label.BottomPadding = 18U; this.labelInfo = new Label(); this.labelInfo.Name = "labelInfo"; this.labelInfo.LabelProp = Catalog.GetString("label1"); this.labelInfo.Wrap = true; this.alignment_label.Add((Widget)this.labelInfo); this.vbox_main.Add((Widget)this.alignment_label); Box.BoxChild boxChild = (Box.BoxChild) this.vbox_main[(Widget)this.alignment_label]; boxChild.Position = 1; boxChild.Expand = false; boxChild.Fill = false; this.vbox_bottom = new VBox(); this.vbox_bottom.Name = "vbox_bottom"; this.vbox_bottom.Spacing = 6; this.vbox_main.Add((Widget)this.vbox_bottom); ((Box.BoxChild) this.vbox_main[(Widget)this.vbox_bottom]).Position = 2; vbox.Add((Widget)this.vbox_main); ((Box.BoxChild)vbox[(Widget)this.vbox_main]).Position = 0; 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.buttonNo = new Button(); this.buttonNo.CanFocus = true; this.buttonNo.Name = "buttonNo"; this.buttonNo.UseStock = true; this.buttonNo.UseUnderline = true; this.buttonNo.Label = "gtk-no"; this.AddActionWidget((Widget)this.buttonNo, -9); ButtonBox.ButtonBoxChild buttonBoxChild2 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonNo]; buttonBoxChild2.Position = 1; buttonBoxChild2.Expand = false; buttonBoxChild2.Fill = false; this.buttonYes = new Button(); this.buttonYes.CanDefault = true; this.buttonYes.CanFocus = true; this.buttonYes.Name = "buttonYes"; this.buttonYes.UseStock = true; this.buttonYes.UseUnderline = true; this.buttonYes.Label = "gtk-yes"; this.AddActionWidget((Widget)this.buttonYes, -8); ButtonBox.ButtonBoxChild buttonBoxChild3 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonYes]; buttonBoxChild3.Position = 2; buttonBoxChild3.Expand = false; buttonBoxChild3.Fill = false; if (this.Child != null) { this.Child.ShowAll(); } this.DefaultWidth = 244; this.DefaultHeight = 160; this.Show(); }
private static Gtk.ResponseType showErrDialog(Exception e, bool canContinue) { Gtk.Table pnlError; Gtk.Image pctError; Gtk.Label lblError; Gtk.ScrolledWindow scrError; Gtk.TextView txtError; Gtk.Button cmdReport; Gtk.Button cmdIgnore; Gtk.Button cmdExit; pnlError = new Gtk.Table(2, 2, false); pnlError.Name = "pnlError"; pnlError.RowSpacing = 6; pnlError.ColumnSpacing = 6; pctError = new Gtk.Image(); pctError.Name = "pctError"; pctError.Xpad = 8; pctError.Ypad = 8; if (CurrentOS.IsMac) { pctError.Pixbuf = Gdk.Pixbuf.LoadFromResource("RestrictionTrackerGTK.Resources.config.os_x.advanced_nettest_error.png"); } else { pctError.Pixbuf = Gdk.Pixbuf.LoadFromResource("RestrictionTrackerGTK.Resources.config.linux.advanced_nettest_error.png"); } pnlError.Attach(pctError, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0); lblError = new Gtk.Label(); lblError.Name = "lblError"; lblError.Xalign = 0F; lblError.Yalign = 0.5F; if (e.TargetSite == null) { lblError.LabelProp = "<span size=\"12000\" weight=\"bold\">" + modFunctions.ProductName + " has Encountered an Error</span>"; } else { lblError.LabelProp = "<span size=\"12000\" weight=\"bold\">" + modFunctions.ProductName + " has Encountered an Error in " + e.TargetSite.Name + "</span>"; } var signal = GLib.Signal.Lookup(lblError, "size-allocate", typeof(SizeAllocatedArgs)); signal.AddDelegate(new EventHandler <SizeAllocatedArgs>(SizeAllocateLabel)); lblError.LineWrap = true; lblError.UseMarkup = true; pnlError.Attach(lblError, 1, 2, 0, 1, AttachOptions.Shrink | AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0); scrError = new Gtk.ScrolledWindow(); scrError.Name = "scrError"; scrError.VscrollbarPolicy = PolicyType.Automatic; scrError.HscrollbarPolicy = PolicyType.Never; scrError.ShadowType = ShadowType.In; txtError = new Gtk.TextView(); txtError.CanFocus = true; txtError.Name = "txtError"; txtError.Editable = false; txtError.AcceptsTab = false; txtError.WrapMode = WrapMode.Word; scrError.Add(txtError); pnlError.Attach(scrError, 1, 2, 1, 2, AttachOptions.Shrink | AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink | AttachOptions.Fill | AttachOptions.Expand, 0, 0); txtError.Buffer.Text = "Error: " + e.Message; if (!string.IsNullOrEmpty(e.StackTrace)) { if (e.StackTrace.Contains("\n")) { txtError.Buffer.Text += "\n" + e.StackTrace.Substring(0, e.StackTrace.IndexOf("\n")); } else { txtError.Buffer.Text += "\n" + e.StackTrace; } } else { if (!string.IsNullOrEmpty(e.Source)) { txtError.Buffer.Text += "\n @ " + e.Source; if (e.TargetSite != null) { txtError.Buffer.Text += "." + e.TargetSite.Name; } } else { if (e.TargetSite != null) { txtError.Buffer.Text += "\n @ " + e.TargetSite.Name; } } } cmdReport = new Gtk.Button(); cmdReport.CanDefault = true; cmdReport.CanFocus = true; cmdReport.Name = "cmdReport"; cmdReport.UseUnderline = false; cmdReport.Label = "Report Error"; if (canContinue) { cmdIgnore = new Gtk.Button(); cmdIgnore.CanDefault = true; cmdIgnore.CanFocus = true; cmdIgnore.Name = "cmdIgnore"; cmdIgnore.UseUnderline = false; cmdIgnore.Label = "Ignore and Continue"; } else { cmdIgnore = null; } cmdExit = new global::Gtk.Button(); cmdExit.CanFocus = true; cmdExit.Name = "cmdExit"; cmdExit.UseUnderline = true; cmdExit.Label = global::Mono.Unix.Catalog.GetString("Exit Application"); Gtk.Dialog dlgErr = new Gtk.Dialog("Error in " + modFunctions.ProductName, null, DialogFlags.Modal | DialogFlags.DestroyWithParent, cmdReport); dlgErr.TypeHint = Gdk.WindowTypeHint.Dialog; dlgErr.WindowPosition = WindowPosition.CenterAlways; dlgErr.SkipPagerHint = true; dlgErr.SkipTaskbarHint = true; dlgErr.AllowShrink = true; dlgErr.AllowGrow = true; VBox pnlErrorDialog = dlgErr.VBox; pnlErrorDialog.Name = "pnlErrorDialog"; pnlErrorDialog.BorderWidth = 2; pnlErrorDialog.Add(pnlError); Box.BoxChild pnlError_BC = (Box.BoxChild)pnlErrorDialog[pnlError]; pnlError_BC.Position = 0; Gtk.HButtonBox dlgErrorAction = dlgErr.ActionArea; dlgErrorAction.Name = "dlgErrorAction"; dlgErrorAction.Spacing = 10; dlgErrorAction.BorderWidth = 5; dlgErrorAction.LayoutStyle = ButtonBoxStyle.End; dlgErr.AddActionWidget(cmdReport, ResponseType.Ok); if (canContinue) { dlgErr.AddActionWidget(cmdIgnore, ResponseType.No); } dlgErr.AddActionWidget(cmdExit, ResponseType.Reject); dlgErr.ShowAll(); Gdk.Geometry minGeo = new Gdk.Geometry(); minGeo.MinWidth = dlgErr.Allocation.Width; minGeo.MinHeight = dlgErr.Allocation.Height; if (minGeo.MinWidth > 1 & minGeo.MinHeight > 1) { dlgErr.SetGeometryHints(null, minGeo, Gdk.WindowHints.MinSize); } Gtk.ResponseType dRet; do { dRet = (Gtk.ResponseType)dlgErr.Run(); } while (dRet == ResponseType.None); dlgErr.Hide(); dlgErr.Destroy(); dlgErr = null; return(dRet); }
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) { // 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.Core.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 (); }
private void CreateAbout() { Gdk.Color color = Style.Foreground (StateType.Insensitive); string secondary_text_color = SparkleUIHelpers.GdkColorToHex (color); EventBox box = new EventBox (); box.ModifyBg (StateType.Normal, new TreeView ().Style.Base (StateType.Normal)); Label header = new Label () { Markup = "<span font_size='xx-large'>SparkleShare</span>\n<span fgcolor='" + secondary_text_color + "'><small>" + Defines.VERSION + "</small></span>", Xalign = 0, Xpad = 18, Ypad = 18 }; box.Add (header); this.version = new Label () { Markup = "<small>Checking for updates...</small>", Xalign = 0, Xpad = 18, Ypad = 22, }; Label license = new Label () { Xalign = 0, Xpad = 18, Ypad = 0, LineWrap = true, Wrap = true, LineWrapMode = Pango.WrapMode.Word, Markup = "<small>Copyright © 2010–" + DateTime.Now.Year + " Hylke Bons and others\n" + "\n" + "SparkleShare is Free and Open Source Software. " + "You are free to use, modify, and redistribute it " + "under the terms of the GNU General Public License version 3 or later.</small>" }; VBox vbox = new VBox (false, 0) { BorderWidth = 0 }; HButtonBox button_bar = new HButtonBox () { BorderWidth = 12 }; Button credits_button = new Button (_("_Show Credits")) { UseUnderline = true }; credits_button.Clicked += delegate { Process process = new Process (); process.StartInfo.FileName = "xdg-open"; process.StartInfo.Arguments = "http://www.sparkleshare.org/credits"; process.Start (); }; Button website_button = new Button (_("_Visit Website")) { UseUnderline = true }; website_button.Clicked += delegate { Process process = new Process (); process.StartInfo.FileName = "xdg-open"; process.StartInfo.Arguments = "http://www.sparkleshare.org/"; process.Start (); }; button_bar.Add (website_button); button_bar.Add (credits_button); vbox.PackStart (box, true, true, 0); vbox.PackStart (this.version, false, false, 0); vbox.PackStart (license, true, true, 0); vbox.PackStart (new Label (""), true, true, 0); vbox.PackStart (button_bar, false, false, 0); Add (vbox); }
private void CreateEventLog() { LogContent = new EventBox (); VBox layout_vertical = new VBox (false, 0); ScrolledWindow = new ScrolledWindow (); WebView = new WebView () { Editable = false }; WebView.HoveringOverLink += delegate (object o, WebKit.HoveringOverLinkArgs args) { LinkStatus = args.Link; }; // FIXME: Use the right event, waiting for newer webkit bindings: NavigationPolicyDecisionRequested WebView.NavigationRequested += delegate (object o, WebKit.NavigationRequestedArgs args) { if (args.Request.Uri == LinkStatus) { Process process = new Process (); process.StartInfo.FileName = "xdg-open"; process.StartInfo.Arguments = args.Request.Uri.Replace (" ", "\\ "); // Escape space-characters process.Start (); UpdateEventLog (); } }; ScrolledWindow.AddWithViewport (WebView); LogContent.Add (ScrolledWindow); layout_vertical.PackStart (LogContent, true, true, 0); HButtonBox dialog_buttons = new HButtonBox { Layout = ButtonBoxStyle.Edge, BorderWidth = 12 }; Button open_folder_button = new Button (_("_Open Folder")) { UseUnderline = true }; open_folder_button.Clicked += delegate (object o, EventArgs args) { SparkleShare.Controller.OpenSparkleShareFolder (LocalPath); }; Button close_button = new Button (Stock.Close); close_button.Clicked += delegate { HideAll (); }; dialog_buttons.Add (open_folder_button); dialog_buttons.Add (close_button); // We have to hide the menubar somewhere... layout_vertical.PackStart (CreateShortcutsBar (), false, false, 0); layout_vertical.PackStart (dialog_buttons, false, false, 0); Add (layout_vertical); ShowAll (); }
private Gtk.Widget MakeEditPage() { Gtk.VBox vbox = new Gtk.VBox (false, 0); vbox.BorderWidth = 6; Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow (); sw.ShadowType = Gtk.ShadowType.EtchedIn; sw.HscrollbarPolicy = Gtk.PolicyType.Automatic; sw.VscrollbarPolicy = Gtk.PolicyType.Automatic; textView = new Gtk.TextView (); textView.WrapMode = Gtk.WrapMode.Word; textView.Editable = true; textView.Buffer.Text = text; textView.CanFocus = true; textView.NoShowAll = true; textView.SetSizeRequest (-1, 60); sw.Add (textView); sw.Show (); vbox.PackStart (sw, true, true, 0); Gtk.HButtonBox hButtonBox = new Gtk.HButtonBox (); hButtonBox.Layout = Gtk.ButtonBoxStyle.End; cancelButton = new Gtk.Button (Gtk.Stock.Cancel); cancelButton.Clicked += OnEditCanceled; cancelButton.NoShowAll = true; hButtonBox.PackStart (cancelButton, false, false, 0); saveButton = new Gtk.Button (Gtk.Stock.Save); saveButton.Clicked += OnSaveButtonClicked; saveButton.NoShowAll = true; hButtonBox.PackStart (saveButton, false, false, 0); hButtonBox.Show (); vbox.PackStart (hButtonBox, false, false, 6); vbox.Show (); return vbox; }
public SparkleDiffWindow(string file_path, string [] revisions) : base("") { string file_name = System.IO.Path.GetFileName (file_path); Revisions = revisions; SetPosition (WindowPosition.Center); BorderWidth = 12; IconName = "image-x-generic"; FaceCollection face_collection = new FaceCollection (); face_collection.UseGravatar = true; DeleteEvent += Quit; Title = file_name; VBox layout_vertical = new VBox (false, 12); HBox layout_horizontal = new HBox (true, 6); Process process = new Process (); process.EnableRaisingEvents = true; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.UseShellExecute = false; process.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName (file_path); process.StartInfo.FileName = "git"; process.StartInfo.Arguments = "log --format=\"%ct\t%an\t%ae\" " + file_name; process.Start (); ViewLeft = new LeftRevisionView (); ViewRight = new RightRevisionView (); string output = process.StandardOutput.ReadToEnd (); string [] revisions_info = Regex.Split (output.Trim (), "\n"); int i = 0; foreach (string revision_info in revisions_info) { string [] parts = Regex.Split (revision_info.Trim (), "\t"); int timestamp = int.Parse (parts [0]); string author = parts [1]; string email = parts [2]; string date; // TRANSLATORS: This is a format specifier according to System.Globalization.DateTimeFormatInfo if (i == 0) date = "Latest Revision"; else date = String.Format (_("{0} at {1}"), UnixTimestampToDateTime (timestamp).ToString (_("ddd MMM d, yyyy")), UnixTimestampToDateTime (timestamp).ToString (_("H:mm"))); face_collection.AddFace (email); ViewLeft.AddRow (face_collection.GetFace (email, 32), author, date); ViewRight.AddRow (face_collection.GetFace (email, 32), author, date); i++; } ViewLeft.SetImage (new RevisionImage (file_path, Revisions [1])); ViewRight.SetImage (new RevisionImage (file_path, Revisions [0])); ViewLeft.IconView.SelectionChanged += delegate { ViewLeft.SetImage (new RevisionImage (file_path, Revisions [ViewLeft.GetSelected ()])); ViewLeft.ScrolledWindow.Hadjustment = ViewRight.ScrolledWindow.Hadjustment; ViewLeft.ScrolledWindow.Vadjustment = ViewRight.ScrolledWindow.Vadjustment; HookUpViews (); }; ViewRight.IconView.SelectionChanged += delegate { ViewRight.SetImage (new RevisionImage (file_path, Revisions [ViewRight.GetSelected ()])); ViewRight.ScrolledWindow.Hadjustment = ViewLeft.ScrolledWindow.Hadjustment; ViewRight.ScrolledWindow.Vadjustment = ViewLeft.ScrolledWindow.Vadjustment; HookUpViews (); }; ViewLeft.ToggleButton.Clicked += delegate { if (ViewLeft.ToggleButton.Active) DetachViews (); else HookUpViews (); }; ViewRight.ToggleButton.Clicked += delegate { if (ViewLeft.ToggleButton.Active) DetachViews (); else HookUpViews (); }; layout_horizontal.PackStart (ViewLeft); layout_horizontal.PackStart (ViewRight); ResizeToViews (); // Order time view according to the user's reading direction if (Direction == Gtk.TextDirection.Rtl) layout_horizontal.ReorderChild (ViewLeft, 1); HookUpViews (); HButtonBox dialog_buttons = new HButtonBox (); dialog_buttons.Layout = ButtonBoxStyle.End; dialog_buttons.BorderWidth = 0; Button close_button = new Button (Stock.Close); close_button.Clicked += delegate (object o, EventArgs args) { Environment.Exit (0); }; dialog_buttons.Add (close_button); layout_vertical.PackStart (layout_horizontal, true, true, 0); layout_vertical.PackStart (dialog_buttons, false, false, 0); Add (layout_vertical); }
private Gtk.Widget MakeViewPage() { Gtk.VBox vbox = new Gtk.VBox (false, 0); vbox.BorderWidth = 6; textLabel = new Gtk.Label (); textLabel.Xalign = 0; textLabel.UseUnderline = false; textLabel.Justify = Gtk.Justification.Left; textLabel.Wrap = true; textLabel.Text = text; textLabel.Show (); vbox.PackStart (textLabel, true, true, 0); Gtk.HButtonBox hButtonBox = new Gtk.HButtonBox (); hButtonBox.Layout = Gtk.ButtonBoxStyle.End; deleteButton = new Gtk.Button (Gtk.Stock.Delete); deleteButton.Clicked += OnDeleteButtonClicked; deleteButton.Show (); hButtonBox.PackStart (deleteButton, false, false, 0); editButton = new Gtk.Button (Gtk.Stock.Edit); editButton.Clicked += OnEditButtonClicked; editButton.Show (); hButtonBox.PackStart (editButton, false, false, 0); hButtonBox.Show (); vbox.PackStart (hButtonBox, false, false, 0); vbox.Show (); return vbox; }
Widget CreateButtonBox () { var buttons = new HButtonBox () { Layout = ButtonBoxStyle.End, Spacing = 12 }; 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 FirstRun() : base(WindowType.Toplevel) { IconName = Stock.Convert; Title = "Import OPML file"; Resizable = false; BorderWidth = 6; vbox = new VBox(false, 6); Add(vbox); hbox = new HBox(false, 6); vbox.PackStart(hbox); image = new Image("dialog-question", IconSize.Dialog); hbox.PackStart(image); table = new Table(2, 3, false); table.RowSpacing = 6; hbox.PackStart(table); label = new Label("To import feeds, select an OPML file."); label.LineWrap = true; table.Attach(label, 1, 2, 0, 1); fcdialog = new OpmlDialog(); fcbutton = new FileChooserButton(fcdialog); table.Attach(fcbutton, 1, 2, 1, 2); bbox = new HButtonBox(); vbox.PackEnd(bbox); cancel_button = new Button(Stock.Cancel); cancel_button.Clicked += OnCancel; bbox.PackEnd(cancel_button); add_button = new Button(Stock.Convert); add_button.Clicked += new EventHandler(OnImport); bbox.PackEnd(add_button); }