private void build() { this.vbox1 = new VBox(); this.toolbar1 = new Toolbar(); this.aboutbtn1 = new ToolButton(Stock.About); this.aboutbtn1.Label = "About"; this.aboutbtn1.IsImportant = true; this.toolbar1.ToolbarStyle = ToolbarStyle.BothHoriz; this.toolbar1.Add(this.aboutbtn1); this.vbox1.PackStart(this.toolbar1, false, true, 0); this.treestore1 = this.populateTreeStoreFromSession(); this.scrollw1 = new ScrolledWindow(); this.hpaned1 = new HPaned(); this.treeview1 = new TreeView(this.treestore1); this.treeview1.HeadersVisible = true; this.treeview1.AppendColumn("Session", new CellRendererText(), "text", 0); this.treeview1.AppendColumn("Name", new CellRendererText(), "text", 1); this.treeview1.ExpandAll(); this.scrollw1.Add(this.treeview1); this.iconview1 = new IconView(); this.hpaned1.Add1(this.scrollw1); this.hpaned1.Add2(this.iconview1); this.hpaned1.Position = 254; this.vbox1.PackStart(this.hpaned1, true, true, 0); this.statusbar1 = new Statusbar(); this.vbox1.PackEnd(this.statusbar1, false, true, 0); this.Add(this.vbox1); this.SetSizeRequest(800,600); this.DeleteEvent += HandleDeleteEvent; }
public static Gtk.Widget MakeToolbarToggleButton(Gtk.Toolbar toolbar, string stock_id, System.EventHandler e) { Gtk.StockItem item = Gtk.StockItem.Zero; if (Gtk.StockManager.Lookup(stock_id, ref item)) { SignalFuncHelper helper = new SignalFuncHelper(e); // FIXME current gtk-sharp bindings don't have a null_ok flag on the // widget parameter so it is impossible to make a toggle button in toolbar. Gtk.Widget w; try { w = toolbar.AppendElement(Gtk.ToolbarChildType.Togglebutton, null, item.Label.Replace("_", null), null, null, new Gtk.Image(item.StockId, Gtk.IconSize.LargeToolbar), new Gtk.SignalFunc(helper.Func)); } catch { w = toolbar.AppendItem(item.Label.Replace("_", null), null, null, new Gtk.Image(item.StockId, Gtk.IconSize.LargeToolbar), new Gtk.SignalFunc(helper.Func)); } helper.Sender = w; return(w); } return(null); }
protected override void OnBuildToolBar (Toolbar tb) { base.OnBuildToolBar (tb); if (brush_width_label == null) brush_width_label = new ToolBarLabel (string.Format (" {0}: ", Catalog.GetString ("Brush width"))); tb.AppendItem (brush_width_label); if (brush_width_minus == null) { brush_width_minus = new ToolBarButton ("Toolbar.MinusButton.png", "", Catalog.GetString ("Decrease brush size")); brush_width_minus.Clicked += MinusButtonClickedEvent; } tb.AppendItem (brush_width_minus); if (brush_width == null) brush_width = new ToolBarComboBox (65, 1, true, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "20", "25", "30", "35", "40", "45", "50", "55"); tb.AppendItem (brush_width); if (brush_width_plus == null) { brush_width_plus = new ToolBarButton ("Toolbar.PlusButton.png", "", Catalog.GetString ("Increase brush size")); brush_width_plus.Clicked += PlusButtonClickedEvent; } tb.AppendItem (brush_width_plus); }
protected void build() { this.SetDefaultSize (1000, 600); this.Title = "Battle"; this.DeleteEvent += HandleDeleteEvent; this.vbox = new VBox (); this.tbar = new Toolbar (); this.tbar.ToolbarStyle = ToolbarStyle.BothHoriz; this.about = new ToolButton (Stock.About); this.about.IsImportant = false; this.about.Label = "About"; this.about.TooltipText = "About this application"; this.tbar.Add (this.about); this.hpaned = new HPaned (); this.frame = new Frame ("Battle Map"); this.map = new MapControl (); this.frame.Add (this.map); Label a = new Label ("Welcome"); this.hpaned.Pack1 (a, false, false); this.hpaned.Pack2 (this.frame, true, true); this.sbar = new Statusbar (); this.vbox.PackStart (this.tbar, false, true, 0); this.vbox.PackStart (this.hpaned, true, true, 0); this.vbox.PackEnd (this.sbar, false, true, 0); this.Add (this.vbox); }
public ToolBoxWidget() { // First column tb1 = new Toolbar () { Name = "tb1", Orientation = Orientation.Vertical, ShowArrow = false, ToolbarStyle = ToolbarStyle.Icons, IconSize = IconSize.SmallToolbar }; PackStart (tb1, false, false, 0); // second column tb2 = new Toolbar () { Name = "tb2", Orientation = Orientation.Vertical, ShowArrow = false, ToolbarStyle = ToolbarStyle.Icons, IconSize = IconSize.SmallToolbar }; PackStart (tb2, false, false, 0); PintaCore.Tools.ToolAdded += HandleToolAdded; ShowAll (); }
/// <summary> /// Sets up the DashPatternBox in the Toolbar. /// /// Note that the dash pattern change event response code must be created manually outside of the DashPatternBox /// (using the returned Gtk.ComboBox from the SetupToolbar method) so that each tool that uses it /// can react to the change in pattern according to its usage. /// /// Returns null if the DashPatternBox has already been setup; otherwise, returns the DashPatternBox itself. /// </summary> /// <param name="tb">The Toolbar to add the DashPatternBox to.</param> /// <returns>null if the DashPatternBox has already been setup; otherwise, returns the DashPatternBox itself.</returns> public Gtk.ComboBox SetupToolbar(Toolbar tb) { if (dashPatternSep == null) { dashPatternSep = new SeparatorToolItem(); } tb.AppendItem(dashPatternSep); if (dashPatternLabel == null) { dashPatternLabel = new ToolBarLabel(string.Format(" {0}: ", Catalog.GetString("Dash"))); } tb.AppendItem(dashPatternLabel); if (comboBox == null) { comboBox = new ToolBarComboBox(100, 0, true, "-", " -", " --", " ---", " -", " -", " - --", " - - --------", " - - ---- - ----"); } tb.AppendItem(comboBox); if (dashChangeSetup) { return null; } else { dashChangeSetup = true; return comboBox.ComboBox; } }
protected override void OnBuildToolBar (Toolbar tb) { base.OnBuildToolBar (tb); // Change the cursor when the BrushWidth is changed. brush_width.ComboBox.Changed += (sender, e) => SetCursor (DefaultCursor); tb.AppendItem (new Gtk.SeparatorToolItem ()); if (brush_label == null) brush_label = new ToolBarLabel (string.Format (" {0}: ", Catalog.GetString ("Type"))); if (brush_combo_box == null) { brush_combo_box = new ToolBarComboBox (100, 0, false); brush_combo_box.ComboBox.Changed += (o, e) => { Gtk.TreeIter iter; if (brush_combo_box.ComboBox.GetActiveIter (out iter)) { active_brush = (BasePaintBrush)brush_combo_box.Model.GetValue (iter, 1); } else { active_brush = default_brush; } }; RebuildBrushComboBox (); } tb.AppendItem (brush_label); tb.AppendItem (brush_combo_box); }
public SqlQueryView () { stoppedQueries = new List<object> (); vbox = new VBox (false, 6); vbox.BorderWidth = 6; sqlEditor = new SqlEditorWidget (); sqlEditor.TextChanged += new EventHandler (SqlChanged); Toolbar toolbar = new Toolbar (); toolbar.ToolbarStyle = ToolbarStyle.BothHoriz; buttonExecute = new ToolButton ( Services.Resources.GetImage ("md-db-execute", IconSize.SmallToolbar), GettextCatalog.GetString ("Execute") ); buttonStop = new ToolButton ("gtk-stop"); buttonClear = new ToolButton (Services.Resources.GetImage ("gtk-clear", IconSize.Button), GettextCatalog.GetString ("Clear Results")); buttonStop.Sensitive = false; buttonExecute.Sensitive = false; buttonExecute.Clicked += new EventHandler (ExecuteClicked); buttonStop.Clicked += new EventHandler (StopClicked); buttonClear.Clicked += new EventHandler (ClearClicked); comboConnections = new DatabaseConnectionContextComboBox (); selectedConnection = comboConnections.DatabaseConnection; comboConnections.Changed += new EventHandler (ConnectionChanged); buttonExecute.IsImportant = true; ToolItem comboItem = new ToolItem (); comboItem.Child = comboConnections; toolbar.Add (buttonExecute); toolbar.Add (buttonStop); toolbar.Add (buttonClear); toolbar.Add (new SeparatorToolItem ()); toolbar.Add (comboItem); pane = new VPaned (); ScrolledWindow windowStatus = new ScrolledWindow (); status = new TextView (); windowStatus.Add (status); notebook = new Notebook (); notebook.AppendPage (windowStatus, new Label (GettextCatalog.GetString ("Status"))); pane.Pack1 (sqlEditor, true, true); pane.Pack2 (notebook, true, true); vbox.PackStart (toolbar, false, true, 0); vbox.PackStart (pane, true, true, 0); vbox.ShowAll (); notebook.Hide (); }
private void build() { this.vbox1 = new Gtk.VBox(); this.toolbar1 = new Gtk.Toolbar(); this.toolbar1.ToolbarStyle = ToolbarStyle.BothHoriz; this.new_toolbutton = new ToolButton(Stock.New); this.new_toolbutton.IsImportant = true; this.new_toolbutton.Label = "New Character"; this.new_toolbutton.Clicked += HandleNew_toolbuttonhandleClicked; this.toolbar1.Add(this.new_toolbutton); this.pref_toolbutton = new ToolButton(Stock.Preferences); this.pref_toolbutton.IsImportant = true; this.pref_toolbutton.Label = "Preferences"; this.pref_toolbutton.Clicked += HandlePref_toolbuttonhandleClicked; this.toolbar1.Add(this.pref_toolbutton); this.quit_toolbutton = new ToolButton(Stock.Quit); this.quit_toolbutton.IsImportant = true; this.quit_toolbutton.Label = "Quit"; this.quit_toolbutton.Clicked += HandleQuit_toolbuttonhandleClicked; this.toolbar1.Add(this.quit_toolbutton); this.about_toolbutton = new ToolButton(Stock.About); this.about_toolbutton.IsImportant = true; this.about_toolbutton.Label = "About"; this.about_toolbutton.Clicked += HandleAbout_toolbuttonhandleClicked; SeparatorToolItem sti = new SeparatorToolItem(); sti.Draw = false; sti.Expand = true; this.toolbar1.Add(sti); this.toolbar1.Add(this.about_toolbutton); this.statusbar1 = new Gtk.Statusbar(); this.image1 = new Image(MediaManager.GetPixbufFromBaseFile("BLLogo.jpg").ScaleSimple(296, 149, Gdk.InterpType.Bilinear)); Gtk.VBox vbox2 = new Gtk.VBox(); Gtk.ScrolledWindow sw1 = new Gtk.ScrolledWindow(); TreeStore ts1 = new TreeStore (typeof (string), typeof (string)); ts1.AppendValues("Player Characters",DateTime.Now.ToString()); ts1.AppendValues("Non-Player Characters",DateTime.Now.ToString()); ts1.AppendValues("Database",DateTime.Now.ToString()); TreeView tv1 = new TreeView (); tv1.Model = ts1; tv1.HeadersVisible = true; tv1.AppendColumn ("Source", new CellRendererText (), "text", 0); tv1.AppendColumn ("Last Update", new CellRendererText (), "text", 1); sw1.Add(tv1); vbox2.PackStart(this.image1, false, true, 0); vbox2.PackEnd(sw1, true, true, 0); this.vbox1.PackStart(this.toolbar1, false, true, 0); this.vbox1.PackStart(vbox2, true, true, 0); this.vbox1.PackStart(this.statusbar1, false, true, 0); this.Add(this.vbox1); //this.SetSizeRequest(640, Screen.Height - 100); this.SetSizeRequest(480, 640); this.Icon = Battle.Gui.MediaManager.GetPixbufFromBaseFile("LSIMMS.png"); this.statusbar1.Push(0, string.Format("{0} started @ {1}", this.session.GetType().ToString(), this.session.StartTime.ToString())); this.Maximize(); }
public Toolbar CreateToolBar (string name) { main_toolbar = new Toolbar (); main_toolbar.Name = name; menu_layout.PackStart (main_toolbar, false, false, 0); main_toolbar.Show (); return main_toolbar; }
public static Gtk.Window Create() { window = new Window ("Toolbar"); window.Resizable = false; toolbar = new Toolbar (); toolbar.InsertStock (Stock.New, "Stock icon: New", "Toolbar/New", new SignalFunc (set_small_icon), IntPtr.Zero, -1); toolbar.InsertStock (Stock.Open, "Stock icon: Open", "Toolbar/Open", new SignalFunc (set_large_icon), IntPtr.Zero, -1); toolbar.AppendSpace (); toolbar.AppendItem ("Toggle tooltips", "toggle showing of tooltips", "Toolbar/Tooltips", new Image (Stock.DialogInfo, IconSize.LargeToolbar), new SignalFunc (toggle_tooltips)); toolbar.AppendSpace (); toolbar.AppendItem ("Horizontal", "Horizontal layout", "Toolbar/Horizontal", new Image (Stock.GoForward, IconSize.LargeToolbar), new SignalFunc (set_horizontal)); toolbar.AppendItem ("Vertical", "Vertical layout", "Toolbar/Vertical", new Image (Stock.GoUp, IconSize.LargeToolbar), new SignalFunc (set_vertical)); toolbar.AppendSpace (); toolbar.AppendItem ("Icons", "Only show icons", "Toolbar/IconsOnly", new Image (Stock.Home, IconSize.LargeToolbar), new SignalFunc (set_icon_only)); toolbar.AppendItem ("Text", "Only show Text", "Toolbar/TextOnly", new Image (Stock.JustifyFill, IconSize.LargeToolbar), new SignalFunc (set_text_only)); toolbar.AppendItem ("Both", "Show both Icon & Text", "Toolbar/Both", new Image (Stock.Index, IconSize.LargeToolbar), new SignalFunc (set_both)); toolbar.AppendItem ("Both (Horizontal)", "Show Icon & Text horizontally", "Toolbar/BothHoriz", new Image (Stock.Index, IconSize.LargeToolbar), new SignalFunc (set_both_horiz)); toolbar.AppendSpace (); toolbar.InsertStock (Stock.Close, "Stock icon: Close", "Toolbar/Close", new SignalFunc (Close_Button), IntPtr.Zero, -1); window.Add (toolbar); window.ShowAll (); return window; }
private void build() { this.SetDefaultSize (1000, 600); this.vbox1 = new VBox (); this.toolbar1 = new Toolbar (); this.toolbar1.ToolbarStyle = ToolbarStyle.BothHoriz; this.newcharbutton = new ToolButton (Stock.New); this.newcharbutton.Label = "New"; this.newcharbutton.TooltipText = "New Character"; this.newcharbutton.IsImportant = true; this.newcharbutton.Clicked += HandleNewcharbuttonClicked; this.toolbar1.Add (this.newcharbutton); this.savecharbutton = new ToolButton (Stock.Save); this.savecharbutton.Label = "Save"; this.savecharbutton.TooltipText = "Save Character"; this.savecharbutton.Clicked += HandleSavecharbuttonClicked; this.toolbar1.Add(this.savecharbutton); this.printcharbutton = new ToolButton (Stock.Print); this.printcharbutton.Label = "Print"; this.printcharbutton.TooltipText = "Print Character"; this.printcharbutton.Clicked += HandlePrintcharbuttonClicked; this.toolbar1.Add(this.printcharbutton); this.toolbar1.Add(new SeparatorToolItem()); this.rollbutton = new ToolButton (Stock.Refresh); this.rollbutton.Label = "Roll"; this.rollbutton.TooltipText = "Roll Characteristics"; this.rollbutton.IsImportant = true; this.rollbutton.Clicked += HandleRollbuttonClicked; this.toolbar1.Add(this.rollbutton); this.aboutbutton = new ToolButton (Stock.About); this.aboutbutton.Label = "About"; this.aboutbutton.TooltipText = "About Adeptus"; this.aboutbutton.Clicked += HandleAboutbuttonClicked; SeparatorToolItem sti = new SeparatorToolItem(); sti.Draw = false; sti.Expand = true; this.toolbar1.Add(sti); this.toolbar1.Add (this.aboutbutton); this.frame1 = new Frame (); this.frame1.Add(new Image(Gdk.Pixbuf.LoadFromResource("Adeptus.Gui.EmperorVHorus.jpg"))); this.statusbar1 = new Statusbar (); this.statusbar1.Push (0, "Ready"); this.vbox1.PackStart (this.toolbar1, false, true, 0); this.vbox1.PackStart (this.frame1, true, true, 0); this.vbox1.PackEnd (this.statusbar1, false, true, 0); this.Add (this.vbox1); }
public CombinedDesignView (IViewContent content) { this.content = content; if (content is IEditableTextBuffer) { ((IEditableTextBuffer)content).CaretPositionSet += delegate { ShowPage (0); }; } content.ContentChanged += new EventHandler (OnTextContentChanged); content.DirtyChanged += new EventHandler (OnTextDirtyChanged); notebook = new Gtk.Notebook (); // Main notebook notebook.TabPos = Gtk.PositionType.Bottom; notebook.ShowTabs = false; notebook.ShowBorder = false; notebook.Show (); box = new VBox (); // Bottom toolbar toolbar = new Toolbar (); toolbar.IconSize = IconSize.SmallToolbar; toolbar.ToolbarStyle = ToolbarStyle.BothHoriz; toolbar.ShowArrow = false; CommandRouterContainer crc = new CommandRouterContainer (content.Control, content, true); crc.Show (); AddButton (GettextCatalog.GetString ("Source Code"), crc).Active = true; toolbar.ShowAll (); box.PackStart (notebook, true, true, 0); box.PackStart (toolbar, false, false, 0); box.Show (); IdeApp.Workbench.ActiveDocumentChanged += new EventHandler (OnActiveDocumentChanged); content.Control.Realized += delegate { if (content != null && content.WorkbenchWindow != null) content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this; }; notebook.SwitchPage += delegate { if (content != null && content.WorkbenchWindow != null) content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this; }; }
public static Gtk.Widget MakeToolbarButton(Gtk.Toolbar toolbar, string stock_id, string label, System.EventHandler e) { Gtk.StockItem item = Gtk.StockItem.Zero; if (Gtk.StockManager.Lookup(stock_id, ref item)) { SignalFuncHelper helper = new SignalFuncHelper(e); Gtk.Widget w = toolbar.AppendItem(label ?? item.Label.Replace("_", null), null, null, new Gtk.Image(item.StockId, Gtk.IconSize.LargeToolbar), new Gtk.SignalFunc(helper.Func)); helper.Sender = w; return(w); } return(null); }
public void SetupChildren () { VBox l = new VBox (false, 0); Add (l); menubar = CreateMenu (); toolbar = CreateToolbar (); statusbar = CreateStatusBar (); friends = CreateFriends (); l.PackStart (menubar, false, false, 0); l.PackStart (toolbar); l.PackStart (statusbar); }
private Toolbar CreateToolbar() { Toolbar tb = new Toolbar(); ToolbarTooltips = new Tooltips(); SaveButton = new ToolButton(Gtk.Stock.Save); SaveButton.SetTooltip(ToolbarTooltips, Util.GS("Save the synchronization log"), "Toolbar/Save Log"); SaveButton.Clicked += new EventHandler(SaveLogHandler); tb.Insert(SaveButton, -1); ClearButton = new ToolButton(Gtk.Stock.Clear); ClearButton.SetTooltip(ToolbarTooltips, Util.GS("Clear the synchronization log"), "Toolbar/Clear Log"); ClearButton.Clicked += new EventHandler(ClearLogHandler); tb.Insert(ClearButton, -1); SaveButton.Sensitive = false; ClearButton.Sensitive = false; return tb; }
public DemoIconView () : base ("Gtk.IconView demo") { SetDefaultSize (650, 400); DeleteEvent += new DeleteEventHandler (OnWinDelete); VBox vbox = new VBox (false, 0); Add (vbox); Toolbar toolbar = new Toolbar (); vbox.PackStart (toolbar, false, false, 0); upButton = new ToolButton (Stock.GoUp); upButton.IsImportant = true; upButton.Sensitive = false; toolbar.Insert (upButton, -1); ToolButton homeButton = new ToolButton (Stock.Home); homeButton.IsImportant = true; toolbar.Insert (homeButton, -1); fileIcon = GetIcon (Stock.File); dirIcon = GetIcon (Stock.Open); ScrolledWindow sw = new ScrolledWindow (); sw.ShadowType = ShadowType.EtchedIn; sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic); vbox.PackStart (sw, true, true, 0); // Create the store and fill it with the contents of '/' store = CreateStore (); FillStore (); IconView iconView = new IconView (store); iconView.SelectionMode = SelectionMode.Multiple; upButton.Clicked += new EventHandler (OnUpClicked); homeButton.Clicked += new EventHandler (OnHomeClicked); iconView.TextColumn = COL_DISPLAY_NAME; iconView.PixbufColumn = COL_PIXBUF; iconView.ItemActivated += new ItemActivatedHandler (OnItemActivated); sw.Add (iconView); iconView.GrabFocus (); ShowAll (); }
public DefaultMonitorPad(string title, string icon) { buffer = new Gtk.TextBuffer (new Gtk.TextTagTable ()); textEditorControl = new Gtk.TextView (buffer); textEditorControl.Editable = false; scroller = new Gtk.ScrolledWindow (); scroller.ShadowType = ShadowType.In; scroller.Add (textEditorControl); Toolbar toolbar = new Toolbar (); toolbar.IconSize = IconSize.SmallToolbar; toolbar.Orientation = Orientation.Vertical; toolbar.ToolbarStyle = ToolbarStyle.Icons; buttonStop = new ToolButton ("gtk-stop"); buttonStop.Clicked += new EventHandler (OnButtonStopClick); buttonStop.SetTooltip (tips, "Stop", "Stop"); toolbar.Insert (buttonStop, -1); ToolButton buttonClear = new ToolButton ("gtk-clear"); buttonClear.Clicked += new EventHandler (OnButtonClearClick); buttonClear.SetTooltip (tips, "Clear console", "Clear console"); toolbar.Insert (buttonClear, -1); hbox = new HBox (false, 5); hbox.PackStart (scroller, true, true, 0); hbox.PackEnd (toolbar, false, false, 0); bold = new TextTag ("bold"); bold.Weight = Pango.Weight.Bold; buffer.TagTable.Add (bold); tag = new TextTag ("0"); tag.Indent = 10; buffer.TagTable.Add (tag); tags.Add (tag); Runtime.ProjectService.CombineOpened += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineOpen)); Runtime.ProjectService.CombineClosed += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineClosed)); this.title = title; this.icon = icon; this.markupTitle = title; Control.ShowAll (); }
public static void BuildToolbar(Toolbar toolbar, Tooltips tooltips, ActionModelNode node, int depth) { if (node.Action != null) { // create the tool button ToolButton button = new ActiveToolbarButton((IClickAction)node.Action, tooltips); toolbar.Insert(button, toolbar.NItems); } else { foreach (ActionModelNode child in node.ChildNodes) { BuildToolbar(toolbar, tooltips, child, depth + 1); } } }
/// <summary> /// reads the given config file and creates toolbars and buttons /// </summary> /// <param name='frame'> /// Frame. /// </param> public static void addToolbars(Toolbar toolbar, String configfile, bool hookdelegates, Type type = null, object callingObject=null) { String xpath = "//toolbar"; if (type != null) { xpath += "[@class='" + type.ToString() + "']"; } else { xpath += "[not(@class)]"; } Console.WriteLine ("addToolbars:" + configfile + xpath); XmlNodeList lst = Sharpend.Configuration.ConfigurationManager.getValues(configfile, xpath); foreach (XmlNode nd in lst) { XmlNodeList btns = nd.SelectNodes(".//button"); foreach (XmlNode bn in btns) { String classname = XmlHelper.getAttributeValue(bn,"class"); String assembly = XmlHelper.getAttributeValue(bn,"assembly"); String icon = XmlHelper.getAttributeValue(bn,"icon"); String btn_title = XmlHelper.getAttributeValue(bn,"title"); String stock_id = XmlHelper.getAttributeValue(bn,"stock_id"); String eventargs = XmlHelper.getAttributeValue(bn,"eventargs"); String buttonname = XmlHelper.getAttributeValue(bn,"name"); Widget btn = createButton(classname,assembly,icon,btn_title,stock_id, eventargs); if (btn != null) { btn.Visible = true; toolbar.Add(btn); if (hookdelegates) { hookDelegates(bn,btn, callingObject); } if (!String.IsNullOrEmpty(buttonname)) { btn.Name = buttonname; } } } } }
public void add_toolbar(string name, Toolbar toolbar) { Gtk.Label label = new Label(name); label.SetSizeRequest((int)Sugar.Style.TOOLBOX_TAB_LABEL_WIDTH, -1); label.SetAlignment(0.0f, 0.5f); Gtk.HBox toolbar_box = new HBox(); toolbar_box.PackStart(toolbar,true, true, Sugar.Style.TOOLBOX_HORIZONTAL_PADDING); toolbar_box.ExposeEvent += _toolbar_box_expose_cb; _notebook.AppendPage(toolbar_box, label); toolbar_box.Show(); if (_notebook.NPages>1) { _notebook.ShowTabs=true; // _separator.Show(); } }
public MainWindow() : base("ClearCanvas") { this.SetDefaultSize(Screen.Width, Screen.Height); _workspaceToolViewManagers = new Dictionary<IWorkspace, ToolViewManager>(); _mainMenu = new MenuBar(); _toolBar = new Toolbar(); _notebook = new Notebook(); _notebook.TabPos = PositionType.Top; _notebook.SwitchPage += OnNotebookSwitchPage; // this box holds the main menu HBox menuBox = new HBox(false, 0); menuBox.PackStart(_mainMenu, true, true, 0); // this box holds the toolbar _toolBarBox = new HBox(false, 0); _toolBarBox.PackStart(_toolBar, true, true, 0); // this box holds the overall layout _outerBox = new VBox(false, 0); _outerBox.PackStart(menuBox, false, false, 0); _outerBox.PackStart(_toolBarBox, false, false, 0); _outerBox.PackStart(_notebook, true, true, 0); //WorkstationModel.WorkspaceManager.Workspaces.ItemAdded += new EventHandler<WorkspaceEventArgs>(OnWorkspaceAdded); //WorkstationModel.WorkspaceManager.Workspaces.ItemRemoved += new EventHandler<WorkspaceEventArgs>(OnWorkspaceRemoved); //WorkstationModel.WorkspaceManager.WorkspaceActivated += new EventHandler<WorkspaceEventArgs>(OnWorkspaceActivated); DesktopApplication.WorkspaceManager.Workspaces.ItemAdded += new EventHandler<WorkspaceEventArgs>(OnWorkspaceAdded); DesktopApplication.WorkspaceManager.Workspaces.ItemRemoved += new EventHandler<WorkspaceEventArgs>(OnWorkspaceRemoved); DesktopApplication.WorkspaceManager.WorkspaceActivated += new EventHandler<WorkspaceEventArgs>(OnWorkspaceActivated); this.Add(_outerBox); this.ShowAll(); BuildMenusAndToolBars(null); UpdateToolViews(null); }
/// <summary> /// Tunes the right dock item. /// </summary> private void TuneRightDockItem() { Gtk.Toolbar tb = new Gtk.Toolbar(); tb.Name = "RightToolbar"; // Add TreeView for the history Gtk.TreeView historyView = new Gtk.TreeView(); Gtk.TreeViewColumn languages = new Gtk.TreeViewColumn(); languages.Title = "History"; // Write some sample data to see how it looks like Gtk.CellRendererText cell = new Gtk.CellRendererText(); languages.PackStart(cell, true); languages.AddAttribute(cell, "text", 0); Gtk.TreeStore treestore = new Gtk.TreeStore(typeof(string)); treestore.AppendValues("Import database"); treestore.AppendValues("Set primary keys"); treestore.AppendValues("Delete row"); historyView.AppendColumn(languages); historyView.Model = treestore; // We need to set the expand and fill properties to false, because that way we can resize // the buttons. vbRight.PackStart(tb, false, false, 0); vbRight.PackStart(historyView, true, true, 0); tb.ToolbarStyle = Gtk.ToolbarStyle.Icons; tb.Orientation = Gtk.Orientation.Horizontal; Gtk.ToolButton undo = new Gtk.ToolButton(Gtk.Stock.Undo); Gtk.ToolButton redo = new Gtk.ToolButton(Gtk.Stock.Redo); tb.Insert(undo, 0); tb.Insert(redo, 1); }
protected override void OnBuildToolBar (Toolbar tb) { base.OnBuildToolBar(tb); if (fill_sep == null) fill_sep = new Gtk.SeparatorToolItem (); tb.AppendItem (fill_sep); if (fill_label == null) fill_label = new ToolBarLabel (string.Format (" {0}: ", Catalog.GetString ("Fill Style"))); tb.AppendItem (fill_label); if (fill_button == null) { fill_button = new ToolBarDropDownButton (); fill_button.AddItem (Catalog.GetString ("Outline Shape"), "ShapeTool.Outline.png", 0); fill_button.AddItem (Catalog.GetString ("Fill Shape"), "ShapeTool.Fill.png", 1); fill_button.AddItem (Catalog.GetString ("Fill and Outline Shape"), "ShapeTool.OutlineFill.png", 2); } tb.AppendItem (fill_button); Gtk.ComboBox dpbBox = dashPBox.SetupToolbar(tb); if (dpbBox != null) { dpbBox.Changed += (o, e) => { dashPattern = dpbBox.ActiveText; }; } }
private void CreateToolbar() { // UrlEntry uri_entry = new Gtk.Entry(); uri_entry.Activated += new EventHandler(on_uri_activate); Gtk.ToolItem uri_item = new Gtk.ToolItem(); uri_item.Expand = true; uri_item.Add(uri_entry); // Toolbar toolbar = new Toolbar(); toolbar.ToolbarStyle = ToolbarStyle.Icons; toolbar.Orientation = Orientation.Horizontal; toolbar.ShowArrow = true; // Toolbar Itens toolbar.Add(action_back.CreateToolItem()); toolbar.Add(action_forward.CreateToolItem()); toolbar.Add(action_reload.CreateToolItem()); toolbar.Add(action_stop.CreateToolItem()); toolbar.Add(uri_item); toolbar.Add(action_jump.CreateToolItem()); }
static Gtk.Toolbar CreateToolbar(CircuitEditor editor) { Gtk.Toolbar toolbar = new Gtk.Toolbar(); SelectTool selectTool = new SelectTool(editor, toolbar); WireTool wireTool = new WireTool(editor, toolbar); // FIXME: Make this be selected with a callback or something //editor.CurrentTool = selectTool; ComponentTool constantTool = new ComponentTool(ComponentType.Constant, "Constant", editor, toolbar); ComponentTool bufferTool = new ComponentTool(ComponentType.Buffer, "Buffer gate", editor, toolbar); ComponentTool notTool = new ComponentTool(ComponentType.Not, "Not gate", editor, toolbar); ComponentTool andTool = new ComponentTool(ComponentType.And, "And gate", editor, toolbar); ComponentTool orTool = new ComponentTool(ComponentType.Or, "Or gate", editor, toolbar); ComponentTool xorTool = new ComponentTool(ComponentType.Xor, "Xor gate", editor, toolbar); SeparatorToolItem sep = new SeparatorToolItem(); int index = 0; toolbar.Insert(selectTool, index++); toolbar.Insert(wireTool, index++); toolbar.Insert(sep, index++); toolbar.Insert(constantTool, index++); toolbar.Insert(bufferTool, index++); toolbar.Insert(notTool, index++); toolbar.Insert(andTool, index++); toolbar.Insert(orTool, index++); toolbar.Insert(xorTool, index++); return(toolbar); }
protected override void OnBuildToolBar(Gtk.Toolbar tb) { base.OnBuildToolBar(tb); if (font_label == null) { font_label = new ToolBarLabel(string.Format(" {0}: ", Catalog.GetString("Font"))); } tb.AppendItem(font_label); if (font_combo == null) { var fonts = PintaCore.System.Fonts.GetInstalledFonts(); fonts.Sort(); // Default to Arial or first in list int index = Math.Max(fonts.IndexOf("Arial"), 0); font_combo = new ToolBarFontComboBox(150, index, fonts.ToArray()); font_combo.ComboBox.Changed += HandleFontChanged; } tb.AppendItem(font_combo); if (spacer_label == null) { spacer_label = new ToolBarLabel(" "); } tb.AppendItem(spacer_label); if (size_combo == null) { size_combo = new ToolBarComboBox(65, 0, true); size_combo.ComboBox.Changed += HandleSizeChanged; } tb.AppendItem(size_combo); tb.AppendItem(new SeparatorToolItem()); if (bold_btn == null) { bold_btn = new ToolBarToggleButton("Toolbar.Bold.png", Catalog.GetString("Bold"), Catalog.GetString("Bold")); bold_btn.Toggled += HandleBoldButtonToggled; } tb.AppendItem(bold_btn); if (italic_btn == null) { italic_btn = new ToolBarToggleButton("Toolbar.Italic.png", Catalog.GetString("Italic"), Catalog.GetString("Italic")); italic_btn.Toggled += HandleItalicButtonToggled; } tb.AppendItem(italic_btn); if (underscore_btn == null) { underscore_btn = new ToolBarToggleButton("Toolbar.Underline.png", Catalog.GetString("Underline"), Catalog.GetString("Underline")); underscore_btn.Toggled += HandleUnderscoreButtonToggled; } tb.AppendItem(underscore_btn); tb.AppendItem(new SeparatorToolItem()); if (left_alignment_btn == null) { left_alignment_btn = new ToolBarToggleButton("Toolbar.LeftAlignment.png", Catalog.GetString("Left Align"), Catalog.GetString("Left Align")); left_alignment_btn.Active = true; left_alignment_btn.Toggled += HandleLeftAlignmentButtonToggled; } tb.AppendItem(left_alignment_btn); if (center_alignment_btn == null) { center_alignment_btn = new ToolBarToggleButton("Toolbar.CenterAlignment.png", Catalog.GetString("Center Align"), Catalog.GetString("Center Align")); center_alignment_btn.Toggled += HandleCenterAlignmentButtonToggled; } tb.AppendItem(center_alignment_btn); if (Right_alignment_btn == null) { Right_alignment_btn = new ToolBarToggleButton("Toolbar.RightAlignment.png", Catalog.GetString("Right Align"), Catalog.GetString("Right Align")); Right_alignment_btn.Toggled += HandleRightAlignmentButtonToggled; } tb.AppendItem(Right_alignment_btn); if (fill_sep == null) { fill_sep = new Gtk.SeparatorToolItem(); } tb.AppendItem(fill_sep); if (fill_label == null) { fill_label = new ToolBarLabel(string.Format(" {0}: ", Catalog.GetString("Text Style"))); } tb.AppendItem(fill_label); if (fill_button == null) { fill_button = new ToolBarDropDownButton(); fill_button.AddItem(Catalog.GetString("Normal"), "ShapeTool.Fill.png", 0); fill_button.AddItem(Catalog.GetString("Normal and Outline"), "ShapeTool.OutlineFill.png", 1); fill_button.AddItem(Catalog.GetString("Outline"), "ShapeTool.Outline.png", 2); fill_button.AddItem(Catalog.GetString("Fill Background"), "TextTool.FillBackground.png", 3); fill_button.SelectedItemChanged += HandleBoldButtonToggled; } tb.AppendItem(fill_button); tb.AppendItem(new SeparatorToolItem()); if (outline_width_label == null) { outline_width_label = new ToolBarLabel(string.Format(" {0}: ", Catalog.GetString("Outline width"))); } tb.AppendItem(outline_width_label); if (outline_width_minus == null) { outline_width_minus = new ToolBarButton("Toolbar.MinusButton.png", "", Catalog.GetString("Decrease outline size")); outline_width_minus.Clicked += MinusButtonClickedEvent; } tb.AppendItem(outline_width_minus); if (outline_width == null) { outline_width = new ToolBarComboBox(65, 1, true, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "20", "25", "30", "35", "40", "45", "50", "55"); (outline_width.Child as ComboBoxEntry).Changed += HandleSizeChanged; } tb.AppendItem(outline_width); if (outline_width_plus == null) { outline_width_plus = new ToolBarButton("Toolbar.PlusButton.png", "", Catalog.GetString("Increase outline size")); outline_width_plus.Clicked += PlusButtonClickedEvent; } tb.AppendItem(outline_width_plus); UpdateFontSizes(); if (PintaCore.Workspace.HasOpenDocuments) { //Make sure the event handler is never added twice. PintaCore.Workspace.ActiveDocument.LayerCloned -= FinalizeText; //When an ImageSurface is Cloned, finalize the re-editable text (if applicable). PintaCore.Workspace.ActiveDocument.LayerCloned += FinalizeText; } }
public virtual void SetToolbarStyle(Gtk.Toolbar toolbar) { }
private void BuildHeader () { header_table = new Table (2, 2, false); header_table.Show (); primary_vbox.PackStart (header_table, false, false, 0); main_menu = new MainMenu (); if (!PlatformDetection.IsMac && !PlatformDetection.IsMeeGo) { main_menu.Show (); header_table.Attach (main_menu, 0, 1, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0); } Alignment toolbar_alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f); toolbar_alignment.TopPadding = PlatformDetection.IsMeeGo ? 0u : 3u; toolbar_alignment.BottomPadding = PlatformDetection.IsMeeGo ? 0u : 3u; header_toolbar = (Toolbar)ActionService.UIManager.GetWidget ("/HeaderToolbar"); header_toolbar.ShowArrow = false; header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz; header_toolbar.Show (); if (PlatformDetection.IsMeeGo) { header_toolbar.IconSize = IconSize.LargeToolbar; header_toolbar.Name = "meego-toolbar"; } toolbar_alignment.Add (header_toolbar); toolbar_alignment.Show (); header_table.Attach (toolbar_alignment, 0, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0); var next_button = new NextButton (ActionService, PlatformDetection.IsMeeGo); next_button.Show (); ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/NextArrowButton", next_button); seek_slider = new ConnectedSeekSlider () { Resizable = ShowSeekSliderResizer.Get () }; seek_slider.SeekSlider.WidthRequest = SeekSliderWidth.Get (); seek_slider.SeekSlider.SizeAllocated += (o, a) => { SeekSliderWidth.Set (seek_slider.SeekSlider.Allocation.Width); }; seek_slider.ShowAll (); ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider); var track_info_display = new ClassicTrackInfoDisplay (); track_info_display.Show (); track_info_container = TrackInfoDisplay.GetEditable (track_info_display); track_info_container.Show (); ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_container, true); if (PlatformDetection.IsMeeGo) { track_info_display.ArtworkSpacing = 5; seek_slider.LeftPadding = 20; seek_slider.RightPadding = 20; var menu = (Menu)(ActionService.UIManager.GetWidget ("/ToolbarMenu")); var menu_button = new Hyena.Widgets.MenuButton (new Image (Stock.Preferences, IconSize.LargeToolbar), menu, true); menu_button.Show (); ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/ToolbarMenuPlaceholder", menu_button); var close_button = new Button (Image.NewFromIconName ("window-close", IconSize.LargeToolbar)) { TooltipText = Catalog.GetString ("Close") }; close_button.Clicked += (o, e) => Hide (); close_button.ShowAll (); ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/ClosePlaceholder", close_button); } else { var volume_button = new ConnectedVolumeButton (); volume_button.Show (); ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/VolumeButton", volume_button); } }
public void CreateHistoryWindowToolBar(Gtk.Toolbar toolbar) { toolbar.AppendItem(Undo.CreateToolBarItem()); toolbar.AppendItem(Redo.CreateToolBarItem()); }
private void BuildAlphaBlending(Toolbar tb) { if (alphablending_button != null) { tb.AppendItem (alphablending_button); return; } alphablending_button = new ToolBarDropDownButton (); alphablending_button.AddItem (Catalog.GetString ("Normal Blending"), "Toolbar.BlendingEnabledIcon.png", true); alphablending_button.AddItem (Catalog.GetString ("Overwrite"), "Toolbar.BlendingOverwriteIcon.png", false); tb.AppendItem (alphablending_button); }
public SingleView(Uri [] uris) { string glade_name = "single_view"; this.uri = uris [0]; System.Console.WriteLine("uri = {0}", uri.ToString()); xml = new Glade.XML(null, "f-spot.glade", glade_name, "f-spot"); xml.Autoconnect(this); window = (Gtk.Window)xml.GetWidget(glade_name); LoadPreference(Preferences.VIEWER_WIDTH); LoadPreference(Preferences.VIEWER_MAXIMIZED); Gtk.Toolbar toolbar = new Gtk.Toolbar(); toolbar_hbox.PackStart(toolbar); Widget rl_button = GtkUtil.MakeToolbarButton(toolbar, "f-spot-rotate-270", new System.EventHandler(HandleRotate270Command)); SetTip(rl_button, Catalog.GetString("Rotate photo left")); Widget rr_button = GtkUtil.MakeToolbarButton(toolbar, "f-spot-rotate-90", new System.EventHandler(HandleRotate90Command)); SetTip(rr_button, Catalog.GetString("Rotate photo right")); toolbar.AppendSpace(); Widget fs_button = GtkUtil.MakeToolbarButton(toolbar, "f-spot-fullscreen", new System.EventHandler(HandleViewFullscreen)); SetTip(fs_button, Catalog.GetString("View photos fullscreen")); Widget ss_button = GtkUtil.MakeToolbarButton(toolbar, "f-spot-slideshow", new System.EventHandler(HandleViewSlideshow)); SetTip(ss_button, Catalog.GetString("View photos in a slideshow")); collection = new UriCollection(uris); TargetEntry [] dest_table = { new TargetEntry("text/uri-list", 0, 0), new TargetEntry("text/plain", 0, 1) }; directory_view = new IconView(collection); directory_view.Selection.Changed += HandleSelectionChanged; directory_view.DragDataReceived += HandleDragDataReceived; Gtk.Drag.DestSet(directory_view, DestDefaults.All, dest_table, DragAction.Copy | DragAction.Move); directory_view.DisplayTags = false; directory_view.DisplayDates = false; directory_scrolled.Add(directory_view); ThumbnailGenerator.Default.OnPixbufLoaded += delegate { directory_view.QueueDraw(); }; image_view = new PhotoImageView(collection); FSpot.Global.ModifyColors(image_view); FSpot.Global.ModifyColors(image_scrolled); image_view.ZoomChanged += HandleZoomChanged; image_view.Item.Changed += HandleItemChanged; image_view.ButtonPressEvent += HandleImageViewButtonPressEvent; image_view.DragDataReceived += HandleDragDataReceived; Gtk.Drag.DestSet(image_view, DestDefaults.All, dest_table, DragAction.Copy | DragAction.Move); image_scrolled.Add(image_view); Window.ShowAll(); zoom_scale.ValueChanged += HandleZoomScaleValueChanged; LoadPreference(Preferences.VIEWER_SHOW_TOOLBAR); LoadPreference(Preferences.VIEWER_INTERPOLATION); LoadPreference(Preferences.VIEWER_TRANSPARENCY); LoadPreference(Preferences.VIEWER_TRANS_COLOR); ShowSidebar = collection.Count > 1; near_image.SetFromStock("f-spot-stock_near", Gtk.IconSize.SmallToolbar); far_image.SetFromStock("f-spot-stock_far", Gtk.IconSize.SmallToolbar); slide_delay = new FSpot.Delay(new GLib.IdleHandler(SlideShow)); LoadPreference(Preferences.VIEWER_SHOW_FILENAMES); Preferences.SettingChanged += OnPreferencesChanged; window.DeleteEvent += HandleDeleteEvent; collection.Changed += HandleCollectionChanged; UpdateStatusLabel(); if (collection.Count > 0) { directory_view.Selection.Add(0); } export.Submenu = (Mono.Addins.AddinManager.GetExtensionNode("/FSpot/Menus/Exports") as FSpot.Extensions.SubmenuNode).GetMenuItem().Submenu; export.Submenu.ShowAll(); export.Activated += HandleExportActivated; }
public void CreateToolBar(Gtk.Toolbar toolbar) { toolbar.AppendItem(File.New.CreateToolBarItem()); toolbar.AppendItem(File.Open.CreateToolBarItem()); toolbar.AppendItem(File.Save.CreateToolBarItem()); // Printing is disabled for now until it is fully functional. #if false toolbar.AppendItem(File.Print.CreateToolBarItem()); #endif toolbar.AppendItem(new SeparatorToolItem()); // Cut/Copy/Paste comes before Undo/Redo on Windows if (PintaCore.System.OperatingSystem == OS.Windows) { toolbar.AppendItem(Edit.Cut.CreateToolBarItem()); toolbar.AppendItem(Edit.Copy.CreateToolBarItem()); toolbar.AppendItem(Edit.Paste.CreateToolBarItem()); toolbar.AppendItem(new SeparatorToolItem()); toolbar.AppendItem(Edit.Undo.CreateToolBarItem()); toolbar.AppendItem(Edit.Redo.CreateToolBarItem()); } else { toolbar.AppendItem(Edit.Undo.CreateToolBarItem()); toolbar.AppendItem(Edit.Redo.CreateToolBarItem()); toolbar.AppendItem(new SeparatorToolItem()); toolbar.AppendItem(Edit.Cut.CreateToolBarItem()); toolbar.AppendItem(Edit.Copy.CreateToolBarItem()); toolbar.AppendItem(Edit.Paste.CreateToolBarItem()); } toolbar.AppendItem(new SeparatorToolItem()); toolbar.AppendItem(Image.CropToSelection.CreateToolBarItem()); toolbar.AppendItem(Edit.Deselect.CreateToolBarItem()); View.CreateToolBar(toolbar); toolbar.AppendItem(new SeparatorToolItem()); toolbar.AppendItem(new ToolBarImage("StatusBar.CursorXY.png")); ToolBarLabel cursor = new ToolBarLabel(" 0, 0"); toolbar.AppendItem(cursor); PintaCore.Chrome.LastCanvasCursorPointChanged += delegate { Gdk.Point pt = PintaCore.Chrome.LastCanvasCursorPoint; cursor.Text = string.Format(" {0}, {1}", pt.X, pt.Y); }; toolbar.AppendItem(new SeparatorToolItem()); toolbar.AppendItem(new ToolBarImage("Tools.RectangleSelect.png")); ToolBarLabel SelectionSize = new ToolBarLabel(" 0, 0"); toolbar.AppendItem(SelectionSize); PintaCore.Workspace.SelectionChanged += delegate { if (!PintaCore.Workspace.HasOpenDocuments) { SelectionSize.Text = " 0, 0"; return; } double minX = double.MaxValue; double minY = double.MaxValue; double maxX = double.MinValue; double maxY = double.MinValue; //Calculate the minimum rectangular bounds that surround the current selection. foreach (List <IntPoint> li in PintaCore.Workspace.ActiveDocument.Selection.SelectionPolygons) { foreach (IntPoint ip in li) { if (minX > ip.X) { minX = ip.X; } if (minY > ip.Y) { minY = ip.Y; } if (maxX < ip.X) { maxX = ip.X; } if (maxY < ip.Y) { maxY = ip.Y; } } } double xDiff = maxX - minX; double yDiff = maxY - minY; if (double.IsNegativeInfinity(xDiff)) { xDiff = 0d; } if (double.IsNegativeInfinity(yDiff)) { yDiff = 0d; } SelectionSize.Text = string.Format(" {0}, {1}", xDiff, yDiff); }; }
public static void Main(string [] args) { if (args.Length <= 0) { Console.WriteLine("\nUSAGE: ImageViewer.exe <filename>\n"); return; } string filename = args [0]; Application.Init(); window = new Gtk.Window("Image Viewer"); window.SetDefaultSize(200, 200); window.DeleteEvent += new EventHandler(Window_Delete); Gtk.ScrolledWindow scrolled_window = new Gtk.ScrolledWindow(new Adjustment(IntPtr.Zero), new Adjustment(IntPtr.Zero)); Gtk.VBox vbox = new VBox(false, 2); Gtk.VBox menubox = new VBox(false, 0); // Pack menubar MenuBar mb = new MenuBar(); Menu file_menu = new Menu(); MenuItem exit_item = new ImageMenuItem("gtk-close", new Gtk.AccelGroup(IntPtr.Zero)); MenuItem open_item = new ImageMenuItem("gtk-open", new Gtk.AccelGroup(IntPtr.Zero)); exit_item.Activated += new EventHandler(Window_Delete); open_item.Activated += new EventHandler(Window_Open); file_menu.Append(open_item); file_menu.Append(new Gtk.SeparatorMenuItem()); file_menu.Append(exit_item); MenuItem file_item = new MenuItem("_File"); file_item.Submenu = file_menu; mb.Append(file_item); menubox.PackStart(mb, false, false, 0); // Pack toolbar Gtk.Toolbar toolbar = new Gtk.Toolbar(); toolbar.InsertStock("gtk-open", "Open", String.Empty, new Gtk.SignalFunc(Window_Open), IntPtr.Zero, 0); toolbar.InsertStock("gtk-close", "Close", String.Empty, new Gtk.SignalFunc(Window_Delete), IntPtr.Zero, 1); menubox.PackStart(toolbar, false, false, 0); vbox.PackStart(menubox, false, false, 0); Pixbuf pix = GetPixbufFromFile(filename); image = new Image(pix); Refresh(filename, pix); scrolled_window.AddWithViewport(image); vbox.PackStart(scrolled_window, true, true, 0); scrolled_window.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); window.Add(vbox); window.ShowAll(); Application.Run(); }
public SingleView(Uri [] uris) { string glade_name = "single_view"; this.uri = uris [0]; System.Console.WriteLine("uri = {0}", uri.ToString()); xml = new Glade.XML(null, "f-spot.glade", glade_name, "f-spot"); xml.Autoconnect(this); window = (Gtk.Window)xml.GetWidget(glade_name); LoadPreference(Preferences.VIEWER_WIDTH); LoadPreference(Preferences.VIEWER_MAXIMIZED); Gtk.Toolbar toolbar = new Gtk.Toolbar(); toolbar_hbox.PackStart(toolbar); ToolButton rl_button = GtkUtil.ToolButtonFromTheme("object-rotate-left", Catalog.GetString("Rotate Left"), true); rl_button.Clicked += HandleRotate270Command; rl_button.SetTooltip(toolTips, Catalog.GetString("Rotate photo left"), null); toolbar.Insert(rl_button, -1); ToolButton rr_button = GtkUtil.ToolButtonFromTheme("object-rotate-right", Catalog.GetString("Rotate Right"), true); rr_button.Clicked += HandleRotate90Command; rr_button.SetTooltip(toolTips, Catalog.GetString("Rotate photo right"), null); toolbar.Insert(rr_button, -1); toolbar.Insert(new SeparatorToolItem(), -1); ToolButton fs_button = GtkUtil.ToolButtonFromTheme("view-fullscreen", Catalog.GetString("Fullscreen"), true); fs_button.Clicked += HandleViewFullscreen; fs_button.SetTooltip(toolTips, Catalog.GetString("View photos fullscreen"), null); toolbar.Insert(fs_button, -1); ToolButton ss_button = GtkUtil.ToolButtonFromTheme("media-playback-start", Catalog.GetString("Slideshow"), true); ss_button.Clicked += HandleViewSlideshow; ss_button.SetTooltip(toolTips, Catalog.GetString("View photos in a slideshow"), null); toolbar.Insert(ss_button, -1); collection = new UriCollection(uris); TargetEntry [] dest_table = { new TargetEntry("text/uri-list", 0, 0), new TargetEntry("text/plain", 0, 1) }; directory_view = new FSpot.Widgets.IconView(collection); directory_view.Selection.Changed += HandleSelectionChanged; directory_view.DragDataReceived += HandleDragDataReceived; Gtk.Drag.DestSet(directory_view, DestDefaults.All, dest_table, DragAction.Copy | DragAction.Move); directory_view.DisplayTags = false; directory_view.DisplayDates = false; directory_view.DisplayRatings = false; directory_scrolled = new ScrolledWindow(); directory_scrolled.Add(directory_view); sidebar = new Sidebar(); info_vbox.Add(sidebar); sidebar.AppendPage(directory_scrolled, Catalog.GetString("Folder"), "gtk-directory"); AddinManager.AddExtensionNodeHandler("/FSpot/Sidebar", OnSidebarExtensionChanged); sidebar.Context = ViewContext.Single; sidebar.CloseRequested += HandleHideSidePane; sidebar.Show(); ThumbnailGenerator.Default.OnPixbufLoaded += delegate { directory_view.QueueDraw(); }; image_view = new PhotoImageView(collection); GtkUtil.ModifyColors(image_view); GtkUtil.ModifyColors(image_scrolled); image_view.ZoomChanged += HandleZoomChanged; image_view.Item.Changed += HandleItemChanged; image_view.ButtonPressEvent += HandleImageViewButtonPressEvent; image_view.DragDataReceived += HandleDragDataReceived; Gtk.Drag.DestSet(image_view, DestDefaults.All, dest_table, DragAction.Copy | DragAction.Move); image_scrolled.Add(image_view); Window.ShowAll(); zoom_scale.ValueChanged += HandleZoomScaleValueChanged; LoadPreference(Preferences.VIEWER_SHOW_TOOLBAR); LoadPreference(Preferences.VIEWER_INTERPOLATION); LoadPreference(Preferences.VIEWER_TRANSPARENCY); LoadPreference(Preferences.VIEWER_TRANS_COLOR); ShowSidebar = collection.Count > 1; LoadPreference(Preferences.VIEWER_SHOW_FILENAMES); Preferences.SettingChanged += OnPreferencesChanged; window.DeleteEvent += HandleDeleteEvent; collection.Changed += HandleCollectionChanged; // wrap the methods to fit to the delegate image_view.Item.Changed += delegate(BrowsablePointer pointer, BrowsablePointerChangedArgs old) { IBrowsableItem [] item = { pointer.Current }; PhotoArray item_array = new PhotoArray(item); sidebar.HandleSelectionChanged(item_array); }; image_view.Item.Collection.ItemsChanged += sidebar.HandleSelectionItemsChanged; UpdateStatusLabel(); if (collection.Count > 0) { directory_view.Selection.Add(0); } export.Submenu = (Mono.Addins.AddinManager.GetExtensionNode("/FSpot/Menus/Exports") as FSpot.Extensions.SubmenuNode).GetMenuItem(this).Submenu; export.Submenu.ShowAll(); export.Activated += HandleExportActivated; }
public SingleView(Uri[] uris) { uri = uris[0]; Log.Debug("uri: " + uri); var builder = new GtkBeans.Builder("single_view.ui"); builder.Autoconnect(this); LoadPreference(Preferences.VIEWER_WIDTH); LoadPreference(Preferences.VIEWER_MAXIMIZED); var toolbar = new Gtk.Toolbar(); toolbar_hbox.PackStart(toolbar); rl_button = GtkUtil.ToolButtonFromTheme("object-rotate-left", Strings.RotateLeft, true); rl_button.Clicked += HandleRotate270Command; rl_button.TooltipText = Strings.RotatePhotoLeft; toolbar.Insert(rl_button, -1); rr_button = GtkUtil.ToolButtonFromTheme("object-rotate-right", Strings.RotateRight, true); rr_button.Clicked += HandleRotate90Command; rr_button.TooltipText = Strings.RotatePhotoRight; toolbar.Insert(rr_button, -1); toolbar.Insert(new SeparatorToolItem(), -1); ToolButton fs_button = GtkUtil.ToolButtonFromTheme("view-fullscreen", Strings.Fullscreen, true); fs_button.Clicked += HandleViewFullscreen; fs_button.TooltipText = Strings.ViewPhotosFullscreen; toolbar.Insert(fs_button, -1); ToolButton ss_button = GtkUtil.ToolButtonFromTheme("media-playback-start", Strings.Slideshow, true); ss_button.Clicked += HandleViewSlideshow; ss_button.TooltipText = Strings.ViewPhotosInASlideshow; toolbar.Insert(ss_button, -1); collection = new UriCollection(uris); var targetList = new TargetList(); //targetList.AddTextTargets (DragDropTargets.TargetType.PlainText); //targetList.AddUriTargets (DragDropTargets.TargetType.UriList); //directory_view = new SelectionCollectionGridView (collection); directory_view.Selection.Changed += HandleSelectionChanged; directory_view.DragDataReceived += HandleDragDataReceived; Gtk.Drag.DestSet(directory_view, DestDefaults.All, (TargetEntry[])targetList, DragAction.Copy | DragAction.Move); directory_view.DisplayTags = false; directory_view.DisplayDates = false; directory_view.DisplayRatings = false; directory_scrolled = new ScrolledWindow(); directory_scrolled.Add(directory_view); sidebar = new Sidebar(); info_vbox.Add(sidebar); sidebar.AppendPage(directory_scrolled, Strings.Folder, "gtk-directory"); AddinManager.AddExtensionNodeHandler("/FSpot/Sidebar", OnSidebarExtensionChanged); sidebar.Context = ViewContext.Single; sidebar.CloseRequested += HandleHideSidePane; sidebar.Show(); App.Instance.Container.Resolve <IThumbnailLoader> ().OnPixbufLoaded += delegate { directory_view.QueueDraw(); }; imageView = new PhotoImageView(collection); GtkUtil.ModifyColors(imageView); GtkUtil.ModifyColors(image_scrolled); imageView.ZoomChanged += HandleZoomChanged; imageView.Item.Changed += HandleItemChanged; imageView.ButtonPressEvent += HandleImageViewButtonPressEvent; imageView.DragDataReceived += HandleDragDataReceived; Gtk.Drag.DestSet(imageView, DestDefaults.All, (TargetEntry[])targetList, DragAction.Copy | DragAction.Move); image_scrolled.Add(imageView); Window.ShowAll(); zoom_scale.ValueChanged += HandleZoomScaleValueChanged; LoadPreference(Preferences.VIEWER_SHOW_TOOLBAR); LoadPreference(Preferences.VIEWER_INTERPOLATION); LoadPreference(Preferences.VIEWER_TRANSPARENCY); LoadPreference(Preferences.VIEWER_TRANS_COLOR); ShowSidebar = collection.Count > 1; LoadPreference(Preferences.VIEWER_SHOW_FILENAMES); Preferences.SettingChanged += OnPreferencesChanged; Window.DeleteEvent += HandleDeleteEvent; collection.Changed += HandleCollectionChanged; // wrap the methods to fit to the delegate imageView.Item.Changed += delegate(object sender, BrowsablePointerChangedEventArgs old) { if (!(sender is BrowsablePointer pointer)) { return; } IPhoto[] item = { pointer.Current }; sidebar.HandleSelectionChanged(new ObservableCollection <IPhoto>(item)); }; imageView.Item.Collection.CollectionChanged += sidebar.HandleCollectionItemsChanged; UpdateStatusLabel(); if (collection.Count > 0) { directory_view.Selection.Add(0); } export.Submenu = (AddinManager.GetExtensionNode("/FSpot/Menus/Exports") as SubmenuNode).GetMenuItem(this).Submenu; export.Submenu.ShowAll(); export.Activated += HandleExportActivated; }
public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string menuPath) { base.Initialize (builders, options, menuPath); testChangedHandler = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnDetailsTestChanged)); testService.TestSuiteChanged += (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnTestSuiteChanged)); paned = new VPaned (); VBox vbox = new VBox (); DockItemToolbar topToolbar = Window.GetToolbar (PositionType.Top); buttonRunAll = new Button (new Gtk.Image (Gtk.Stock.GoUp, IconSize.Menu)); buttonRunAll.Clicked += new EventHandler (OnRunAllClicked); buttonRunAll.Sensitive = true; buttonRunAll.TooltipText = GettextCatalog.GetString ("Run all tests"); topToolbar.Add (buttonRunAll); buttonRun = new Button (new Gtk.Image (Gtk.Stock.Execute, IconSize.Menu)); buttonRun.Clicked += new EventHandler (OnRunClicked); buttonRun.Sensitive = true; buttonRun.TooltipText = GettextCatalog.GetString ("Run test"); topToolbar.Add (buttonRun); buttonStop = new Button (new Gtk.Image (Gtk.Stock.Stop, IconSize.Menu)); buttonStop.Clicked += new EventHandler (OnStopClicked); buttonStop.Sensitive = false; buttonStop.TooltipText = GettextCatalog.GetString ("Cancel running test"); topToolbar.Add (buttonStop); topToolbar.ShowAll (); vbox.PackEnd (base.Control, true, true, 0); vbox.FocusChain = new Gtk.Widget [] { base.Control }; paned.Pack1 (vbox, true, true); detailsPad = new VBox (); EventBox eb = new EventBox (); HBox header = new HBox (); eb.Add (header); detailLabel = new HeaderLabel (); detailLabel.Padding = 6; Button hb = new Button (new Gtk.Image ("gtk-close", IconSize.SmallToolbar)); hb.Relief = ReliefStyle.None; hb.Clicked += new EventHandler (OnCloseDetails); header.PackEnd (hb, false, false, 0); hb = new Button (new Gtk.Image ("gtk-go-back", IconSize.SmallToolbar)); hb.Relief = ReliefStyle.None; hb.Clicked += new EventHandler (OnGoBackTest); header.PackEnd (hb, false, false, 0); header.Add (detailLabel); Gdk.Color hcol = eb.Style.Background (StateType.Normal); hcol.Red = (ushort) (((double)hcol.Red) * 0.9); hcol.Green = (ushort) (((double)hcol.Green) * 0.9); hcol.Blue = (ushort) (((double)hcol.Blue) * 0.9); // eb.ModifyBg (StateType.Normal, hcol); detailsPad.PackStart (eb, false, false, 0); VPaned panedDetails = new VPaned (); panedDetails.BorderWidth = 3; VBox boxPaned1 = new VBox (); chart = new TestChart (); chart.ButtonPressEvent += OnChartButtonPress; chart.SelectionChanged += new EventHandler (OnChartDateChanged); chart.HeightRequest = 50; Toolbar toolbar = new Toolbar (); toolbar.IconSize = IconSize.SmallToolbar; toolbar.ToolbarStyle = ToolbarStyle.Icons; toolbar.ShowArrow = false; ToolButton but = new ToolButton ("gtk-zoom-in"); but.Clicked += new EventHandler (OnZoomIn); toolbar.Insert (but, -1); but = new ToolButton ("gtk-zoom-out"); but.Clicked += new EventHandler (OnZoomOut); toolbar.Insert (but, -1); but = new ToolButton ("gtk-go-back"); but.Clicked += new EventHandler (OnChartBack); toolbar.Insert (but, -1); but = new ToolButton ("gtk-go-forward"); but.Clicked += new EventHandler (OnChartForward); toolbar.Insert (but, -1); but = new ToolButton ("gtk-goto-last"); but.Clicked += new EventHandler (OnChartLast); toolbar.Insert (but, -1); boxPaned1.PackStart (toolbar, false, false, 0); boxPaned1.PackStart (chart, true, true, 0); panedDetails.Pack1 (boxPaned1, false, false); // Detailed test information -------- infoBook = new ButtonNotebook (); infoBook.PageLoadRequired += new EventHandler (OnPageLoadRequired); // Info - Group summary Frame tf = new Frame (); ScrolledWindow sw = new ScrolledWindow (); detailsTree = new TreeView (); detailsTree.HeadersVisible = true; detailsTree.RulesHint = true; detailsStore = new ListStore (typeof(object), typeof(string), typeof (string), typeof (string), typeof (string)); CellRendererText trtest = new CellRendererText (); CellRendererText tr; TreeViewColumn col3 = new TreeViewColumn (); col3.Expand = false; // col3.Alignment = 0.5f; col3.Widget = new Gtk.Image (CircleImage.Success); col3.Widget.Show (); tr = new CellRendererText (); // tr.Xalign = 0.5f; col3.PackStart (tr, false); col3.AddAttribute (tr, "markup", 2); detailsTree.AppendColumn (col3); TreeViewColumn col4 = new TreeViewColumn (); col4.Expand = false; // col4.Alignment = 0.5f; col4.Widget = new Gtk.Image (CircleImage.Failure); col4.Widget.Show (); tr = new CellRendererText (); // tr.Xalign = 0.5f; col4.PackStart (tr, false); col4.AddAttribute (tr, "markup", 3); detailsTree.AppendColumn (col4); TreeViewColumn col5 = new TreeViewColumn (); col5.Expand = false; // col5.Alignment = 0.5f; col5.Widget = new Gtk.Image (CircleImage.NotRun); col5.Widget.Show (); tr = new CellRendererText (); // tr.Xalign = 0.5f; col5.PackStart (tr, false); col5.AddAttribute (tr, "markup", 4); detailsTree.AppendColumn (col5); TreeViewColumn col1 = new TreeViewColumn (); // col1.Resizable = true; // col1.Expand = true; col1.Title = "Test"; col1.PackStart (trtest, true); col1.AddAttribute (trtest, "markup", 1); detailsTree.AppendColumn (col1); detailsTree.Model = detailsStore; sw.Add (detailsTree); tf.Add (sw); tf.ShowAll (); TestSummaryPage = infoBook.AddPage (GettextCatalog.GetString ("Summary"), tf); // Info - Regressions list tf = new Frame (); sw = new ScrolledWindow (); tf.Add (sw); regressionTree = new TreeView (); regressionTree.HeadersVisible = false; regressionTree.RulesHint = true; regressionStore = new ListStore (typeof(object), typeof(string), typeof (Pixbuf)); CellRendererText trtest2 = new CellRendererText (); var pr = new CellRendererPixbuf (); TreeViewColumn col = new TreeViewColumn (); col.PackStart (pr, false); col.AddAttribute (pr, "pixbuf", 2); col.PackStart (trtest2, false); col.AddAttribute (trtest2, "markup", 1); regressionTree.AppendColumn (col); regressionTree.Model = regressionStore; sw.Add (regressionTree); tf.ShowAll (); TestRegressionsPage = infoBook.AddPage (GettextCatalog.GetString ("Regressions"), tf); // Info - Failed tests list tf = new Frame (); sw = new ScrolledWindow (); tf.Add (sw); failedTree = new TreeView (); failedTree.HeadersVisible = false; failedTree.RulesHint = true; failedStore = new ListStore (typeof(object), typeof(string), typeof (Pixbuf)); trtest2 = new CellRendererText (); pr = new CellRendererPixbuf (); col = new TreeViewColumn (); col.PackStart (pr, false); col.AddAttribute (pr, "pixbuf", 2); col.PackStart (trtest2, false); col.AddAttribute (trtest2, "markup", 1); failedTree.AppendColumn (col); failedTree.Model = failedStore; sw.Add (failedTree); tf.ShowAll (); TestFailuresPage = infoBook.AddPage (GettextCatalog.GetString ("Failed tests"), tf); // Info - results tf = new Frame (); sw = new ScrolledWindow (); tf.Add (sw); resultView = new TextView (); resultView.Editable = false; sw.Add (resultView); tf.ShowAll (); TestResultPage = infoBook.AddPage (GettextCatalog.GetString ("Result"), tf); // Info - Output tf = new Frame (); sw = new ScrolledWindow (); tf.Add (sw); outputView = new TextView (); outputView.Editable = false; sw.Add (outputView); tf.ShowAll (); TestOutputPage = infoBook.AddPage (GettextCatalog.GetString ("Output"), tf); panedDetails.Pack2 (infoBook, true, true); detailsPad.PackStart (panedDetails, true, true, 0); paned.Pack2 (detailsPad, true, true); paned.ShowAll (); infoBook.HidePage (TestResultPage); infoBook.HidePage (TestOutputPage); infoBook.HidePage (TestSummaryPage); infoBook.HidePage (TestRegressionsPage); infoBook.HidePage (TestFailuresPage); detailsPad.Sensitive = false; detailsPad.Hide (); detailsTree.RowActivated += new Gtk.RowActivatedHandler (OnTestActivated); regressionTree.RowActivated += new Gtk.RowActivatedHandler (OnRegressionTestActivated); failedTree.RowActivated += new Gtk.RowActivatedHandler (OnFailedTestActivated); foreach (UnitTest t in testService.RootTests) TreeView.AddChild (t); }
protected virtual void OnBuildToolBar(Toolbar tb) { if (tool_label == null) tool_label = new ToolBarLabel (string.Format (" {0}: ", Catalog.GetString ("Tool"))); tb.AppendItem (tool_label); if (tool_image == null) tool_image = new ToolBarImage (Icon); tb.AppendItem (tool_image); if (tool_sep == null) tool_sep = new SeparatorToolItem (); tb.AppendItem (tool_sep); }
protected virtual void OnClearToolBar(Toolbar tb) { while (tb.NItems > 0) tb.Remove (tb.Children[tb.NItems - 1]); }
private void BuildToolbars(IWorkspace workspace) { _toolBarBox.Remove(_toolBar); _toolBar.Destroy(); // make sure the old one is cleaned up! _toolBar = new Toolbar(); _toolBar.ToolbarStyle = ToolbarStyle.Icons; _toolBarBox.PackStart(_toolBar, true, true, 0); _tooltips = new Tooltips(); ActionModelRoot model = new ActionModelRoot(""); //model.Merge(WorkstationModel.ToolManager.ToolbarModel); model.Merge(DesktopApplication.ToolSet.ToolbarModel); if(workspace != null) { //model.Merge(workspace.ToolManager.ToolbarModel); model.Merge(workspace.ToolSet.ToolbarModel); } GtkToolbarBuilder.BuildToolbar(_toolBar, _tooltips, model); _toolBar.ShowAll(); }
private void BuildAntialiasingTool(Toolbar tb) { if (antialiasing_button != null) { tb.AppendItem (antialiasing_button); return; } antialiasing_button = new ToolBarDropDownButton (); antialiasing_button.AddItem (Catalog.GetString ("Antialiasing On"), "Toolbar.AntiAliasingEnabledIcon.png", true); antialiasing_button.AddItem (Catalog.GetString ("Antialiasing Off"), "Toolbar.AntiAliasingDisabledIcon.png", false); tb.AppendItem (antialiasing_button); }
public static Gtk.Widget MakeToolbarButton(Gtk.Toolbar toolbar, string stock_id, System.EventHandler e) { return(MakeToolbarButton(toolbar, stock_id, null, e)); }
public Gui() { dlayer = new DataLayer (); window_addtag.SetSizeRequest (100, 100); window.Icon = new Gdk.Pixbuf ("lipsticktower.jpg"); //Kalle, Andreas :: Call for Icon! Gtk.Entry tagEntry = new Gtk.Entry (); Gtk.VBox tagbox = new Gtk.VBox (false, 0); tagbox.PackStart (tagEntry, true, true, 0); window_addtag.Add (tagbox); window_addtag.ShowAll (); window.SetSizeRequest (300, 500); window.DeleteEvent += DeleteEvent; window.Icon = new Gdk.Pixbuf ("lipsticktower.jpg"); //Kalle, Andreas :: Call for Icon! Gtk.VBox box = new Gtk.VBox (false, 0); Gtk.HBox top = new Gtk.HBox (false, 0); //Gtk.ComboBox selector = new Gtk.ComboBox (); Gtk.ComboBox selector = ComboBox.NewText (); ScrolledWindow scroll = new ScrolledWindow (); filterEntry = new Gtk.Entry (); filterEntry.MaxLength = 1; filterEntry.Changed += OnFilterEntryTextChanged; //Gtk.TreeView tree = new Gtk.TreeView (); tree.HeadersVisible = false; tree.Reorderable = true; tree.EnableSearch = false; tree.RowActivated += OnRowActivate; Gtk.TreeViewColumn iconCol = new Gtk.TreeViewColumn ( ); iconCol.Title = "Icon"; Gtk.CellRendererPixbuf iconCell = new Gtk.CellRendererPixbuf (); iconCol.PackStart (iconCell, true); iconCol.SetCellDataFunc (iconCell, new Gtk.TreeCellDataFunc (RenderIcon)); Gtk.TreeViewColumn primCol = new Gtk.TreeViewColumn ( ); primCol.Title = "Primary Info"; Gtk.CellRendererText primInfoCell = new Gtk.CellRendererText (); primCol.PackStart (primInfoCell, true); primCol.SetCellDataFunc (primInfoCell, new Gtk.TreeCellDataFunc (RenderPrimary)); Gtk.TreeViewColumn secCol = new Gtk.TreeViewColumn ( ); secCol.Title = "Secondary Info"; Gtk.CellRendererText secInfoCell = new Gtk.CellRendererText (); secCol.PackStart (secInfoCell, true); secCol.SetCellDataFunc (secInfoCell, new Gtk.TreeCellDataFunc (RenderSecondary)); projects = DataLayer.GetProjectNames (); foreach (string project in projects) { Console.WriteLine (project); selector.AppendText (project); } selector.Changed += new EventHandler (OnSelectorChanged); //Store AssetStore = dlayer.GetAssets (projID); /*filter = new Gtk.TreeModelFilter (AssetStore, null); filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTree); tree.Model = filter;*/ //tree.Model = dlayer.GetAssets (projID); tree.AppendColumn (iconCol); tree.AppendColumn (primCol); tree.AppendColumn (secCol); MenuBar menu = new MenuBar (); Menu fileMenu = new Menu(); MenuItem menuItem = new MenuItem("_File"); menuItem.Submenu = fileMenu; menu.Append(menuItem); Statusbar status = new Statusbar (); Toolbar tool = new Toolbar (); ToolButton plus = new ToolButton (Gtk.Stock.Add); plus.Clicked += OnAddClicked; ToolButton minus = new ToolButton (Gtk.Stock.Remove); minus.Clicked += OnMinusClicked; box.PackStart (menu, false, true, 0); box.PackStart (tool, false, true, 0); tool.Insert(minus, 0); tool.Insert(plus, 0); top.PackStart (filterEntry, true, true, 0); top.PackStart (selector, true, true, 0); box.PackStart (top, false, true, 0); scroll.Add (tree); box.PackStart (scroll, true, true, 0); box.PackStart (status, false, true, 0); window.Add (box); window.ShowAll (); }
public SelectTool( CircuitEditor circuitEditor, Gtk.Toolbar toolbar ) : base(Util.Icon.Selector(), "Select", circuitEditor, toolbar) { }
// FIXME: Technically we can get the name of the component from the ComponentType // So we shouldn't need to have the name argument here because it should be able to be derived. public ComponentTool(ComponentType type, string name, CircuitEditor circuitEditor, Gtk.Toolbar toolbar) : base(Util.Icon.GetComponentImage(type), name, circuitEditor, toolbar) { if (circuitEditor.Gates.Components.TryGetValue(type, out var component) == false) { throw new InvalidOperationException($"There is no ICompoennt for the component type '{type}'"); } BaseComponent = component !; }
/// <summary>Crea la barra de herramientas de la ventana.</summary> /// <returns>La barra de herramientas.</returns> private Gtk.Toolbar CrearToolBar() { Gtk.Toolbar barra = new Gtk.Toolbar(); barra.ToolbarStyle = ToolbarStyle.Icons; Gtk.ToolButton btn = null; btn = new Gtk.ToolButton(Gtk.Stock.New); btn.Clicked += new EventHandler(VentanaNuevo); barra.Insert(btn, -1); btn = new Gtk.ToolButton(Gtk.Stock.Open); btn.Clicked += new EventHandler(VentanaAbrir); barra.Insert(btn, -1); btn = new Gtk.ToolButton(Gtk.Stock.Save); btn.Clicked += new EventHandler(VentanaGuardar); barra.Insert(btn, -1); barra.Insert(new Gtk.SeparatorToolItem(), -1); btnEjecutar = new Gtk.ToolButton(new Gtk.Image(IconManager.GetPixmap("run32.png")), GetText("Ventana_Ejecutar")); btnEjecutar.Clicked += new EventHandler(VentanaEjecutar); barra.Insert(btnEjecutar, -1); btnEjecutar.Sensitive = true; btnPausar = new Gtk.ToolButton(new Gtk.Image(IconManager.GetPixmap("pausar32.png")), GetText("Ventana_ToolTip_Pausar")); btnPausar.Clicked += new EventHandler(VentanaPausar); btnPausar.Sensitive = false; barra.Insert(btnPausar, -1); btnDetener = new Gtk.ToolButton(Gtk.Stock.Stop); btnDetener.Clicked += new EventHandler(VentanaDetener); btnDetener.Sensitive = false; barra.Insert(btnDetener, -1); barra.Insert(new Gtk.SeparatorToolItem(), -1); btn = new Gtk.ToolButton(Gtk.Stock.Quit); btn.Clicked += new EventHandler(VentanaSalir); barra.Insert(btn, -1); /* * * * * * * * barra.AppendSpace (); * * btnEjecutar = (Gtk.Button) barra.AppendItem( * , * GetText("Ventana_ToolTip_Ejecutar"), * String.Empty, * , * new Gtk.SignalFunc (VentanaNada)); * btnEjecutar.Clicked += new EventHandler (); * * * * * //-- * * btnPausar = new Gtk.ToggleButton (); * btnPausar.Add ( * new Gtk.Image(IconManager.GetPixmap("pausar32.png"))); * btnPausar.Clicked += new EventHandler (VentanaPausar); * btnPausar.Sensitive = false; * barra.AppendWidget (btnPausar, * GetText("Ventana_ToolTip_Pausar"), * String.Empty); * * //-- * btnDetener = (Gtk.Button) barra.InsertStock ( * Gtk.Stock.Stop, * GetText ("Ventana_ToolTip_Detener"), * String.Empty, * new Gtk.SignalFunc (VentanaNada), * IntPtr.Zero, * -1); * btnDetener.Clicked += new EventHandler (VentanaDetener); * btnDetener.Sensitive=false; * //-- * * barra.AppendSpace (); */ return(barra); }
protected override void OnBuildToolBar(Gtk.Toolbar tb) { base.OnBuildToolBar(tb); if (font_label == null) { font_label = new ToolBarLabel(string.Format(" {0}: ", Translations.GetString("Font"))); } tb.AppendItem(font_label); if (font_button == null) { font_button = new (new FontButton() { ShowStyle = true, ShowSize = true, UseFont = true }); // Default to Arial if possible. font_button.Widget.Font = Settings.GetSetting(FONT_SETTING, "Arial 12"); font_button.Widget.FontSet += HandleFontChanged; } tb.AppendItem(font_button); tb.AppendItem(new SeparatorToolItem()); if (bold_btn == null) { bold_btn = new ToolBarToggleButton("Toolbar.Bold.png", Translations.GetString("Bold"), Translations.GetString("Bold")); bold_btn.Active = Settings.GetSetting(BOLD_SETTING, false); bold_btn.Toggled += HandleBoldButtonToggled; } tb.AppendItem(bold_btn); if (italic_btn == null) { italic_btn = new ToolBarToggleButton("Toolbar.Italic.png", Translations.GetString("Italic"), Translations.GetString("Italic")); italic_btn.Active = Settings.GetSetting(ITALIC_SETTING, false); italic_btn.Toggled += HandleItalicButtonToggled; } tb.AppendItem(italic_btn); if (underscore_btn == null) { underscore_btn = new ToolBarToggleButton("Toolbar.Underline.png", Translations.GetString("Underline"), Translations.GetString("Underline")); underscore_btn.Active = Settings.GetSetting(UNDERLINE_SETTING, false); underscore_btn.Toggled += HandleUnderscoreButtonToggled; } tb.AppendItem(underscore_btn); tb.AppendItem(new SeparatorToolItem()); var alignment = (TextAlignment)Settings.GetSetting(ALIGNMENT_SETTING, (int)TextAlignment.Left); if (left_alignment_btn == null) { left_alignment_btn = new ToolBarToggleButton("Toolbar.LeftAlignment.png", Translations.GetString("Left Align"), Translations.GetString("Left Align")); left_alignment_btn.Active = alignment == TextAlignment.Left; left_alignment_btn.Toggled += HandleLeftAlignmentButtonToggled; } tb.AppendItem(left_alignment_btn); if (center_alignment_btn == null) { center_alignment_btn = new ToolBarToggleButton("Toolbar.CenterAlignment.png", Translations.GetString("Center Align"), Translations.GetString("Center Align")); center_alignment_btn.Active = alignment == TextAlignment.Center; center_alignment_btn.Toggled += HandleCenterAlignmentButtonToggled; } tb.AppendItem(center_alignment_btn); if (Right_alignment_btn == null) { Right_alignment_btn = new ToolBarToggleButton("Toolbar.RightAlignment.png", Translations.GetString("Right Align"), Translations.GetString("Right Align")); Right_alignment_btn.Active = alignment == TextAlignment.Right; Right_alignment_btn.Toggled += HandleRightAlignmentButtonToggled; } tb.AppendItem(Right_alignment_btn); if (fill_sep == null) { fill_sep = new Gtk.SeparatorToolItem(); } tb.AppendItem(fill_sep); if (fill_label == null) { fill_label = new ToolBarLabel(string.Format(" {0}: ", Translations.GetString("Text Style"))); } tb.AppendItem(fill_label); if (fill_button == null) { fill_button = new ToolBarDropDownButton(); fill_button.AddItem(Translations.GetString("Normal"), Pinta.Resources.Icons.FillStyleFill, 0); fill_button.AddItem(Translations.GetString("Normal and Outline"), Pinta.Resources.Icons.FillStyleOutlineFill, 1); fill_button.AddItem(Translations.GetString("Outline"), Pinta.Resources.Icons.FillStyleOutline, 2); fill_button.AddItem(Translations.GetString("Fill Background"), Pinta.Resources.Icons.FillStyleBackground, 3); fill_button.SelectedIndex = Settings.GetSetting(STYLE_SETTING, 0); fill_button.SelectedItemChanged += HandleBoldButtonToggled; } tb.AppendItem(fill_button); if (outline_sep == null) { outline_sep = new SeparatorToolItem(); } tb.AppendItem(outline_sep); if (outline_width_label == null) { outline_width_label = new ToolBarLabel(string.Format(" {0}: ", Translations.GetString("Outline width"))); } tb.AppendItem(outline_width_label); if (outline_width == null) { outline_width = new (new SpinButton(1, 1e5, 1) { Value = Settings.GetSetting(OUTLINE_WIDTH_SETTING, 2) }); outline_width.Widget.ValueChanged += HandleFontChanged; } tb.AppendItem(outline_width); outline_width.Visible = outline_width_label.Visible = outline_sep.Visible = StrokeText; UpdateFont(); if (PintaCore.Workspace.HasOpenDocuments) { //Make sure the event handler is never added twice. PintaCore.Workspace.ActiveDocument.LayerCloned -= FinalizeText; //When an ImageSurface is Cloned, finalize the re-editable text (if applicable). PintaCore.Workspace.ActiveDocument.LayerCloned += FinalizeText; } }
public static void ResetAfterHeaderBar(this Toolbar toolbar) { toolbar.StyleContext.RemoveProvider(HorizontalZeroPadding); }
protected override void OnBuildToolBar(Toolbar tb) { base.OnBuildToolBar(tb); // Change the cursor when the BrushWidth is changed. brush_width.ComboBox.Changed += (sender, e) => SetCursor (DefaultCursor); }
private void build() { this.vbox1 = new Gtk.VBox(); this.toolbar1 = new Gtk.Toolbar(); this.toolbar1.ToolbarStyle = ToolbarStyle.BothHoriz; this.new_toolbutton = new ToolButton(Stock.New); this.new_toolbutton.IsImportant = true; this.new_toolbutton.Label = "New Character"; this.new_toolbutton.Clicked += HandleNew_toolbuttonhandleClicked; this.toolbar1.Add(this.new_toolbutton); this.pref_toolbutton = new ToolButton(Stock.Preferences); this.pref_toolbutton.IsImportant = true; this.pref_toolbutton.Label = "Preferences"; this.pref_toolbutton.Clicked += HandlePref_toolbuttonhandleClicked; this.toolbar1.Add(this.pref_toolbutton); this.quit_toolbutton = new ToolButton(Stock.Quit); this.quit_toolbutton.IsImportant = true; this.quit_toolbutton.Label = "Quit"; this.quit_toolbutton.Clicked += HandleQuit_toolbuttonhandleClicked; this.toolbar1.Add(this.quit_toolbutton); this.about_toolbutton = new ToolButton(Stock.About); this.about_toolbutton.IsImportant = true; this.about_toolbutton.Label = "About"; this.about_toolbutton.Clicked += HandleAbout_toolbuttonhandleClicked; SeparatorToolItem sti = new SeparatorToolItem(); sti.Draw = false; sti.Expand = true; this.toolbar1.Add(sti); this.toolbar1.Add(this.about_toolbutton); this.statusbar1 = new Gtk.Statusbar(); this.image1 = new Image(MediaManager.GetPixbufFromBaseFile("BLLogo.jpg").ScaleSimple(296, 149, Gdk.InterpType.Bilinear)); Gtk.VBox vbox2 = new Gtk.VBox(); Gtk.ScrolledWindow sw1 = new Gtk.ScrolledWindow(); TreeStore ts1 = new TreeStore(typeof(string), typeof(string)); ts1.AppendValues("Player Characters", DateTime.Now.ToString()); ts1.AppendValues("Non-Player Characters", DateTime.Now.ToString()); ts1.AppendValues("Database", DateTime.Now.ToString()); TreeView tv1 = new TreeView(); tv1.Model = ts1; tv1.HeadersVisible = true; tv1.AppendColumn("Source", new CellRendererText(), "text", 0); tv1.AppendColumn("Last Update", new CellRendererText(), "text", 1); sw1.Add(tv1); vbox2.PackStart(this.image1, false, true, 0); vbox2.PackEnd(sw1, true, true, 0); this.vbox1.PackStart(this.toolbar1, false, true, 0); this.vbox1.PackStart(vbox2, true, true, 0); this.vbox1.PackStart(this.statusbar1, false, true, 0); this.Add(this.vbox1); //this.SetSizeRequest(640, Screen.Height - 100); this.SetSizeRequest(480, 640); this.Icon = Battle.Gui.MediaManager.GetPixbufFromBaseFile("LSIMMS.png"); this.statusbar1.Push(0, string.Format("{0} started @ {1}", this.session.GetType().ToString(), this.session.StartTime.ToString())); this.Maximize(); }