public DropDownBoxListWindow (IListDataProvider provider) : base(Gtk.WindowType.Popup) { this.DataProvider = provider; this.TransientFor = MonoDevelop.Ide.IdeApp.Workbench.RootWindow; this.TypeHint = Gdk.WindowTypeHint.Menu; this.BorderWidth = 1; this.Events |= Gdk.EventMask.KeyPressMask; hBox = new HBox (); list = new ListWidget (this); list.SelectItem += delegate { var sel = list.Selection; if (sel >= 0 && sel < DataProvider.IconCount) { DataProvider.ActivateItem (sel); Destroy (); } }; list.ScrollEvent += HandleListScrollEvent; list.SizeAllocated += delegate { QueueResize (); }; list.PageChanged += HandleListPageChanged; hBox.PackStart (list, true, true, 0); vScrollbar = new VScrollbar (null); vScrollbar.ValueChanged += delegate { list.ForcePage ((int)vScrollbar.Value); }; hBox.PackStart (vScrollbar, false, false, 0); Add (hBox); ShowAll (); }
public DockFrame () { GtkWorkarounds.FixContainerLeak (this); dockBarTop = new DockBar (this, Gtk.PositionType.Top); dockBarBottom = new DockBar (this, Gtk.PositionType.Bottom); dockBarLeft = new DockBar (this, Gtk.PositionType.Left); dockBarRight = new DockBar (this, Gtk.PositionType.Right); container = new DockContainer (this); HBox hbox = new HBox (); hbox.PackStart (dockBarLeft, false, false, 0); hbox.PackStart (container, true, true, 0); hbox.PackStart (dockBarRight, false, false, 0); mainBox = new VBox (); mainBox.PackStart (dockBarTop, false, false, 0); mainBox.PackStart (hbox, true, true, 0); mainBox.PackStart (dockBarBottom, false, false, 0); Add (mainBox); mainBox.ShowAll (); mainBox.NoShowAll = true; CompactGuiLevel = 2; UpdateDockbarsVisibility (); DefaultVisualStyle = new DockVisualStyle (); }
private void initGui() { //create the layout VBox layout = new VBox(); //add the list ScrolledWindow sw = new ScrolledWindow(); sw.AddWithViewport( list ); layout.PackStart ( sw ); //add the add/edit/remove buttons HBox hbox = new HBox(); hbox.PackStart ( BtnAdd ); hbox.PackStart ( BtnEdit ); hbox.PackStart ( BtnRemove ); hbox.PackStart ( BtnSort ); layout.PackStart( hbox, false, true, 0 ); //add the checkboxes hbox = new HBox(); hbox.PackStart( ChkOwnerDrawned , true, true, 0 ); hbox.PackStart( ChkIsCheckBoxList, true, true, 0 ); hbox.PackStart( ChkIsEditable , true, true, 0 ); hbox.PackStart( ChkDragAndDrop , true, true, 0 ); // layout.PackStart( hbox, false, true, 0 ); //add layout this.Add( layout ); }
public PasswordWindow() : base(WindowType.Toplevel) { Password = null; Cancelled = true; box = new HBox(true, 3); label = new Label("Wachtwoord:"); box.PackStart(label); TextTagTable textTagTable = new TextTagTable(); passwordField = new TextView(new TextBuffer(new TextTagTable())); box.PackStart(passwordField); button = new Button(); button.Label = "Ok"; button.Clicked += delegate { Password = passwordField.Buffer.Text; Cancelled = false; Hide(); }; box.PackStart(button); Add(box); ShowAll(); }
public static Widget GetButton (Action action, bool label) { Widget w = action.CreateIcon (IconSize.Button); if (label) { HBox box = new HBox (); box.PackStart (w, false, false, 0); Label l = new Label (); l.Markup = "<small>" + action.Label + "</small>"; box.PackStart (l); w = box; } Button button; if (action is ToggleAction) { ToggleButton toggle = new ToggleButton (); toggle.Active = ((ToggleAction)action).Active; button = toggle; } else { button = new Button (); } button.Relief = ReliefStyle.None; button.Add (w); w.ShowAll (); action.ConnectProxy (button); tips.SetTip (button, action.Tooltip, String.Empty); return button; }
public ConfigurationDialog (LCDService plugin) { this.plugin = plugin; Title = AddinManager.CurrentLocalizer.GetString ("LCD configuration"); BorderWidth = 5; HasSeparator = false; Resizable = false; VBox lcdproc_box = new VBox (); HBox host_box = new HBox (); host_box.PackStart (new Label (AddinManager.CurrentLocalizer.GetString ("Hostname:")), false, false, 3); host_entry = new Entry (); host_box.PackStart (host_entry, true, true, 3); host_entry.Text = this.plugin.Host; host_entry.Changed += new EventHandler (Host_Changed); HBox port_box = new HBox (); port_box.PackStart (new Label (AddinManager.CurrentLocalizer.GetString ("Port:")), false, false, 3); port_spin = new SpinButton (1, 65535, 1); port_box.PackStart (port_spin, true, true, 3); port_spin.Value = this.plugin.Port; port_spin.Changed += new EventHandler (Port_Changed); Frame lcdproc_frame = new Frame (AddinManager.CurrentLocalizer.GetString ("LCDProc Daemon:")); lcdproc_box.PackStart (host_box); lcdproc_box.PackStart (port_box); lcdproc_frame.Add (lcdproc_box); lcdproc_frame.ShowAll (); VBox.PackStart (lcdproc_frame, false, false, 3); AddButton (Stock.Close, ResponseType.Close); }
public ParameterInformationWindow() { desc = new Gtk.Label (""); desc.Xalign = 0; desc.Wrap = true; count = new Gtk.Label (""); mainBox = new HBox (false, 2); mainBox.BorderWidth = 3; HBox arrowHBox = new HBox (); goPrev = new Gtk.Arrow (Gtk.ArrowType.Up, ShadowType.None); arrowHBox.PackStart (goPrev, false, false, 0); arrowHBox.PackStart (count, false, false, 0); goNext = new Gtk.Arrow (Gtk.ArrowType.Down, ShadowType.None); arrowHBox.PackStart (goNext, false, false, 0); VBox vBox = new VBox (); vBox.PackStart (arrowHBox, false, false, 0); mainBox.PackStart (vBox, false, false, 0); mainBox.PackStart (desc, true, true, 0); mainBox.ShowAll (); this.Add (mainBox); EnableTransparencyControl = true; }
public DockItemContainer (DockFrame frame, DockItem item) { this.item = item; mainBox = new VBox (); Add (mainBox); mainBox.ResizeMode = Gtk.ResizeMode.Queue; mainBox.Spacing = 0; ShowAll (); mainBox.PackStart (item.GetToolbar (PositionType.Top).Container, false, false, 0); HBox hbox = new HBox (); hbox.Show (); hbox.PackStart (item.GetToolbar (PositionType.Left).Container, false, false, 0); contentBox = new HBox (); contentBox.Show (); hbox.PackStart (contentBox, true, true, 0); hbox.PackStart (item.GetToolbar (PositionType.Right).Container, false, false, 0); mainBox.PackStart (hbox, true, true, 0); mainBox.PackStart (item.GetToolbar (PositionType.Bottom).Container, false, false, 0); }
/// <summary> /// Constructs the sprite drawing area, along with the various /// rules needed. /// </summary> public Viewer() { // Create the drop-down list HBox box = new HBox(); fps = new SpinButton(1, 100, 1); fps.Value = DesiredFps; fps.Changed += OnFpsChanged; showUpdate = new CheckButton(); box.PackStart(new Label("FPS"), false, false, 0); box.PackStart(fps, false, false, 2); box.PackStart(new Label("Show Update"), false, false, 5); box.PackStart(showUpdate, false, false, 2); box.PackStart(new Label(), true, true, 0); PackStart(box, false, false, 2); // Create the drawing area and pack it area = new DrawingArea(); area.Realized += OnRealized; area.ExposeEvent += OnExposed; area.ConfigureEvent += OnConfigure; PackStart(area, true, true, 2); // Create the viewport Sprites = new SpriteList(); viewport = new SpriteViewport(Sprites); // Start up a little animation loop Timeout.Add(1000 / DesiredFps, OnTick); }
// create the TopBar widget public TopBar() { // create the widgets Button add_button = new Button (Stock.Add); Button remove_button = new Button (Stock.Remove); Label search_label = new Label ("Search:"); Image clear_image = new Image (Stock.Clear, IconSize.Menu); clear_box.Add (clear_image); // hook up the widget events add_button.Clicked += add_clicked; remove_button.Clicked += remove_clicked; search.Changed += search_changed; clear_box.ButtonReleaseEvent += clear_released; clear_box.Realized += clear_realized; // homogeneous button box HBox button_box = new HBox (true, 0); button_box.PackStart (add_button, false, true, 0); button_box.PackStart (remove_button, false, true, 0); // pack widgets this.PackStart (button_box, false, true, 0); this.PackStart (search_label, false, false, 5); this.PackStart (search, true, true, 0); this.PackStart (clear_box, false, false, 0); }
public DockToolbarFrame () { vbox = new VBox (); Add (vbox); DockToolbarPanel topPanel = new DockToolbarPanel (this, Placement.Top); DockToolbarPanel bottomPanel = new DockToolbarPanel (this, Placement.Bottom); DockToolbarPanel leftPanel = new DockToolbarPanel (this, Placement.Left); DockToolbarPanel rightPanel = new DockToolbarPanel (this, Placement.Right); panels = new DockToolbarPanel [4]; panels [(int)Placement.Top] = topPanel; panels [(int)Placement.Bottom] = bottomPanel; panels [(int)Placement.Left] = leftPanel; panels [(int)Placement.Right] = rightPanel; vbox.PackStart (topPanel, false, false, 0); HBox hbox = new HBox (); contentBox = new VBox (); hbox.PackStart (leftPanel, false, false, 0); hbox.PackStart (contentBox, true, true, 0); hbox.PackStart (rightPanel, false, false, 0); vbox.PackStart (hbox, true, true, 0); vbox.PackStart (bottomPanel, false, false, 0); this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask; ShowAll (); }
void doDialog() { #if GTK_SHARP_2_6 bool rename = combo.Active == values.Count + 1; #else bool rename = combo.Active == values.Count; #endif Gtk.Dialog dialog = new Gtk.Dialog( rename ? Catalog.GetString("Rename Group") : Catalog.GetString("New Group"), combo.Toplevel as Gtk.Window, Gtk.DialogFlags.Modal | Gtk.DialogFlags.NoSeparator, Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, Gtk.Stock.Ok, Gtk.ResponseType.Ok); dialog.DefaultResponse = Gtk.ResponseType.Ok; dialog.HasSeparator = false; dialog.BorderWidth = 12; dialog.VBox.Spacing = 18; dialog.VBox.BorderWidth = 0; Gtk.HBox hbox = new Gtk.HBox(false, 12); Gtk.Label label = new Gtk.Label(rename ? Catalog.GetString("_New name:") : Catalog.GetString("_Name:")); Gtk.Entry entry = new Gtk.Entry(); label.MnemonicWidget = entry; hbox.PackStart(label, false, false, 0); entry.ActivatesDefault = true; if (rename) { entry.Text = group; } hbox.PackStart(entry, true, true, 0); dialog.VBox.PackStart(hbox, false, false, 0); dialog.ShowAll(); // Have to set this *after* ShowAll dialog.ActionArea.BorderWidth = 0; Gtk.ResponseType response = (Gtk.ResponseType)dialog.Run(); if (response == Gtk.ResponseType.Cancel || entry.Text.Length == 0) { dialog.Destroy(); Value = group; // reset combo.Active return; } string oldname = group; group = entry.Text; dialog.Destroy(); // FIXME: check that the new name doesn't already exist // This will trigger a GroupsChanged, which will eventually // update combo.Active if (rename) { manager.Rename(oldname, group); } else { manager.Add(group); } }
void Init() { VBox.PackStart(hbox); hbox.PackStart(image, false, false, 0); hbox.PackStart(labelsBox, true, true, 0); labelsBox.PackStart(label, true, true, 0); // Table 3.1 this.Title = ""; this.BorderWidth = 6; //this.Type = WindowType.Toplevel; this.Resizable = false; this.HasSeparator = false; // Table 3.2 this.VBox.Spacing = 12; // Table 3.3 this.hbox.Spacing = 12; this.hbox.BorderWidth = 6; // Table 3.4 this.image.Yalign = 0.00f; //this.image.IconSize = Gtk.IconSize.Dialog; // Table 3.5 this.label.UseMarkup = true; this.label.Wrap = true; this.label.Yalign = 0.00f; this.label.Xalign = 0.00f; }
public CanvasExample () { Gtk.Window win = new Gtk.Window ("Canvas example"); win.DeleteEvent += new DeleteEventHandler (Window_Delete); VBox vbox = new VBox (false, 0); win.Add (vbox); vbox.PackStart (new Label ("Drag - move object.\n" + "Double click - change color\n" + "Right click - delete object"), false, false, 0); canvas = new Canvas (); canvas.SetSizeRequest (width, height); canvas.SetScrollRegion (0.0, 0.0, (double) width, (double) height); vbox.PackStart (canvas, false, false, 0); HBox hbox = new HBox (false, 0); vbox.PackStart (hbox, false, false, 0); Button add_button = new Button ("Add an object"); add_button.Clicked += new EventHandler (AddObject); hbox.PackStart (add_button, false, false, 0); Button quit_button = new Button ("Quit"); quit_button.Clicked += new EventHandler (Quit); hbox.PackStart (quit_button, false, false, 0); win.ShowAll (); }
public Category(Tiles.TileGroupInfo info, int columns) { WidgetFlags |= WidgetFlags.NoWindow; header = new Gtk.HBox(false, 0); headerExpander = new Gtk.Expander("<big><b>" + GLib.Markup.EscapeText(info.Name) + "</b></big>"); ((Gtk.Label)headerExpander.LabelWidget).SetAlignment(0.0f, 0.5f); headerExpander.UseMarkup = true; headerExpander.UseUnderline = true; headerExpander.Show(); header.PackStart(headerExpander, true, true, 0); headerExpander.Activated += OnActivated; scope = Tiles.Utils.TileGroupToScopeType(info.Group); position = new Gtk.Label(); position.ModifyFg(Gtk.StateType.Normal, position.Style.Base(Gtk.StateType.Selected)); header.PackStart(position, false, false, 0); position.Show(); prev = MakeButton(header, Gtk.Stock.GoBack, OnPrev); next = MakeButton(header, Gtk.Stock.GoForward, OnNext); header.Show(); header.Parent = this; header.SizeRequested += HeaderSizeRequested; tiles = new SortedTileList(Beagle.Search.SortType.Relevance); Columns = columns; UpdateButtons(); Expanded = true; }
void Init() { image = new ImageBox(actx); this.AddContent(hbox); hbox.PackStart(image, false, false, 0); hbox.PackStart(labelsBox, true, true, 0); labelsBox.PackStart(label, true, true, 0); // Table 3.1 this.Title = ""; this.BorderWidth = 6; //this.Type = WindowType.Toplevel; this.Resizable = false; #if !XWT_GTK3 this.HasSeparator = false; #endif // Table 3.2 this.SetContentSpacing(12); // Table 3.3 this.hbox.Spacing = 12; this.hbox.BorderWidth = 6; // Table 3.4 this.image.Yalign = 0.00f; //this.image.IconSize = Gtk.IconSize.Dialog; // Table 3.5 this.label.UseMarkup = true; this.label.Wrap = true; this.label.Yalign = 0.00f; this.label.Xalign = 0.00f; }
void BuildDialogUI() { // Add an HBox to the dialog's VBox. HBox hbox = new HBox (false, 8); hbox.BorderWidth = 8; this.VBox.PackStart (hbox, false, false, 0); // Add an Image widget to the HBox using a stock 'info' icon. Image stock = new Image (Stock.DialogInfo, IconSize.Dialog); hbox.PackStart (stock, false, false, 0); // Here we are using a Table to contain the other widgets. // Notice that the Table is added to the hBox. Table table = new Table (2, 2, false); table.RowSpacing = 4; table.ColumnSpacing = 4; hbox.PackStart (table, true, true, 0); Label label = new Label ("_Username"); table.Attach (label, 0, 1, 0, 1); table.Attach (usernameEntry, 1, 2, 0, 1); label.MnemonicWidget = usernameEntry; label = new Label ("_Password"); table.Attach (label, 0, 1, 1, 2); table.Attach (passwordEntry , 1, 2, 1, 2); label.MnemonicWidget = passwordEntry ; hbox.ShowAll (); // Add OK and Cancel Buttons. this.AddButton(Stock.Ok, ResponseType.Ok); this.AddButton(Stock.Cancel, ResponseType.Cancel); }
public SparkleInfobar(string icon_name, string title, string text) { Window window = new Window (WindowType.Popup) { Name = "gtk-tooltip" }; window.EnsureStyle (); Style = window.Style; Label label = new Label () { Markup = "<b>" + title + "</b>\n" + text }; HBox hbox = new HBox (false, 12) { BorderWidth = 12 }; hbox.PackStart (new Image (SparkleUIHelpers.GetIcon (icon_name, 24)), false, false, 0); hbox.PackStart (label, false, false, 0); Add (hbox); }
public ListPage(Notebook notebook, ModulesTreeInfo module) { this.notebook = notebook; this.module = module; headerbox = new HBox(); headerlabel = new Label(module.Text); headerbox.PackStart(headerlabel); //Image img = new Image("gtk-close", IconSize.Menu); close_img = ImageManager.GetImage("Images.close-button.png"); //close_img = new Image("gtk-close", IconSize.Menu); btnCloseTab = new Button(close_img); btnCloseTab.BorderWidth = 0; btnCloseTab.Relief = ReliefStyle.None; //btnCloseTab.WidthRequest = 19; //btnCloseTab.HeightRequest = 19; btnCloseTab.Clicked += delegate { this.Dispose(); }; headerbox.PackStart(btnCloseTab); headerbox.ShowAll(); tableview = new DataTableView(module); this.Add(tableview); this.ShowAll(); notebook.AppendPage(this, headerbox); notebook.SetTabReorderable(this, true); }
private void ShowLogFileButton(){ HBox box = new HBox(); box.PackStart(logFileButImage, true, true, 0); box.PackStart(logFileButLabel, true, true, 0); setSensorLogNameButton.Add(box); setSensorLogNameButton.ShowAll(); }
public DockFrame () { shadedContainer = new ShadedContainer (); dockBarTop = new DockBar (this, Gtk.PositionType.Top); dockBarBottom = new DockBar (this, Gtk.PositionType.Bottom); dockBarLeft = new DockBar (this, Gtk.PositionType.Left); dockBarRight = new DockBar (this, Gtk.PositionType.Right); container = new DockContainer (this); HBox hbox = new HBox (); hbox.PackStart (dockBarLeft, false, false, 0); hbox.PackStart (container, true, true, 0); hbox.PackStart (dockBarRight, false, false, 0); mainBox = new VBox (); mainBox.PackStart (dockBarTop, false, false, 0); mainBox.PackStart (hbox, true, true, 0); mainBox.PackStart (dockBarBottom, false, false, 0); Add (mainBox); mainBox.ShowAll (); mainBox.NoShowAll = true; CompactGuiLevel = 2; dockBarTop.UpdateVisibility (); dockBarBottom.UpdateVisibility (); dockBarLeft.UpdateVisibility (); dockBarRight.UpdateVisibility (); }
private void BuildWidget () { sleepHour = new SpinButton (0,23,1); sleepMin = new SpinButton (0,59,1); sleepHour.WidthChars = 2; sleepMin.WidthChars = 2; int remainder = 0; sleepHour.Value = Math.DivRem (service.SleepTimerDuration, 60, out remainder); sleepMin.Value = remainder; sleepHour.ValueChanged += OnSleepValueChanged; sleepMin.ValueChanged += OnSleepValueChanged; Label prefix = new Label (AddinManager.CurrentLocalizer.GetString ("Sleep Timer :")); Label separator = new Label (":"); HBox topbox = new HBox (false, 10); topbox.PackStart (prefix); topbox.PackStart (sleepHour); topbox.PackStart (separator); topbox.PackStart (sleepMin); AddStockButton (Stock.Cancel, ResponseType.Cancel); start_button = AddButton (AddinManager.CurrentLocalizer.GetString ("Start Timer"), ResponseType.Ok, true); VBox.PackStart (topbox); Update (); }
public DemoMain () { SetupDefaultIcon (); window = new Gtk.Window ("Gtk# Code Demos"); window.SetDefaultSize (600, 400); window.DeleteEvent += new DeleteEventHandler (WindowDelete); HBox hbox = new HBox (false, 0); window.Add (hbox); treeView = CreateTree (); hbox.PackStart (treeView, false, false, 0); Notebook notebook = new Notebook (); hbox.PackStart (notebook, true, true, 0); notebook.AppendPage (CreateText (infoBuffer, false), new Label ("_Info")); TextTag heading = new TextTag ("heading"); heading.Font = "Sans 18"; infoBuffer.TagTable.Add (heading); notebook.AppendPage (CreateText (sourceBuffer, true), new Label ("_Source")); window.ShowAll (); }
private void Build () { // Section label + line var hbox1 = new HBox (false, 6); var label = new Label (); label.LabelProp = Mono.Unix.Catalog.GetString ("Random Noise"); hbox1.PackStart (label, false, false, 0); hbox1.PackStart (new HSeparator (), true, true, 0); // Reseed button button1 = new Button (); button1.WidthRequest = 88; button1.CanFocus = true; button1.UseUnderline = true; button1.Label = Mono.Unix.Catalog.GetString ("Reseed"); var hbox2 = new HBox (false, 6); hbox2.PackStart (button1, false, false, 0); // Main layout var vbox = new VBox (false, 6); vbox.Add (hbox1); vbox.Add (hbox2); Add (vbox); vbox.ShowAll (); }
public SetupWindow() : base("SparkleShare Setup") { SetWmclass ("SparkleShare", "SparkleShare"); IconName = "org.sparkleshare.SparkleShare"; Resizable = false; WindowPosition = WindowPosition.CenterAlways; Deletable = false; TypeHint = Gdk.WindowTypeHint.Dialog; SetSizeRequest (400, 400); DeleteEvent += delegate (object sender, DeleteEventArgs args) { args.RetVal = true; }; VBox layout_vertical = new VBox (false, 16); layout_vertical.BorderWidth = 16; this.content_area = new EventBox (); this.option_area = new EventBox (); this.buttons = CreateButtonBox (); HBox layout_actions = new HBox (false , 16); layout_actions.PackStart (this.option_area, true, true, 0); layout_actions.PackStart (this.buttons, false, false, 0); layout_vertical.PackStart (this.content_area, true, true, 0); layout_vertical.PackStart (layout_actions, false, false, 0); base.Add (layout_vertical); }
public QueryBox (Client app) { this.app = app; AppPaintable = true; hbox = new HBox () { BorderWidth = 6 }; Entry = new Gtk.Entry () { WidthChars = 40 }; Entry.Activated += OnActivated; var query_button = new Hyena.Widgets.ImageButton (Catalog.GetString ("Select Matching"), Gtk.Stock.Find); query_button.Clicked += OnActivated; var close_button = new Hyena.Widgets.ImageButton (null, Gtk.Stock.Close); close_button.Clicked += delegate { Hide (); }; hbox.PackStart (Entry, true, true, 0); hbox.PackStart (query_button, false, false, 0); hbox.PackStart (close_button, false, false, 0); Child = hbox; KeyPressEvent += delegate (object o, KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Escape) { Hide (); } }; ShowAll (); }
public ParameterInformationWindow () { heading = new Gtk.Label (""); heading.Xalign = 0; heading.Wrap = false; desc = new DescriptionLabel (); count = new Gtk.Label (""); var mainBox = new HBox (false, 2); HBox arrowHBox = new HBox (); goPrev = new Gtk.Arrow (Gtk.ArrowType.Up, ShadowType.None); arrowHBox.PackStart (goPrev, false, false, 0); arrowHBox.PackStart (count, false, false, 0); goNext = new Gtk.Arrow (Gtk.ArrowType.Down, ShadowType.None); arrowHBox.PackStart (goNext, false, false, 0); VBox vBox = new VBox (); vBox.PackStart (arrowHBox, false, false, 0); mainBox.PackStart (vBox, false, false, 0); mainBox.PackStart (heading, true, true, 0); var vBox2 = new VBox (); vBox2.BorderWidth = 3; vBox2.PackStart (mainBox, false, false, 0); vBox2.PackStart (desc, true, true, 4); Add (vBox2); EnableTransparencyControl = true; ShowAll (); }
// constructor that show the graphic interface to users public Graphics(Game g) : base(Gtk.WindowType.Toplevel) { Build (); int scale = 10; if (Screen.Height < 1000) scale = 5; this.game = g; VBox gridWrapper = new VBox (); HBox box = new HBox (); this.status = new Label (""); this.chooser = new Popup (this, this.game.getChooseableFigures(), handleChooser, scale); this.mainGrid = new GridWidget (this.game, clickHandler, scale); gridWrapper.PackStart (status, false, false, 0); gridWrapper.PackStart (this.mainGrid, false, false, 0); this.sidebarLeft = new SidebarWidget (g.getRemovedFigures (), "black", scale); box.PackStart (new HBox ()); box.PackStart (this.sidebarLeft); box.PackStart (gridWrapper, false, false, 0); this.sidebarRight = new SidebarWidget (g.getRemovedFigures (), "white", scale); box.PackEnd (this.sidebarRight); box.PackStart (new HBox ()); box.ShowAll (); this.Add (box); updateGui (this.game.initialState ()); this.Show (); }
public void AddMessage (string msg, IconId icon) { if (lastImage != null) { HSeparator sep = new HSeparator (); sep.Show (); msgBox.PackStart (sep, false, false, 0); lastImage.IconSize = Gtk.IconSize.Menu; } HBox box = new HBox (); box.Spacing = 12; Alignment imgBox = new Alignment (0, 0, 0, 0); var img = new ImageView (icon, lastImage != null ? Gtk.IconSize.Menu : IconSize.Dialog); imgBox.Add (img); lastImage = img; box.PackStart (imgBox, false, false, 0); Label lab = new Label (msg); lab.UseUnderline = false; lab.Xalign = 0; lab.Yalign = 0; lab.Wrap = true; lab.WidthRequest = 500; box.PackStart (lab, true, true, 0); msgBox.PackStart (box, false, false, 0); box.ShowAll (); }
public Category (Tiles.TileGroupInfo info, int columns) { WidgetFlags |= WidgetFlags.NoWindow; header = new Gtk.HBox (false, 0); headerExpander = new Gtk.Expander ("<big><b>" + GLib.Markup.EscapeText (info.Name) + "</b></big>"); ((Gtk.Label) headerExpander.LabelWidget).SetAlignment (0.0f, 0.5f); headerExpander.UseMarkup = true; headerExpander.UseUnderline = true; headerExpander.Show (); header.PackStart (headerExpander, true, true, 0); headerExpander.Activated += OnActivated; scope = Tiles.Utils.TileGroupToScopeType(info.Group); position = new Gtk.Label (); position.ModifyFg (Gtk.StateType.Normal, position.Style.Base (Gtk.StateType.Selected)); header.PackStart (position, false, false, 0); position.Show (); prev = MakeButton (header, Gtk.Stock.GoBack, OnPrev); next = MakeButton (header, Gtk.Stock.GoForward, OnNext); header.Show (); header.Parent = this; header.SizeRequested += HeaderSizeRequested; tiles = new SortedTileList (Beagle.Search.SortType.Relevance); Columns = columns; UpdateButtons (); Expanded = true; }
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); }
public void AddMessage (string msg, string icon) { if (lastImage != null) { HSeparator sep = new HSeparator (); sep.Show (); msgBox.PackStart (sep); lastImage.IconSize = (int) Gtk.IconSize.Button; } HBox box = new HBox (); box.Spacing = 12; Alignment imgBox = new Alignment (0, 0, 0, 0); Image img = new Image (icon, lastImage != null ? Gtk.IconSize.Button : IconSize.Dialog); imgBox.Add (img); lastImage = img; box.PackStart (imgBox, false, false, 0); Label lab = new Label (msg); lab.Xalign = 0; lab.Yalign = 0; lab.Wrap = true; lab.WidthRequest = 500; box.PackStart (lab, true, true, 0); msgBox.PackStart (box, false, false, 0); box.ShowAll (); }
public DialogError(string message, Exception e, Window parent) : base("Error", parent, DialogFlags.Modal, Stock.Ok, ResponseType.Ok) { HBox hbox = new HBox(); Image icon = new Image(Stock.DialogError,IconSize.Dialog); Label label = new Label(message); Expander exp = new Expander("Details"); ScrolledWindow sw = new ScrolledWindow(); TextView tview = new TextView(); hbox.BorderWidth = 6; hbox.Spacing = 6; label.SetAlignment(0f, 0.5f); exp.BorderWidth = 6; tview.Buffer.Text = e.Message; tview.Buffer.Text += "\n"; tview.Buffer.Text += e.StackTrace; sw.Add(tview); exp.Add(sw); hbox.PackStart(icon, false, false, 0); hbox.PackStart(label, true, true, 0); this.VBox.PackStart(hbox, false, false, 0); this.VBox.PackStart(exp, true, true, 0); this.ShowAll(); }
public ProgressDialog(Window parent) : base() { this.Title = "Updating iPod..."; this.HasSeparator = false; this.TransientFor = parent; this.DefaultWidth = 400; VBox vbox = new VBox (false, 6); vbox.BorderWidth = 6; HBox hbox = new HBox (false, 6); Gdk.PixbufAnimation animation = new Gdk.PixbufAnimation (Assembly.GetExecutingAssembly (), "ipod.gif"); hbox.PackStart (new Gtk.Image (animation), false, false, 0); label = new Label (""); label.Xalign = 0.0f; label.UseMarkup = true; SetEllipsize (label); hbox.PackStart (label, true, true, 0); vbox.PackStart (hbox, true, false, 0); bar = new ProgressBar (); vbox.PackStart (bar, true, false, 0); VBox.PackStart (vbox, false, false, 0); VBox.ShowAll (); notify = new ThreadNotify (new ReadyEvent (OnNotify)); }
public WidgetBuilderOptionPanelWidget(Project project) : base(false, 6) { this.project = project as DotNetProject; Gtk.HBox box = new Gtk.HBox(false, 3); Gtk.Label lbl = new Gtk.Label(GettextCatalog.GetString("Target Gtk# version:")); box.PackStart(lbl, false, false, 0); comboVersions = ComboBox.NewText(); ReferenceManager refmgr = new ReferenceManager(project as DotNetProject); foreach (string v in refmgr.SupportedGtkVersions) { comboVersions.AppendText(v); } comboVersions.Active = refmgr.SupportedGtkVersions.IndexOf(refmgr.GtkPackageVersion); refmgr.Dispose(); box.PackStart(comboVersions, false, false, 0); box.ShowAll(); PackStart(box, false, false, 0); HSeparator sep = new HSeparator(); sep.Show(); PackStart(sep, false, false, 0); if (!GtkDesignInfo.HasDesignedObjects(project)) { return; } GtkDesignInfo designInfo = GtkDesignInfo.FromProject(project); checkGettext = new CheckButton(GettextCatalog.GetString("Enable gettext support")); checkGettext.Active = designInfo.GenerateGettext; checkGettext.Show(); PackStart(checkGettext, false, false, 0); box = new Gtk.HBox(false, 3); box.PackStart(new Label(GettextCatalog.GetString("Gettext class:")), false, false, 0); entryGettext = new Gtk.Entry(); entryGettext.Text = designInfo.GettextClass; entryGettext.Sensitive = checkGettext.Active; box.PackStart(entryGettext, false, false, 0); box.ShowAll(); PackStart(box, false, false, 0); checkGettext.Clicked += delegate { box.Sensitive = checkGettext.Active; if (checkGettext.Active) { entryGettext.Text = "Mono.Unix.Catalog"; } }; }
/// <summary>Crea el panel inferior del diálogo, el que contiene /// los botones aceptar y cancelar.</summary> /// <returns>El panel creado.</returns> private Gtk.Widget CrearPanelInferior() { Gtk.HBox hbox = new Gtk.HBox(true, 10); btnCancelar = new Gtk.Button(Gtk.Stock.Cancel); btnAceptar = new Gtk.Button(Gtk.Stock.Ok); hbox.PackStart(btnAceptar); hbox.PackStart(btnCancelar); btnCancelar.Clicked += new EventHandler(CancelarClick); btnAceptar.Clicked += new EventHandler(AceptarClick); return(hbox); }
public CS_PlayListAdmin(CS_PlayListsView plsview, CS_PlayListsModel mdl, CS_PlayListCollection cl) { _col = cl; _model = mdl; Gtk.HBox hb = new Gtk.HBox(); Gtk.Button _add = new Gtk.Button(Gtk.Stock.Add); _add.Clicked += delegate(object sender, EventArgs args) { OnAddPls(); }; Gtk.Button _remove = new Gtk.Button(Gtk.Stock.Remove); _remove.Clicked += delegate(object sender, EventArgs args) { OnRemovePls(); }; hb.PackStart(_add); hb.PackStart(_remove); plsscroll = new Gtk.ScrolledWindow(); plsscroll.Add(plsview); _pls = null; _pls_name = new Gtk.Entry(); _pls_model = new CS_PlayListModel(); _pls_view = new CS_PlayListView(); _pls_view.SetModel(_pls_model); plscroll = new Gtk.ScrolledWindow(); plscroll.Add(_pls_view); _pls_view.DragEnd += delegate(object sender, DragEndArgs args) { Console.WriteLine(args); }; Gtk.VBox plsvbox = new Gtk.VBox(); plsvbox.PackStart(_pls_name, false, false, 2); plsvbox.PackEnd(plscroll); Gtk.VPaned vpn = new Gtk.VPaned(); vpn.Add1(plsscroll); vpn.Add2(plsvbox); base.PackStart(hb, false, false, 2); base.PackEnd(vpn); base.ShowAll(); mdl.SetListener(delegate(CS_PlayList pls) { _pls = pls; _pls_model.SetPlayList(_pls); _pls_name.Text = _pls.PlsName; }); }
public PropertyGridHeader() { name = (PropertyDescriptor)Registry.LookupClassByName("Gtk.Widget") ["Name"]; AppendProperty(name); Gtk.HBox box = new Gtk.HBox(false, 6); image = new Gtk.Image(); box.PackStart(image, false, false, 0); label = new Gtk.Label(); box.PackStart(label, false, false, 0); box.ShowAll(); AppendPair("Widget Class", box, null); }
public Tile (Hit hit, Query query) : base () { base.AboveChild = true; base.AppPaintable = true; base.CanFocus = true; this.hit = hit; this.query = query; this.timestamp = hit.Timestamp; this.score = hit.Score; Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask, targets, Gdk.DragAction.Copy | Gdk.DragAction.Move); int pad = (int)StyleGetProperty ("focus-line-width") + (int)StyleGetProperty ("focus-padding") + 1; hbox = new Gtk.HBox (false, 5); hbox.BorderWidth = (uint)(pad + Style.Xthickness); hbox.Show (); icon = new Gtk.Image (); icon.Show (); hbox.PackStart (icon, false, false, 0); Add (hbox); }
internal static void DisplayItem(iPodSharp.ImageItemRecord item, string basepath) { Gtk.Window win = new Gtk.Window("iThumbnail Test"); Gtk.HBox hbox = new Gtk.HBox(); Gtk.VBox vbox = new Gtk.VBox(); win.Add(hbox); hbox.PackStart(vbox); foreach (iPodSharp.ImageDataObjectRecord file in item.Versions) { if (file.Child.CorrelationID > 1) { string path = file.Child.Path.Replace(':', '/'); path = basepath + path; Gdk.Pixbuf thumb = IthmbDb.Load(file.Child.CorrelationID, file.Child.ThumbPosition, file.Child.ThumbSize, path); Gtk.Image image = new Gtk.Image(thumb); vbox.PackStart(image); } } win.ShowAll(); }
private void AppendChat(IChat chat) { Gtk.HBox container = new Gtk.HBox(); Gtk.Label label = new Gtk.Label(chat.Name); container.PackStart(label); Gtk.Button button = new Gtk.Button(new Gtk.Image(Gtk.IconTheme.Default.LookupIcon("gtk-close", 16, Gtk.IconLookupFlags.NoSvg).LoadIcon())); button.Clicked += OnClicked; button.Relief = Gtk.ReliefStyle.None; button.SetSizeRequest(20, 20); container.PackEnd(button); Gtk.TextView view = new Logopathy.Gui.ChatView(chat); ScrolledWindow view_swin = new Gtk.ScrolledWindow(new Gtk.Adjustment(0, 0, 0, 0, 0, 0), new Gtk.Adjustment(0, 0, 0, 0, 0, 0)); view_swin.Add(view); view_swin.SetPolicy(Gtk.PolicyType.Automatic, Gtk.PolicyType.Automatic); hash.Add(container, view); int pos = AppendPage(view_swin, container); container.ShowAll(); ShowAll(); AddedChats.Add(chat); ChatToPage.Add(chat, pos); }
static void Main(string [] args) { Gtk.Application.Init(); string path = args [0]; string name = System.IO.Path.GetFileName(path); int type = Int32.Parse(name.Substring(1, 4)); Console.WriteLine("path {0}, name {1}, id {2}", path, name, type); Gdk.Pixbuf thumb = IthmbDb.Load(type, Int64.Parse(args [1]), 0, path); Gtk.Window win = new Gtk.Window("iThumbnail Test"); Gtk.HBox hbox = new Gtk.HBox(); Gtk.VBox vbox = new Gtk.VBox(); win.Add(hbox); hbox.PackStart(vbox); Gtk.Image image = new Gtk.Image(thumb); vbox.PackStart(image); win.ShowAll(); Gtk.Application.Run(); }
protected virtual void Build() { var vbox = new Gtk.VBox(); var hbox = new Gtk.HBox(); #if GTK2 hbox.PackStart(CreateEntry(), true, true, 2); hbox.PackEnd(CreatePopupButton(), true, false, 2); vbox.PackStart(hbox, true, true, 4); #else hbox.PackStart(CreateEntry(), true, true, 1); hbox.PackEnd(CreatePopupButton(), true, false, 0); vbox.PackStart(hbox, true, true, 1); #endif this.Add(vbox); }
public CopyOffsetPreferencesWidget() { // Use a hbox inside an vbox to avoid expanding vertically. Gtk.HBox hbox = new Gtk.HBox(); Gtk.Label label = new Gtk.Label(Catalog.GetString("Number base:")); numberBaseCombo = Gtk.ComboBox.NewText(); numberBaseCombo.AppendText("2"); numberBaseCombo.AppendText("8"); numberBaseCombo.AppendText("10"); numberBaseCombo.AppendText("16"); hbox.PackStart(label, false, false, 6); hbox.PackStart(numberBaseCombo, false, false, 6); this.PackStart(hbox, true, false, 6); this.ShowAll(); }
private void Init() { var hbox = new Gtk.HBox(); // Pull button btnDoDefaultGitActionForAll = new Gtk.Button(); btnDoDefaultGitActionForAll.Label = "Execute default git action for all repos"; btnDoDefaultGitActionForAll.Clicked += OnDefaultGitActionForAllClickedStarted; // Toggle button btnToggleSelection = new Gtk.CheckButton(); btnToggleSelection.Label = "Select all"; btnToggleSelection.Toggled += OnToggleClickStarted; hbox.PackStart(btnToggleSelection, false, false, 20); hbox.PackStart(btnDoDefaultGitActionForAll, true, true, 0); this.Add(hbox); }
protected virtual void Build() { var hbox3 = new Gtk.HBox(); hbox3.PackStart(CreateEntry(), true, true, 5); hbox3.PackEnd(CreatePopupButton(), false, false, 0); this.Add(hbox3); }
private Gtk.Widget CreateObjectList() { Gtk.HBox hbox = new Gtk.HBox(false, 0); Gtk.Adjustment vadjustment = new Gtk.Adjustment(0, 0, 100, 1, 10, 10); Gtk.VScrollbar scrollbar = new Gtk.VScrollbar(vadjustment); hbox.PackStart(new ObjectListWidget(this, vadjustment), true, true, 0); hbox.PackEnd(scrollbar, false, true, 0); return(hbox); }
private void createComboEncoderMainVariable() { combo_encoder_main_variable = ComboBox.NewText(); comboEncoderMainVariableFill(); hbox_combo_encoder_main_variable.PackStart(combo_encoder_main_variable, false, false, 0); hbox_combo_encoder_main_variable.ShowAll(); combo_encoder_main_variable.Sensitive = true; combo_encoder_main_variable.Changed += new EventHandler(on_combo_encoder_main_variable_changed); }
private void createComboEncoderAutomaticVariable() { combo_encoder_variable_automatic = ComboBox.NewText(); string [] values = { Constants.MeanSpeed, Constants.MaxSpeed, Constants.MeanForce, Constants.MaxForce, Constants.MeanPower, Constants.PeakPower }; UtilGtk.ComboUpdate(combo_encoder_variable_automatic, values, ""); combo_encoder_variable_automatic.Active = UtilGtk.ComboMakeActive(combo_encoder_variable_automatic, "Mean power"); hbox_combo_encoder_variable_automatic.PackStart(combo_encoder_variable_automatic, false, false, 0); hbox_combo_encoder_variable_automatic.ShowAll(); combo_encoder_variable_automatic.Sensitive = true; }
public SongDuplicateView() { Gtk.ScrolledWindow Scroll = new Gtk.ScrolledWindow(); Gtk.TreeView Tree = new Gtk.TreeView(); Gtk.VBox vbox = new Gtk.VBox(false, 1); Gtk.HBox hbox = new Gtk.HBox(false, 1); Tree.RowActivated += OnRowClicked; //Buttons For Header Gtk.Button removeButton = new Gtk.Button(); removeButton.Label = AddinManager.CurrentLocalizer.GetString("Remove Selected Songs"); removeButton.Clicked += OnRemoveCommand; Gtk.Button deleteButton = new Gtk.Button(); deleteButton.Label = AddinManager.CurrentLocalizer.GetString("Delete Selected Songs"); deleteButton.Clicked += OnDeleteCommand; //Create 5 columns, first column is a checkbox, next 4 are text boxes Gtk.CellRendererToggle selectCell = new Gtk.CellRendererToggle(); selectCell.Activatable = true; selectCell.Toggled += OnSelectToggled; Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Select"), selectCell, "active", 0); Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Track Number"), new Gtk.CellRendererText(), "text", 1); Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Song Title"), new Gtk.CellRendererText(), "text", 2); Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Artist"), new Gtk.CellRendererText(), "text", 3); Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Album"), new Gtk.CellRendererText(), "text", 4); Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("File"), new Gtk.CellRendererText(), "text", 5); // Remove From Library, Delete From Drive, Song Name, Artist Name, Album Name, Formated URI, Actual URI, Database Track ID MusicListStore = new Gtk.ListStore(typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(int)); Tree.Model = MusicListStore; //Pack the Tree in a scroll window Scroll.Add(Tree); //Pack the buttons in a hbox hbox.PackStart(removeButton, false, false, 0); hbox.PackStart(deleteButton, false, false, 0); //pack the hbox->buttons and Scroll->Tree in a Vbox, tell the Scroll window to Expand and Fill the vbox vbox.PackStart(hbox, false, false, 0); vbox.PackStart(Scroll, true, true, 0); //pack the vbox in the Rounded Frame Add(vbox); //Finally, show everything ShowAll(); }
private Gtk.HBox createHBoxStartAndLabel(Task t, Pixbuf pixbuf) { Gtk.Label l = new Gtk.Label(t.ToString()); HBox hbox = new Gtk.HBox(false, 10); Button button_start; Gtk.Image image = new Gtk.Image(); image.Pixbuf = pixbuf; button_start = new Gtk.Button(image); button_start.Clicked += new EventHandler(button_start_clicked); hbox.PackStart(button_start, false, false, 0); hbox.PackStart(l, false, false, 0); list_tasks_fixed.Add(t); LogB.Information("createBoxStart...."); LogB.Information(t.ToString()); list_buttons_start.Add(button_start); return(hbox); }
private Gtk.Button MakeButton(Gtk.HBox header, string icon, EventHandler handler) { Gtk.Button button = new Gtk.Button(); Gtk.Image img = new Gtk.Image(icon, Gtk.IconSize.Button); button.Add(img); button.Relief = Gtk.ReliefStyle.None; button.Clicked += handler; header.PackStart(button, false, false, 0); button.ShowAll(); return(button); }
void createCombo() { serverTypeComboBox = ComboBox.NewText(); serverTypeComboBox.AppendText("OpenLDAP"); serverTypeComboBox.AppendText("Microsoft Active Directory"); serverTypeComboBox.AppendText("Fedora Directory Server"); serverTypeComboBox.AppendText("Generic LDAP server"); serverTypeComboBox.Active = 0; serverTypeComboBox.Show(); stHBox.PackStart(serverTypeComboBox, true, true, 5); }
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 ThemedIconBrowser(Gtk.Window parent) : base("Select a Themed Icon", parent, Gtk.DialogFlags.Modal, Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, Gtk.Stock.Ok, Gtk.ResponseType.Ok) { HasSeparator = false; BorderWidth = 12; VBox.Spacing = 18; VBox.BorderWidth = 0; DefaultResponse = Gtk.ResponseType.Ok; Gtk.HBox hbox = new Gtk.HBox(false, 12); VBox.PackStart(hbox, false, false, 0); entry = new Gtk.Entry(); entry.Activated += DoFind; hbox.PackStart(entry); Gtk.Button button = new Gtk.Button(Gtk.Stock.Find); button.Clicked += DoFind; hbox.PackStart(button, false, false, 0); ScrolledWindow scwin = new Gtk.ScrolledWindow(); scwin.SizeRequested += ScrolledWindowSizeRequested; VBox.PackStart(scwin, true, true, 0); scwin.SetPolicy(Gtk.PolicyType.Never, Gtk.PolicyType.Automatic); scwin.ShadowType = Gtk.ShadowType.In; list = new ThemedIconList(); scwin.Add(list); list.SelectionChanged += ListSelectionChanged; list.Activated += ListActivated; SetResponseSensitive(Gtk.ResponseType.Ok, false); VBox.ShowAll(); }
///<summary>Create a DataViewDisplay</summary> public DataViewDisplay(DataView dv) { dataView = dv; // load the default layout from the data directory layout = new Layout(FileResourcePath.GetDataPath("bless-default.layout")); // initialize scrollbar Gtk.Adjustment adj = new Gtk.Adjustment(0.0, 0.0, 1.0, 1.0, 10.0, 0.0); vscroll = new Gtk.VScrollbar(adj); adj.ValueChanged += OnScrolled; // initialize drawing area drawingArea = new Gtk.DrawingArea(); drawingArea.Realized += OnRealized; drawingArea.ExposeEvent += OnExposed; drawingArea.ConfigureEvent += OnConfigured; drawingArea.ModifyBg(StateType.Normal, new Gdk.Color(0xff, 0xff, 0xff)); // add events that we want to handle drawingArea.AddEvents((int)Gdk.EventMask.ButtonPressMask); drawingArea.AddEvents((int)Gdk.EventMask.ButtonReleaseMask); drawingArea.AddEvents((int)Gdk.EventMask.PointerMotionMask); drawingArea.AddEvents((int)Gdk.EventMask.PointerMotionHintMask); drawingArea.AddEvents((int)Gdk.EventMask.KeyPressMask); drawingArea.AddEvents((int)Gdk.EventMask.KeyReleaseMask); drawingArea.CanFocus = true; // needed to catch key events hbox = new Gtk.HBox(); hbox.PackStart(drawingArea, true, true, 0); hbox.PackStart(vscroll, false, false, 0); this.PackStart(hbox); }
private void Build() { var mainVox = new Gtk.VBox(); var removeButton = new Gtk.Button(Gtk.Stock.Remove); var editButton = new Gtk.Button(Gtk.Stock.Edit); removeButton.Clicked += this.OnClickRemove; editButton.Clicked += this.OnClickEdit; var hBox = new Gtk.HBox(); hBox.PackStart(removeButton, false, false, 0); hBox.PackStart(editButton, false, false, 0); mainVox.PackStart(hBox, false, false, 10); //List this.notesTreeView = new TreeView(this.measurementsListStore); ScrolledWindow sw = new ScrolledWindow(); sw.ShadowType = ShadowType.EtchedIn; sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); sw.Add(notesTreeView); this.AddListColumns(); mainVox.PackStart(sw, true, true, 0); //Wrap PackStart(mainVox, true, true, 0); //Update state and render this.OnViewBuilt(); }
// ============================================ // PUBLIC Constructors // ============================================ public UpdateInfo() : base("Update Informations", null, DialogFlags.Modal) { Gtk.HBox hbox = new Gtk.HBox(false, 4); this.VBox.PackStart(hbox, true, true, 4); // Add Close Button AddButton(Gtk.Stock.Close, ResponseType.Close); // Update Logo Gtk.Image updateLogo = StockIcons.GetImage("UpdateNotifier"); updateLogo.Yalign = 0; updateLogo.Xpad = 2; hbox.PackStart(updateLogo, false, false, 2); // Update Informations this.vbox = new Gtk.VBox(false, 2); hbox.PackStart(this.vbox, true, true, 2); // Title this.title = new Gtk.Label("<span size='x-large'><b>Update Informations</b></span>"); this.title.UseMarkup = true; this.vbox.PackStart(this.title, false, false, 2); // Version this.version = new Gtk.Label(); this.version.Xalign = 0; this.version.UseMarkup = true; this.vbox.PackStart(this.version, false, false, 2); // Infos this.infos = new Gtk.Label(); this.infos.Xalign = 0; this.infos.Yalign = 0; this.vbox.PackStart(this.infos, true, true, 2); this.ShowAll(); }
void BuildContent() { foreach (var col in WelcomePageBranding.Content.Root.Elements("Column")) { var colWidget = new Gtk.VBox(false, WelcomePageBranding.Spacing); var widthAtt = col.Attribute("minWidth"); if (widthAtt != null) { int width = (int)widthAtt; colWidget.SizeRequested += delegate(object o, SizeRequestedArgs args) { var req = args.Requisition; req.Width = Math.Max(req.Width, width); args.Requisition = req; }; } colBox.PackStart(colWidget, false, false, 0); foreach (var el in col.Elements()) { string title = (string)(el.Attribute("title") ?? el.Attribute("_title")); if (!string.IsNullOrEmpty(title)) { title = GettextCatalog.GetString(title); } Widget w; switch (el.Name.LocalName) { case "Links": w = new WelcomePageLinksList(el); break; case "RecentProjects": w = new WelcomePageRecentProjectsList(el); break; case "NewsFeed": w = new WelcomePageNewsFeed(el); break; default: throw new InvalidOperationException("Unknown welcome page element '" + el.Name + "'"); } AddSection(colWidget, title, w); } } }
// ============================================ // PUBLIC Constructors // ============================================ public ProgressDialog(string password) : base(MyInfo.Name + " Login", null, DialogFlags.Modal) { // Initialize Dialog Options WindowPosition = Gtk.WindowPosition.Center; // Initialize Dialog Events Response += new ResponseHandler(OnResponse); // Initialize Dialog Components AddButton(Gtk.Stock.Close, ResponseType.Close); Gtk.HBox hbox = new Gtk.HBox(false, 2); Gtk.VBox vbox = new Gtk.VBox(false, 2); VBox.PackStart(hbox, true, true, 2); hbox.PackStart(StockIcons.GetImage("Channel"), false, false, 2); hbox.PackStart(vbox, true, true, 2); // Initialize Label labelMessage = new Gtk.Label("<b>Waiting for " + MyInfo.Name + " Login...</b>"); labelMessage.UseMarkup = true; vbox.PackStart(labelMessage, false, false, 2); // Initialize ProgressBar progressBar = new Gtk.ProgressBar(); vbox.PackStart(progressBar, false, false, 2); // Initialize Timer timer = GLib.Timeout.Add(100, new GLib.TimeoutHandler(ProgressTimeout)); // Initialize UserInfo MyInfo.LoginChecked += new LoginEventHandler(OnLoginChecked); MyInfo.Login(password); this.ShowAll(); }