当前位置: 首页>>代码示例>>C#>>正文


C# Toolbar.AppendItem方法代码示例

本文整理汇总了C#中Gtk.Toolbar.AppendItem方法的典型用法代码示例。如果您正苦于以下问题:C# Toolbar.AppendItem方法的具体用法?C# Toolbar.AppendItem怎么用?C# Toolbar.AppendItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.Toolbar的用法示例。


在下文中一共展示了Toolbar.AppendItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnBuildToolBar

		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);
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:30,代码来源:BaseBrushTool.cs

示例2: SetupToolbar

		/// <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;
			}
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:46,代码来源:DashPatternBox.cs

示例3: Create

        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;
        }
开发者ID:saraa,项目名称:fishtastic,代码行数:55,代码来源:TestToolbar.cs

示例4: OnBuildToolBar

		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;
				};
			}
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:36,代码来源:FreeformShapeTool.cs

示例5: OnBuildToolBar

        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);
        }
开发者ID:manish,项目名称:Pinta,代码行数:17,代码来源:BaseTool.cs

示例6: BuildRasterizationToolItems

        protected virtual void BuildRasterizationToolItems(Toolbar tb)
        {
            if (ShowAlphaBlendingButton || ShowAntialiasingButton)
                tb.AppendItem (new SeparatorToolItem ());

            if (ShowAntialiasingButton)
                BuildAntialiasingTool (tb);
            if (ShowAlphaBlendingButton)
                BuildAlphaBlending (tb);
        }
开发者ID:manish,项目名称:Pinta,代码行数:10,代码来源:BaseTool.cs

示例7: OnBuildToolBar

        protected virtual void OnBuildToolBar(Toolbar tb)
        {
            if (tool_label == null)
                tool_label = new ToolBarLabel (" 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);
        }
开发者ID:deckarep,项目名称:Pinta,代码行数:17,代码来源:BaseTool.cs

示例8: OnBuildToolBar

        protected override void OnBuildToolBar(Toolbar tb)
        {
            base.OnBuildToolBar (tb);

            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 = (PaintBrush)brush_combo_box.Model.GetValue (iter, 1);
                    } else {
                        active_brush = default_brush;
                    }
                };
                foreach (var brush in PintaCore.PaintBrushes) {
                    if (default_brush == null)
                        default_brush = (PaintBrush)brush;
                    brush_combo_box.Model.AppendValues (brush.Name, brush);
                }
                brush_combo_box.ComboBox.Active = 0;
            }

            tb.AppendItem (brush_label);
            tb.AppendItem (brush_combo_box);
        }
开发者ID:linuxmhall,项目名称:Pinta,代码行数:28,代码来源:PaintBrushTool.cs

示例9: OnBuildToolBar

        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);
        }
开发者ID:bodicsek,项目名称:Pinta,代码行数:29,代码来源:PaintBrushTool.cs

示例10: OnBuildToolBar

        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);
        }
开发者ID:bodicsek,项目名称:Pinta,代码行数:24,代码来源:FreeformShapeTool.cs

示例11: CreateToolbar

		Toolbar CreateToolbar () 
		{
			Toolbar toolbar = new Toolbar ();

			toolbar.ToolbarStyle = ToolbarStyle.Icons;

			toolbar.AppendItem ("Execute", 
				"Execute SQL Commands.", String.Empty,
				new Gtk.Image (Stock.Execute, IconSize.SmallToolbar),
				new Gtk.SignalFunc (OnToolbar_Execute));	
			
			toolbar.AppendItem ("DataGrid", 
				"Toggle Results to DataGrid or TextView", String.Empty,
				new Gtk.Image (Stock.GoDown, IconSize.SmallToolbar),
				new Gtk.SignalFunc (OnToolbar_ToggleResultsOutput));	

			return toolbar;
		}
开发者ID:Zman0169,项目名称:mono,代码行数:18,代码来源:sqlsharpgtk.cs

示例12: BuildAntialiasingTool

        private void BuildAntialiasingTool(Toolbar tb)
        {
            Image antialiasing_on_icon = new Image (PintaCore.Resources.GetIcon ("Toolbar.AntiAliasingEnabledIcon.png"));
            antialiasing_on_icon.Show ();
            Image antialiasing_off_icon = new Image (PintaCore.Resources.GetIcon ("Toolbar.AntiAliasingDisabledIcon.png"));
            antialiasing_off_icon.Show ();

            antialiasing_btn = new ToggleToolButton ();
            antialiasing_btn.IconWidget = antialiasing_off_icon;
            antialiasing_btn.Show ();
            antialiasing_btn.Label = Catalog.GetString ("Antialiasing");
            antialiasing_btn.TooltipText = Catalog.GetString ("Antialiasing");
            antialiasing_btn.Toggled += delegate {
                if (antialiasing_btn.Active)
                    antialiasing_btn.IconWidget = antialiasing_on_icon;
                else
                    antialiasing_btn.IconWidget = antialiasing_off_icon;
            };
            tb.AppendItem (antialiasing_btn);
        }
开发者ID:linuxmhall,项目名称:Pinta,代码行数:20,代码来源:BaseTool.cs

示例13: BuildAlphaBlending

        private void BuildAlphaBlending(Toolbar tb)
        {
            Image blending_on_icon = new Image (PintaCore.Resources.GetIcon ("Toolbar.BlendingEnabledIcon.png"));
            blending_on_icon.Show ();
            Image blending_off_icon = new Image (PintaCore.Resources.GetIcon ("Toolbar.BlendingOverwriteIcon.png"));
            blending_off_icon.Show ();

            alphablending_btn = new ToggleToolButton ();
            alphablending_btn.IconWidget = blending_off_icon;
            alphablending_btn.Show ();
            alphablending_btn.Label = Catalog.GetString ("Antialiasing");
            alphablending_btn.TooltipText = Catalog.GetString ("Normal blending / Overwrite blending");
            alphablending_btn.Toggled += delegate {
                if (alphablending_btn.Active)
                    alphablending_btn.IconWidget = blending_on_icon;
                else
                    alphablending_btn.IconWidget = blending_off_icon;
            };
            tb.AppendItem (alphablending_btn);
        }
开发者ID:linuxmhall,项目名称:Pinta,代码行数:20,代码来源:BaseTool.cs

示例14: OnBuildToolBar

        protected override void OnBuildToolBar(Toolbar tb)
        {
            base.OnBuildToolBar(tb);

            if (label_type == null)
                label_type = new ToolBarLabel (string.Format (" {0}: ", Catalog.GetString ("Type")));
            if (comboBox_type == null) {
                comboBox_type = new ToolBarComboBox (100, 0, false, Catalog.GetString ("Normal"), Catalog.GetString ("Smooth"));

                comboBox_type.ComboBox.Changed += (o, e) =>
                {
                    eraser_type = (EraserType)comboBox_type.ComboBox.Active;
                };
            }
            tb.AppendItem (label_type);
            tb.AppendItem (comboBox_type);
            // Change the cursor when the BrushWidth is changed.
            brush_width.ComboBox.Changed += (sender, e) => SetCursor (DefaultCursor);
        }
开发者ID:msiyer,项目名称:Pinta,代码行数:19,代码来源:EraserTool.cs

示例15: OnBuildToolBar

        protected override void OnBuildToolBar(Toolbar tb)
        {
            base.OnBuildToolBar(tb);

            if (spacer_label == null)
                spacer_label = new ToolBarLabel ("  ");

            tb.AppendItem (spacer_label);

            if (fill_outline_image == null)
                fill_outline_image = new ToolBarImage ("ShapeTool.OutlineFill.png");

            tb.AppendItem (fill_outline_image);

            if (fill_outline_label == null)
                fill_outline_label = new ToolBarLabel (" : ");

            tb.AppendItem (fill_outline_label);

            if (fill_outline == null)
                fill_outline = new ToolBarComboBox (150, 0, false, "Outline Shape", "Fill Shape", "Fill and Outline Shape");

            tb.AppendItem (fill_outline);
        }
开发者ID:xxgreg,项目名称:Pinta,代码行数:24,代码来源:FreeformShapeTool.cs


注:本文中的Gtk.Toolbar.AppendItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。