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; }
public void GetToken() { window = new Gtk.Window ("packingdemo"); window.Title = "CircleCi Indicator Configuration"; window.WindowPosition = WindowPosition.Center; HBox hbox = new HBox (); VBox vbox = new VBox (false, 0); Label label = new Label (); label.Markup = "Please provide your CircleCi token.\nYou can get one <a href=\"https://circleci.com/account/api\">here</a>."; entry = new Entry (); Button okButton = new Button ("OK"); vbox.PackStart (label, false, false, 20); vbox.PackStart (entry, false, false, 0); vbox.PackStart (okButton, false, false, 20); hbox.PackStart (vbox, false, false, 50); window.Add(hbox); entry.KeyReleaseEvent += HandleKeyReleaseEvent; okButton.Clicked += HandleClicked;; window.ShowAll (); }
private void createButton() { Gtk.VBox vbox = new Gtk.VBox(); Gtk.Image image = new Gtk.Image(); addUserPhotoIfExists(image); image.HeightRequest = 150; image.Visible = true; Gtk.Label label_select = new Gtk.Label("Select !"); label_select.Visible = false; //hide this to the user until button is clicked first time Gtk.Label label_id = new Gtk.Label(personID.ToString()); label_id.Visible = false; //hide this to the user Gtk.Viewport viewport = new Gtk.Viewport(); UtilGtk.ViewportColorDefault(viewport); Gtk.Label label_name = new Gtk.Label(personName); label_name.Visible = true; label_name.Show(); viewport.Add(label_name); viewport.Show(); vbox.PackStart(image); //0 vbox.PackStart(label_id); //1 vbox.PackEnd(viewport, false, false, 1); //2 (contains label_name) vbox.Show(); button = new Button(vbox); button.WidthRequest = 150; button.HeightRequest = 170; }
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 TrackInfoPopup() : base(Gtk.WindowType.Popup) { BorderWidth = 8; AppPaintable = true; Resizable = false; TypeHint = Gdk.WindowTypeHint.Notification; VBox box = new VBox (); box.Spacing = 4; header = new ClassicTrackInfoDisplay (); header.SetSizeRequest (320, 64); seek_slider = new ConnectedSeekSlider (SeekSliderLayout.Horizontal); seek_slider.StreamPositionLabel.FormatString = "<small>{0}</small>"; seek_slider.LeftPadding = 0; seek_slider.RightPadding = 0; box.PackStart (header, true, true, 0); box.PackStart (seek_slider, false, false, 0); Add (box); box.ShowAll (); }
public Dialog(Image image, Drawable drawable, SliceData sliceData) : base(_("Slice Tool"), _("SliceTool"), IntPtr.Zero, 0, null, _("SliceTool"), Stock.SaveAs, (Gtk.ResponseType) 2, Stock.Save, (Gtk.ResponseType) 3, Stock.Close, ResponseType.Close) { _image = image; _drawable = drawable; _sliceData = sliceData; SetTitle(null); var vbox = new VBox(false, 12) {BorderWidth = 12}; VBox.PackStart(vbox, true, true, 0); var hbox = new HBox(); vbox.PackStart(hbox, true, true, 0); var preview = CreatePreview(drawable, sliceData); var toolbox = Preview.CreateToolbox(sliceData); hbox.PackStart(toolbox, false, true, 0); hbox.PackStart(preview, true, true, 0); hbox = new HBox(); vbox.PackStart(hbox, true, true, 0); hbox.PackStart(new CoordinatesDisplay(Preview), false, false, 0); hbox = new HBox(false, 24); vbox.PackStart(hbox, true, true, 0); var properties = new CellPropertiesFrame(sliceData.Rectangles); hbox.PackStart(properties, false, true, 0); vbox = new VBox(false, 12); hbox.PackStart(vbox, false, true, 0); var rollover = new RolloversFrame(sliceData); vbox.PackStart(rollover, false, true, 0); _format = new Format(sliceData.Rectangles); _format.Extension = System.IO.Path.GetExtension(image.Name).ToLower(); vbox.PackStart(_format, false, true, 0); vbox = new VBox(false, 12); hbox.PackStart(vbox, false, true, 0); var save = new SaveSettingsButton(this, sliceData); vbox.PackStart(save, false, true, 0); var load = new LoadSettingsButton(this, sliceData); vbox.PackStart(load, false, true, 0); var preferences = new PreferencesButton(_("Preferences"), Preview); vbox.PackStart(preferences, false, true, 0); sliceData.Rectangles.SelectedRectangleChanged += delegate {Redraw();}; sliceData.Init(drawable); }
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 void set_categories(List<Category> categories) { box = new Gtk.VBox(); bool first = true; foreach (Category cat in categories) { CategoryDrawer c = new CategoryDrawer(cat); c.add_new_category_to_ui_callback = add_new_category; c.remove_category_callback = remove_category; category_drawers.Add(c); if (!first) box.PackStart(new Gtk.HSeparator(), false, false, 5); else first = false; box.PackStart(c.representation, false, false, 0); } foreach (Widget w in outer_event_box.Children) w.Destroy(); outer_event_box.Add(box); outer_event_box.ShowAll(); }
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); }
public DemoColorSelection () : base ("Color Selection") { BorderWidth = 8; VBox vbox = new VBox (false,8); vbox.BorderWidth = 8; Add (vbox); // Create the color swatch area Frame frame = new Frame (); frame.ShadowType = ShadowType.In; vbox.PackStart (frame, true, true, 0); drawingArea = new DrawingArea (); // set a minimum size drawingArea.SetSizeRequest (200,200); // set the color color.Red = 0; color.Green = 0; color.Blue = 1; color.Alpha = 1; drawingArea.OverrideBackgroundColor (StateFlags.Normal, color); frame.Add (drawingArea); Alignment alignment = new Alignment (1.0f, 0.5f, 0.0f, 0.0f); Button button = new Button ("_Change the above color"); button.Clicked += new EventHandler (ChangeColorCallback); alignment.Add (button); vbox.PackStart (alignment, false, false, 0); ShowAll (); }
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 (); }
private void CreateWidgets() { this.Title = APP_NAME; this.SetDefaultSize(700, 500); this.DeleteEvent += new DeleteEventHandler(OnDeleteEvent); CreateActions(); CreateToolbar(); CreateExprBar(); CreateWebView(); CreateFindbar(); CreateStatusBar(); Gtk.ScrolledWindow scroll = new Gtk.ScrolledWindow(); scroll.Add(webview); vbox = new Gtk.VBox(false, 1); vbox.PackStart(toolbar, false, false, 0); vbox.PackStart(exprbar, false, false, 0); vbox.PackStart(scroll); //vbox.PackStart (findbar, false, false, 0); vbox.PackEnd(statusbar, false, true, 0); this.Add(vbox); this.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 (); }
public NodeKeyInfo(NodeKey key) : base(Gtk.WindowType.Toplevel) { this.Build (); int childNodes = key.ChildNodes != null ? key.ChildNodes.Count : 0; int values = key.ChildValues != null ? key.ChildValues.Count : 0; byte[] classnameData = key.ClassnameData != null ? key.ClassnameData : new byte[] {}; string name = key.Name != null ? key.Name : string.Empty; DateTime timestamp = key.Timestamp != null ? key.Timestamp : DateTime.MinValue; Label nameLabel = new Label("Name: " + name); Label timestampLabel = new Label("Timestamp: " + timestamp.ToLongDateString()); Label childNodesLabel = new Label("Child nodes: " + childNodes); Label valueCountLabel = new Label("Values: " + values); //Label data = new Label(BitConverter.ToString(classnameData).Replace('-', ' ')); VBox box = new VBox(); box.PackStart(nameLabel, false, false, 30); box.PackStart(timestampLabel, false, false, 30); box.PackStart(childNodesLabel, false, false, 30); box.PackStart(valueCountLabel, false, false, 30); //data.Wrap = true; //box.PackStart(data, false, false, 0); this.Add(box); this.ShowAll(); }
public NotificationMessage (string t, string m) : base (false, 5) { this.Style = style; BorderWidth = 5; icon = new Image (Stock.DialogInfo, IconSize.Dialog); this.PackStart (icon, false, true, 5); VBox vbox = new VBox (false, 5); this.PackStart (vbox, true, true, 0); title = new Label (); title.SetAlignment (0.0f, 0.5f); this.Title = t; vbox.PackStart (title, false, true, 0); message = new Label (); message.LineWrap = true; message.SetSizeRequest (500, -1); // ugh, no way to sanely reflow a gtk label message.SetAlignment (0.0f, 0.0f); this.Message = m; vbox.PackStart (message, true, true, 0); action_box = new HBox (false, 3); Button hide_button = new Button (Catalog.GetString ("Hide")); hide_button.Clicked += OnHideClicked; action_box.PackEnd (hide_button, false, true, 0); Alignment action_align = new Alignment (1.0f, 0.5f, 0.0f, 0.0f); action_align.Add (action_box); vbox.PackStart (action_align, false, true, 0); }
public static int Main(string[] args) { Application.Init(); win = new Gtk.Window("Scribble XInput Demo"); win.DeleteEvent += new DeleteEventHandler(WindowDelete); vBox = new VBox(false, 0); win.Add(vBox); darea = new Gtk.DrawingArea(); darea.SetSizeRequest(200, 200); darea.ExtensionEvents = ExtensionMode.Cursor; vBox.PackStart(darea, true, true, 0); darea.ExposeEvent += new ExposeEventHandler(ExposeEvent); darea.ConfigureEvent += new ConfigureEventHandler(ConfigureEvent); darea.MotionNotifyEvent += new MotionNotifyEventHandler(MotionNotifyEvent); darea.ButtonPressEvent += new ButtonPressEventHandler(ButtonPressEvent); darea.Events = EventMask.ExposureMask | EventMask.LeaveNotifyMask | EventMask.ButtonPressMask | EventMask.PointerMotionMask; inputButton = new Button("Input Dialog"); vBox.PackStart(inputButton, false, false, 0); inputButton.Clicked += new EventHandler(InputButtonClicked); quitButton = new Button("Quit"); vBox.PackStart(quitButton, false, false, 0); quitButton.Clicked += new EventHandler(QuitButtonClicked); win.ShowAll(); Application.Run(); return(0); }
public static Gtk.Window Create () { window = new Window ("GtkCombo"); window.SetDefaultSize (200, 100); VBox box1 = new VBox (false, 0); window.Add (box1); VBox box2 = new VBox (false, 10); box2.BorderWidth = 10; box1.PackStart (box2, true, true, 0); combo = new Gtk.Combo (); string[] pop = {"Foo", "Bar"}; combo.PopdownStrings = pop; combo.Entry.Activated += new EventHandler (OnComboActivated); box2.PackStart (combo, true, true, 0); HSeparator separator = new HSeparator (); box1.PackStart (separator, false, false, 0); box2 = new VBox (false, 10); box2.BorderWidth = 10; box1.PackStart (box2, false, false, 0); Button button = new Button (Stock.Close); button.Clicked += new EventHandler (OnCloseClicked); button.CanDefault = true; box2.PackStart (button, true, true, 0); button.GrabDefault (); return window; }
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); }
public static void Main() { BusG.Init (); Application.Init (); tv = new TextView (); ScrolledWindow sw = new ScrolledWindow (); sw.Add (tv); Button btn = new Button ("Click me"); btn.Clicked += OnClick; Button btnq = new Button ("Click me (thread)"); btnq.Clicked += OnClickQuit; VBox vb = new VBox (false, 2); vb.PackStart (sw, true, true, 0); vb.PackStart (btn, false, true, 0); vb.PackStart (btnq, false, true, 0); Window win = new Window ("D-Bus#"); win.SetDefaultSize (640, 480); win.Add (vb); win.Destroyed += delegate {Application.Quit ();}; win.ShowAll (); bus = Bus.Session.GetObject<IBus> ("org.freedesktop.DBus", new ObjectPath ("/org/freedesktop/DBus")); Application.Run (); }
// 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 FeedPropertiesDialog(ISource f) : base(WindowType.Toplevel) { feed = f; Title = "\""+feed.Name+"\" Properties"; Icon = feed.Favicon; BorderWidth = 5; DeleteEvent += OnClose; vbox = new VBox(); vbox.Spacing = 6; Add(vbox); notebook = new Notebook(); vbox.PackStart(notebook, false, false, 0); bbox = new HButtonBox(); bbox.Layout = ButtonBoxStyle.End; vbox.PackStart(bbox, false, false, 0); AddGeneralTab(); AddTagsTab(); AddCloseButton(); }
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 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 DemoEntryCompletion () : base ("Demo Entry Completion", null, DialogFlags.DestroyWithParent) { Resizable = false; VBox vbox = new VBox (false, 5); vbox.BorderWidth = 5; this.VBox.PackStart (vbox, true, true, 0); Label label = new Label ("Completion demo, try writing <b>total</b> or <b>gnome</b> for example."); label.UseMarkup = true; vbox.PackStart (label, false, true, 0); Entry entry = new Entry (); vbox.PackStart (entry, false, true, 0); entry.Completion = new EntryCompletion (); entry.Completion.Model = CreateCompletionModel (); entry.Completion.TextColumn = 0; AddButton (Stock.Close, ResponseType.Close); ShowAll (); Run (); Destroy (); }
public CodeCompilationPanel() { InitializeComponent(); vbox = new VBox(); var hboxTmp = new HBox(); hboxTmp.PackStart (codeGenerationLabel, false, false, 0); vbox.PackStart (hboxTmp, false, false, 12); hboxTmp = new HBox(); var tableOutputOptions = new Table (4, 2, false); tableOutputOptions.Attach (outputLabel, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); tableOutputOptions.Attach (outputAssembly, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 3); tableOutputOptions.Attach (labelOutputDir, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); tableOutputOptions.Attach (outputDirectory, 1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand , AttachOptions.Fill, 0, 3); tableOutputOptions.Attach (labelCompileTarget, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); tableOutputOptions.Attach (compileTargetCombo, 1, 2, 2, 3, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 3); tableOutputOptions.Attach (labelCulture, 0, 1, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); tableOutputOptions.Attach (culture, 1, 2, 3, 4, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 3); hboxTmp.PackStart (tableOutputOptions, true, true, 6); vbox.PackStart (hboxTmp, false, false, 0); hboxTmp = new HBox (); hboxTmp.PackStart (labelWarnings, false, false, 0); vbox.PackStart (hboxTmp, false, false, 12); hboxTmp = new HBox(); hboxTmp.PackStart (checkDebug, false, false, 6); vbox.PackStart (hboxTmp, false, false, 0); hboxTmp = new HBox(); hboxTmp.PackStart (checkDucky, false, false, 6); vbox.PackStart (hboxTmp, false, false, 0); vbox.ShowAll (); }
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 DockFrame () { Mono.TextEditor.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; dockBarTop.UpdateVisibility (); dockBarBottom.UpdateVisibility (); dockBarLeft.UpdateVisibility (); dockBarRight.UpdateVisibility (); DefaultVisualStyle = new DockVisualStyle (); }
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 DemoColorSelection () : base ("Color Selection") { BorderWidth = 8; VBox vbox = new VBox (false,8); vbox.BorderWidth = 8; Add (vbox); // Create the color swatch area Frame frame = new Frame (); frame.ShadowType = ShadowType.In; vbox.PackStart (frame, true, true, 0); drawingArea = new DrawingArea (); drawingArea.ExposeEvent += new ExposeEventHandler (ExposeEventCallback); // set a minimum size drawingArea.SetSizeRequest (200,200); // set the color color = new Gdk.Color (0, 0, 0xff); drawingArea.ModifyBg (StateType.Normal, color); frame.Add (drawingArea); Alignment alignment = new Alignment (1.0f, 0.5f, 0.0f, 0.0f); Button button = new Button ("_Change the above color"); button.Clicked += new EventHandler (ChangeColorCallback); alignment.Add (button); vbox.PackStart (alignment); ShowAll (); }
public MainWindow() : base (Gtk.WindowType.Toplevel) { Title = "Gtk Test Application"; WidthRequest = 500; HeightRequest = 400; var box = new VBox (); var comboBoxDialogButton = new Button ("Show Combo Box Dialog"); comboBoxDialogButton.Clicked += ComboBoxDialogButtonClicked; box.PackStart (comboBoxDialogButton, false, false, 0); var listViewDialogButton = new Button ("Show ListView Box Dialog"); listViewDialogButton.Clicked += ListViewDialogButtonClicked; box.PackStart (listViewDialogButton, false, false, 0); var sortFuncListViewDialogButton = new Button ("Show SortFunc ListView Box Dialog"); sortFuncListViewDialogButton.Clicked += SortFuncListViewDialogButtonClicked; box.PackStart (sortFuncListViewDialogButton, false, false, 0); var scrolledWindowDialogButton = new Button ("Show ScrolledWindow Dialog"); scrolledWindowDialogButton.Clicked += ScrolledWindowDialogButtonClicked; box.PackStart (scrolledWindowDialogButton, false, false, 0); DeleteEvent += OnDeleteEvent; Add (box); ShowAll (); }
public DemoListStore () : base ("ListStore Demo") { BorderWidth = 8; VBox vbox = new VBox (false, 8); Add (vbox); Label label = new Label ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though)."); vbox.PackStart (label, false, false, 0); ScrolledWindow sw = new ScrolledWindow (); sw.ShadowType = ShadowType.EtchedIn; sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic); vbox.PackStart (sw, true, true, 0); // create model store = CreateModel (); // create tree view TreeView treeView = new TreeView (store); treeView.RulesHint = true; treeView.SearchColumn = (int) Column.Description; sw.Add (treeView); AddColumns (treeView); // finish & show SetDefaultSize (280, 250); ShowAll (); }
public DemoTreeStore () : base ("Card planning sheet") { VBox vbox = new VBox (false, 8); vbox.BorderWidth = 8; Add (vbox); vbox.PackStart (new Label ("Jonathan's Holiday Card Planning Sheet"), false, false, 0); ScrolledWindow sw = new ScrolledWindow (); sw.ShadowType = ShadowType.EtchedIn; sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic); vbox.PackStart (sw, true, true, 0); // create model CreateModel (); // create tree view TreeView treeView = new TreeView (store); treeView.RulesHint = true; treeView.Selection.Mode = SelectionMode.Multiple; AddColumns (treeView); sw.Add (treeView); // expand all rows after the treeview widget has been realized treeView.Realized += new EventHandler (ExpandRows); SetDefaultSize (650, 400); ShowAll (); }
public SimilarTrackBox(SimilarTrack track) : base(false, 0) { Label name = new Label (); Label match = new Label (); VBox box = new VBox (false, 2); name.Markup = Utils.ParseMarkup (track.Artist) + " - " + Utils.ParseMarkup (track.Title); match.Markup = "<small>Similarity: <b>% " + track.Match + "</b></small>"; name.Ellipsize = Pango.EllipsizeMode.End; name.Xalign = 0; name.Yalign = 1; match.Xalign = 0; match.Yalign = 0; box.PackStart (name, false, false, 0); box.PackStart (match, false, false, 0); eb.Add (box); this.PackStart (eb, true, true, 0); eb.BorderWidth = 2; eb.Realized += realized; eb.EnterNotifyEvent += mouse_enter; eb.LeaveNotifyEvent += mouse_leave; }
//private static Gdk.Pixmap pixmap = null; //private static Gtk.InputDialog inputDialog = null; public static int Main15 (string[] args) { Application.Init (); win = new Gtk.Window ("Scribble XInput Demo"); win.DeleteEvent += new DeleteEventHandler (WindowDelete); vBox = new VBox (false, 0); win.Add (vBox); darea = new Gtk.DrawingArea (); darea.SetSizeRequest (200, 200); // darea.ExtensionEvents=ExtensionMode.Cursor; vBox.PackStart (darea, true, true, 0); //darea.ExposeEvent += new ExposeEventHandler (ExposeEvent); darea.ConfigureEvent += new ConfigureEventHandler (ConfigureEvent); darea.MotionNotifyEvent += new MotionNotifyEventHandler (MotionNotifyEvent); darea.ButtonPressEvent += new ButtonPressEventHandler (ButtonPressEvent); darea.Events = EventMask.ExposureMask | EventMask.LeaveNotifyMask | EventMask.ButtonPressMask | EventMask.PointerMotionMask; inputButton = new Button("Input Dialog"); vBox.PackStart (inputButton, false, false, 0); inputButton.Clicked += new EventHandler (InputButtonClicked); quitButton = new Button("Quit"); vBox.PackStart (quitButton, false, false, 0); quitButton.Clicked += new EventHandler (QuitButtonClicked); win.ShowAll (); Application.Run (); return 0; }
public GlToggleButton(GdkGL.Config config) { // VBox. VBox vbox = new VBox (false, 0); vbox.BorderWidth = 10; // Drawing area for drawing OpenGL scene. DrawingArea drawing_area = new DrawingArea (); drawing_area.SetSizeRequest (200, 200); // Set OpenGL-capability to the widget. m_gl = new GlWidget (drawing_area, config); drawing_area.Realized += new EventHandler (Realize); drawing_area.ConfigureEvent += new ConfigureEventHandler (Configure); drawing_area.ExposeEvent += new ExposeEventHandler (Expose); drawing_area.Unrealized += new EventHandler (Unrealize); drawing_area.VisibilityNotifyEvent += new VisibilityNotifyEventHandler (VisibilityNotify); vbox.PackStart (drawing_area, true, true, 0); drawing_area.Show (); // Label. Label label = new Label ("Toggle Animation"); vbox.PackStart (label, false, false, 10); label.Show (); Toggled += new EventHandler (ToggleAnimation); // Add VBox. vbox.Show (); Add (vbox); }
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 void Append(Widget w) { if (isEmpty) { vbox.Remove(emptyLabel); isEmpty = false; } vbox.PackStart(w, false, false, 0); }
/// <summary> /// Creates a Gtk.Widget that's used to configure the service. This /// will be used in the Synchronization Preferences. Preferences should /// not automatically be saved by a GConf Property Editor. Preferences /// should be saved when SaveConfiguration () is called. /// </summary> public override Gtk.Widget CreatePreferencesControl() { Gtk.VBox container = new Gtk.VBox(false, 0); container.PackStart(GtkUtil.newMarkupLabel(Catalog.GetString("<span weight='bold'>Server Settings:</span>"))); SetupGuiServerRelated(container, 4); container.PackStart(new Gtk.Label()); container.PackStart(GtkUtil.newMarkupLabel(Catalog.GetString("<span weight='bold'>Encryption Settings:</span>"))); SetupGuiEncryptionRelated(container, 4); container.ShowAll(); return(container); }
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 Application() { Glade.XML gxml = new Glade.XML(null, "tiler.glade", null, null); gxml.Autoconnect(this); if (MainWindow == null || DrawingArea == null || AppBar == null) { throw new Exception("soem widgets not found"); } DrawingArea.AddEvents((int)Gdk.EventMask.ButtonPressMask); DrawingArea.AddEvents((int)Gdk.EventMask.ButtonReleaseMask); DrawingArea.AddEvents((int)Gdk.EventMask.ButtonMotionMask); // libglade missed interactivity property :-/ MainLayout.Remove(AppBar); AppBar = new AppBar(true, true, PreferencesType.Always); AppBar.UserResponse += new EventHandler(OnAppBarUserResponse); MainLayout.PackStart(AppBar, false, false, 0); AppBar.Show(); TileGroupComboBox.Entry.Activated += new EventHandler(OnTileGroupComboBoxEntryActivated); MainWindow.Show(); }
void LoadGui(MonoDevelopProxy proxy, string document, string fileName) { System.Diagnostics.Trace.WriteLine("Creating AspNetEdit EditorHost"); host = new EditorHost(proxy); host.Initialise(document, fileName); System.Diagnostics.Trace.WriteLine("Created AspNetEdit EditorHost"); System.Diagnostics.Trace.WriteLine("Building AspNetEdit GUI"); Gtk.VBox outerBox = new Gtk.VBox(); geckoFrame = new Frame(); geckoFrame.Shadow = ShadowType.In; geckoFrame.Add(host.DesignerView); outerBox.PackEnd(geckoFrame, true, true, 0); Toolbar tb = BuildToolbar(); outerBox.PackStart(tb, false, false, 0); outerBox.ShowAll(); base.DesignerWidget = outerBox; //grid picks up some services from the designer host propertyGrid = new PropertyGrid(host.Services); propertyGrid.ShowAll(); base.PropertyGridWidget = propertyGrid; System.Diagnostics.Trace.WriteLine("Built AspNetEdit GUI"); }
public void Initialize(EditSession session) { PropertyDescriptor prop = session.Property; if (!prop.PropertyType.IsEnum) { throw new ApplicationException("Flags editor does not support editing values of type " + prop.PropertyType); } Spacing = 3; propType = prop.PropertyType; property = prop.Description; if (property == null || property.Length == 0) { property = prop.Name; } // For small enums, the editor is a list of checkboxes inside a frame // For large enums (>5), use a selector dialog. values = System.Enum.GetValues(prop.PropertyType); if (values.Length < 6) { Gtk.VBox vbox = new Gtk.VBox(true, 3); flags = new Hashtable(); foreach (object value in values) { Gtk.CheckButton check = new Gtk.CheckButton(value.ToString()); check.TooltipText = value.ToString(); ulong uintVal = Convert.ToUInt64(value); flags[check] = uintVal; flags[uintVal] = check; check.Toggled += FlagToggled; vbox.PackStart(check, false, false, 0); } Gtk.Frame frame = new Gtk.Frame(); frame.Add(vbox); frame.ShowAll(); PackStart(frame, true, true, 0); } else { flagsLabel = new Gtk.Entry(); flagsLabel.IsEditable = false; flagsLabel.HasFrame = false; flagsLabel.ShowAll(); PackStart(flagsLabel, true, true, 0); Gtk.Button but = new Gtk.Button("..."); but.Clicked += OnSelectFlags; but.ShowAll(); PackStart(but, false, false, 0); } }
public void Initialize(PropertyDescriptor prop) { if (!prop.PropertyType.IsEnum) { throw new ApplicationException("Flags editor does not support editing values of type " + prop.PropertyType); } property = prop.Label; Spacing = 3; // For small enums, the editor is a list of checkboxes inside a frame // For large enums (>5), use a selector dialog. enm = Registry.LookupEnum(prop.PropertyType.FullName); if (enm.Values.Length < 6) { Gtk.VBox vbox = new Gtk.VBox(true, 3); tips = new Gtk.Tooltips(); flags = new Hashtable(); foreach (Enum value in enm.Values) { EnumValue eval = enm[value]; if (eval.Label == "") { continue; } Gtk.CheckButton check = new Gtk.CheckButton(eval.Label); tips.SetTip(check, eval.Description, eval.Description); uint uintVal = (uint)(int)eval.Value; flags[check] = uintVal; flags[uintVal] = check; check.Toggled += FlagToggled; vbox.PackStart(check, false, false, 0); } Gtk.Frame frame = new Gtk.Frame(); frame.Add(vbox); frame.ShowAll(); PackStart(frame, true, true, 0); } else { flagsLabel = new Gtk.Entry(); flagsLabel.IsEditable = false; flagsLabel.HasFrame = false; flagsLabel.ShowAll(); PackStart(flagsLabel, true, true, 0); Gtk.Button but = new Gtk.Button("..."); but.Clicked += OnSelectFlags; but.ShowAll(); PackStart(but, false, false, 0); } }
void LoadNews() { //can get called from async handler if (destroyed) { return; } foreach (var c in box.Children) { RemoveAccessibiltyTitledWidget(c); box.Remove(c); c.Destroy(); } try { var news = GetNewsXml(); if (news.FirstNode == null) { var label = new Label(GettextCatalog.GetString("No news found.")) { Xalign = 0, Xpad = 6 }; label.Accessible.Name = "WelcomePage.NewsFeed.NoNews"; box.PackStart(label, true, false, 0); } else { int idx = 1; foreach (var child in OnLoadNews(news).Take(limit)) { child.Accessible.Name = string.Format("WelcomePage.NewsFeed.NewsItem-{0}", idx); AddNewsItem(box, child); idx++; } } var spacerLabel = new Label(); spacerLabel.Accessible.SetShouldIgnore(true); box.PackStart(spacerLabel, true, false, 4); } catch (Exception ex) { LoggingService.LogWarning("Error loading news feed.", ex); } this.ShowAll(); }
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 override bool GetPreferenceTabWidget(PreferencesDialog parent, out string tabLabel, out Gtk.Widget preferenceWidget) { Gtk.Label label; Gtk.SpinButton menuNoteCountSpinner; Gtk.Alignment align; int menuNoteCount; // Addin's tab caption tabLabel = Catalog.GetString("Advanced"); Gtk.VBox opts_list = new Gtk.VBox(false, 12); opts_list.BorderWidth = 12; opts_list.Show(); align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 1.0f); align.Show(); opts_list.PackStart(align, false, false, 0); Gtk.Table table = new Gtk.Table(1, 2, false); table.ColumnSpacing = 6; table.RowSpacing = 6; table.Show(); align.Add(table); // Menu Note Count option label = new Gtk.Label(Catalog.GetString("Minimum number of notes to show in Recent list (maximum 18)")); label.UseMarkup = true; label.Justify = Gtk.Justification.Left; label.SetAlignment(0.0f, 0.5f); label.Show(); table.Attach(label, 0, 1, 0, 1); menuNoteCount = (int)Preferences.Get(Preferences.MENU_NOTE_COUNT); // we have a hard limit of 18 set, thus not allowing anything bigger than 18 menuNoteCountSpinner = new Gtk.SpinButton(1, 18, 1); menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18; menuNoteCountSpinner.Show(); table.Attach(menuNoteCountSpinner, 1, 2, 0, 1); menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference; if (opts_list != null) { preferenceWidget = opts_list; return(true); } else { preferenceWidget = null; return(false); } }
public override bool GetPreferenceTabWidget(PreferencesDialog parent, out string tabLabel, out Gtk.Widget preferenceWidget) { // Addin's tab caption tabLabel = Catalog.GetString("Advanced"); Gtk.VBox opts_list = new Gtk.VBox(false, 12); opts_list.BorderWidth = 12; opts_list.Show(); /* * If you want to add new settings to the Advanced tab - follow the steps below: * 1) define a class which implements the functionality (see e.g. MenuMinMaxNoteCountPreference.cs); * 2) define property/method for that class that returns the widget you want to place onto the tab; * 3) (similar to the below) instantiate object of your class and PackStart its widget to opts_list; * It's expected that the returned widget is already within Gtk.Alignment, so no further alignment done. */ // TODO: More elegant way of implementing this would be to create a collection of "prefs" objects // and iterate over them adding them to opts_list (fewer lines to add upon adding new setting). // Instantiate class for Menu Min/Max Note Count setting MenuMinMaxNoteCountPreference menuNoteCountPref = new MenuMinMaxNoteCountPreference(); // Add the widget for this setting to the Advanced tab opts_list.PackStart(menuNoteCountPref.Widget, false, false, 0); //Instantiate class for Enable Startup Notes setting EnableStartupNotesPreference enableStartupNotesPref = new EnableStartupNotesPreference(); // Add the widget to the Advanced tab opts_list.PackStart(enableStartupNotesPref.Widget, false, false, 0); if (opts_list != null) { preferenceWidget = opts_list; return(true); } else { preferenceWidget = null; return(false); } }
private void OnMigrationSlowStarted(string title, string message) { lock (this) { if (slow_window != null) { slow_window.Destroy(); } Gtk.Application.Init(); slow_window = new Gtk.Window(String.Empty); slow_window.BorderWidth = 10; slow_window.WindowPosition = Gtk.WindowPosition.Center; slow_window.DeleteEvent += delegate(object o, Gtk.DeleteEventArgs args) { args.RetVal = true; }; Gtk.VBox box = new Gtk.VBox(); box.Spacing = 5; Gtk.Label title_label = new Gtk.Label(); title_label.Xalign = 0.0f; title_label.Markup = String.Format("<b><big>{0}</big></b>", GLib.Markup.EscapeText(title)); Gtk.Label message_label = new Gtk.Label(); message_label.Xalign = 0.0f; message_label.Text = message; message_label.Wrap = true; slow_progress = new Gtk.ProgressBar(); box.PackStart(title_label, false, false, 0); box.PackStart(message_label, false, false, 0); box.PackStart(slow_progress, false, false, 0); slow_window.Add(box); slow_window.ShowAll(); IterateSlow(); } }
public testuu() : base("Main window") { Gtk.VBox vbox = new Gtk.VBox(false, 10); Add(vbox); ipentry = new HollyLibrary.HIpEntry(); ipentry.Text = "255.255.255.255"; vbox.PackStart(ipentry, false, false, 0); ShowAll(); }
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 void InitAll() { var width = 500; var height = 800; this.SetSizeRequest(width, height); var tvIcon = InitTreeViewWithIcon(); var tvCollapse = InitTreeViewCollapsibleRows(); var tvCollapsibleWithIcon = InitTreeViewCollapsibleRowsWithIcon(); var tvComboBox = InitTreeViewWithComboBox(); var vbox = new Gtk.VBox(); vbox.PackStart(tvIcon, true, true, 0); vbox.PackStart(tvCollapse, true, true, 0); vbox.PackStart(tvCollapsibleWithIcon, true, true, 0); vbox.PackStart(tvComboBox, true, true, 0); this.Add(vbox); }
/// <summary> /// Tunes the middle dock item or the data visualizer. /// </summary> private void TuneMiddleDockItem() { // Attach the comboBox first. vbMiddle.PackStart(comboBox, false, false, 0); ScrolledWindow scroll = new ScrolledWindow(); // Attach the treeView to the scroll bar. scroll.AddWithViewport(treeView); // Attach the scrollBar to the box. vbMiddle.PackStart(scroll, true, true, 0); // Set up DrawingArea. drawingArea = new DrawingArea(); drawingArea.SetSizeRequest(800, 500); ScrolledWindow scrollDA = new ScrolledWindow(); Gtk.VBox vBoxDA = new Gtk.VBox(); Viewport viewPortDA = new Viewport(); viewPortDA.Add(drawingArea); scrollDA.Add(viewPortDA); vBoxDA.PackStart(scrollDA, true, true, 0); // Add Paned container in order to make the two boxes resizable Gtk.VPaned splitter = new Gtk.VPaned(); splitter.Pack1(vBoxDA, true, true); splitter.Pack2(vbMiddle, true, true); splitter.Position = 400; splitter.ShowAll(); nbMiddleDock.AppendPage(splitter, new Gtk.Label("Schema Visualizer")); nbMiddleDock.ShowAll(); schemaV = new SchemaVisualizer(drawingArea); // Get the selected shape. SelectionModel selectionModel = schemaV.Selection; selectionModel.ModelChanged += HandleSelectionModelChanged; }
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 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; }); }
void AddProgressBar(String text) { /* Progress bar */ m_GtkProgressBox = new HBox(false, 0); m_GtkProgressBar = new ProgressBar(); m_GtkProgressBar.Orientation = ProgressBarOrientation.LeftToRight; m_GtkProgressBox.PackStart(m_GtkProgressBar, true, true, 0); m_GtkProgressLabel = new Label(text); m_GtkProgressBox.PackStart(m_GtkProgressLabel, false, false, 0); m_GtkvBoxMain.PackStart(m_GtkProgressBox, false, false, 0); m_GtkProgressBar.Fraction = 0.0; this.ShowAll(); }
private PaletteGroup AddOrGetGroup(string id, string name) { PaletteGroup group = (PaletteGroup)groups[id]; if (group == null) { group = new PaletteGroup(name); box.PackStart(group, false, false, 0); groups.Add(id, group); } return(group); }
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); }
Gtk.Widget CreateAssembliesTable() { var box = new Gtk.VBox(); box.PackStart(new Gtk.Label() { Markup = string.Format("<b>{0}</b>", GettextCatalog.GetString("Loaded Assemblies")), Xalign = 0 }); var table = new Gtk.Table(0, 0, false); table.ColumnSpacing = 3; uint line = 0; foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic).OrderBy(a => a.FullName)) { try { var assemblyName = assembly.GetName(); table.Attach(new Gtk.Label(assemblyName.Name) { Xalign = 0 }, 0, 1, line, line + 1); table.Attach(new Gtk.Label(assemblyName.Version.ToString()) { Xalign = 0 }, 1, 2, line, line + 1); table.Attach(new Gtk.Label(System.IO.Path.GetFullPath(assembly.Location)) { Xalign = 0 }, 2, 3, line, line + 1); } catch { } line++; } box.PackStart(table, false, false, 0); box.ShowAll(); return(box); }
void LoadNews() { //can get called from async handler if (destroyed) { return; } foreach (var c in box.Children) { box.Remove(c); c.Destroy(); } try { var news = GetNewsXml(); if (news.FirstNode == null) { var label = new Label(GettextCatalog.GetString("No news found.")) { Xalign = 0, Xpad = 6 }; box.PackStart(label, true, false, 0); } else { foreach (var child in OnLoadNews(news).Take(limit)) { AddNewsItem(box, child); } } box.PackStart(new Label(), true, false, 4); } catch (Exception ex) { LoggingService.LogWarning("Error loading news feed.", ex); } this.ShowAll(); }
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(); }