Exemple #1
0
        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;
        }
Exemple #2
0
		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);
		}
Exemple #3
0
        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 ();
        }
Exemple #4
0
        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);
        }
Exemple #5
0
		/// <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;
			}
		}
Exemple #6
0
		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 ();
		}
Exemple #8
0
        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();
        }
Exemple #9
0
		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;
		}
Exemple #10
0
        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;
        }
Exemple #11
0
        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;
			};
		}
Exemple #13
0
		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);
		}
Exemple #14
0
 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);
                }
            }
        }
Exemple #18
0
        /// <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();
            }
        }
Exemple #20
0
	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);
        }
Exemple #21
0
		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;
				};
			}
		}
Exemple #22
0
		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);
		}
Exemple #23
0
        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 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);
            }
        }
Exemple #25
0
        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 ();
        }
Exemple #26
0
        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);
        }
Exemple #27
0
        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);
        }
Exemple #28
0
 protected virtual void OnClearToolBar(Toolbar tb)
 {
     while (tb.NItems > 0)
         tb.Remove (tb.Children[tb.NItems - 1]);
 }
Exemple #29
0
        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);
        }
Exemple #30
0
        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);
        }