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


C# Menu.AppendToggleAction方法代码示例

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


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

示例1: Initialize

		public void Initialize (DockFrame workspace, Menu padMenu)
		{
			var layers = new LayersListWidget ();
			DockItem layers_item = workspace.AddItem ("Layers");
			DockItemToolbar layers_tb = layers_item.GetToolbar (PositionType.Bottom);

			layers_item.Label = Catalog.GetString ("Layers");
			layers_item.Content = layers;
			layers_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.MergeLayerDown.png");
            layers_item.DefaultWidth = 100;

			layers_tb.Add (PintaCore.Actions.Layers.AddNewLayer.CreateDockToolBarItem ());
			layers_tb.Add (PintaCore.Actions.Layers.DeleteLayer.CreateDockToolBarItem ());
			layers_tb.Add (PintaCore.Actions.Layers.DuplicateLayer.CreateDockToolBarItem ());
			layers_tb.Add (PintaCore.Actions.Layers.MergeLayerDown.CreateDockToolBarItem ());
			layers_tb.Add (PintaCore.Actions.Layers.MoveLayerUp.CreateDockToolBarItem ());
			layers_tb.Add (PintaCore.Actions.Layers.MoveLayerDown.CreateDockToolBarItem ());

			Gtk.ToggleAction show_layers = padMenu.AppendToggleAction ("Layers", Catalog.GetString ("Layers"), null, "Menu.Layers.MergeLayerDown.png");
			show_layers.Activated += delegate { layers_item.Visible = show_layers.Active; };
			layers_item.VisibleChanged += delegate { show_layers.Active = layers_item.Visible; };

			show_layers.Active = layers_item.Visible;

			PintaCore.Workspace.ActiveDocumentChanged += delegate { layers.Reset (); };
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:26,代码来源:LayersPad.cs

示例2: Initialize

        public void Initialize(DockFrame workspace, Menu padMenu)
        {
            DockItem toolbox_item = workspace.AddItem ("Toolbox");
            ToolBoxWidget toolbox = new ToolBoxWidget () { Name = "toolbox" };

            toolbox_item.Label = Catalog.GetString ("Tools");
            toolbox_item.Content = toolbox;
            toolbox_item.Icon = PintaCore.Resources.GetIcon ("Tools.Pencil.png");
            toolbox_item.Behavior |= DockItemBehavior.CantClose;
            toolbox_item.DefaultWidth = 65;

            Gtk.ToggleAction show_toolbox = padMenu.AppendToggleAction ("Tools", Catalog.GetString ("Tools"), null, "Tools.Pencil.png");
            show_toolbox.Activated += delegate { toolbox_item.Visible = show_toolbox.Active; };
            toolbox_item.VisibleChanged += delegate { show_toolbox.Active = toolbox_item.Visible; };

            show_toolbox.Active = toolbox_item.Visible;
        }
开发者ID:jobernolte,项目名称:Pinta,代码行数:17,代码来源:ToolBoxPad.cs

示例3: Initialize

		public void Initialize (DockFrame workspace, Menu padMenu)
		{
			DockItem palette_item = workspace.AddItem ("Palette");
			ColorPaletteWidget palette = new ColorPaletteWidget () { Name = "palette" };

			palette_item.Label = Catalog.GetString ("Palette");
			palette_item.Content = palette;
			palette_item.Icon = PintaCore.Resources.GetIcon ("Pinta.png");
			palette_item.DefaultLocation = "Toolbox/Bottom";
			palette_item.Behavior |= DockItemBehavior.CantClose;
			palette_item.DefaultWidth = 35;

			Gtk.ToggleAction show_palette = padMenu.AppendToggleAction ("Palette", Catalog.GetString ("Palette"), null, "Pinta.png");
			show_palette.Activated += delegate { palette_item.Visible = show_palette.Active; };
			palette_item.VisibleChanged += delegate { show_palette.Active = palette_item.Visible; };

			palette.Initialize ();
			show_palette.Active = palette_item.Visible;
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:19,代码来源:ColorPalettePad.cs

示例4: Initialize

        public void Initialize(DockFrame workspace, Menu padMenu)
        {
            var history = new HistoryTreeView ();
            DockItem history_item = workspace.AddItem ("History");
            DockItemToolbar history_tb = history_item.GetToolbar (PositionType.Bottom);

            history_item.Label = Catalog.GetString ("History");
            history_item.DefaultLocation = "Images/Bottom";
            history_item.Content = history;
            history_item.Icon = PintaCore.Resources.GetIcon ("Menu.Layers.DuplicateLayer.png");

            history_tb.Add (PintaCore.Actions.Edit.Undo.CreateDockToolBarItem ());
            history_tb.Add (PintaCore.Actions.Edit.Redo.CreateDockToolBarItem ());
            Gtk.ToggleAction show_history = padMenu.AppendToggleAction ("History", Catalog.GetString ("History"), null, "Menu.Layers.DuplicateLayer.png");
            show_history.Activated += delegate { history_item.Visible = show_history.Active; };
            history_item.VisibleChanged += delegate { show_history.Active = history_item.Visible; };

            show_history.Active = history_item.Visible;
        }
开发者ID:jobernolte,项目名称:Pinta,代码行数:19,代码来源:HistoryPad.cs

示例5: Initialize

        public void Initialize(DockFrame workspace, Menu padMenu)
        {
            DockItem open_images_item = workspace.AddItem ("Images");
            open_images_item.DefaultLocation = "Layers/Bottom";
            open_images_item.Label = Catalog.GetString ("Images");
            open_images_item.Content = new OpenImagesListWidget ();
            open_images_item.Icon = PintaCore.Resources.GetIcon ("Menu.Effects.Default.png");

            ToggleAction show_open_images = padMenu.AppendToggleAction ("Images", Catalog.GetString ("Images"), null, null);

            show_open_images.Activated += delegate {
                open_images_item.Visible = show_open_images.Active;
            };

            open_images_item.VisibleChanged += delegate {
                show_open_images.Active = open_images_item.Visible;
            };

            show_open_images.Active = open_images_item.Visible;
        }
开发者ID:rini18,项目名称:Pinta,代码行数:20,代码来源:OpenImagesPad.cs

示例6: Initialize

        public void Initialize(DockFrame workspace, Menu padMenu)
        {
            const string pad_name = "Open Images";

            DockItem open_images_item = workspace.AddItem (pad_name);
            open_images_item.Label = Catalog.GetString (pad_name);
            open_images_item.Content = new OpenImagesListWidget ();

            ToggleAction show_open_images = padMenu.AppendToggleAction (pad_name, Catalog.GetString (pad_name), null, null);

            show_open_images.Activated += delegate {
                open_images_item.Visible = show_open_images.Active;
            };

            open_images_item.VisibleChanged += delegate {
                show_open_images.Active = open_images_item.Visible;
            };

            show_open_images.Active = open_images_item.Visible;
        }
开发者ID:rolandixor,项目名称:Pinta,代码行数:20,代码来源:OpenImagesPad.cs


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