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


C# Gtk.Action类代码示例

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


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

示例1: FileActions

        public FileActions()
        {
            New = new Gtk.Action ("New", Catalog.GetString ("New..."), null, Stock.New);
            NewScreenshot = new Gtk.Action ("NewScreenshot", Catalog.GetString ("New Screenshot..."), null, Stock.Fullscreen);
            Open = new Gtk.Action ("Open", Catalog.GetString ("Open..."), null, Stock.Open);
            OpenRecent = new RecentAction ("OpenRecent", Catalog.GetString ("Open Recent"), null, Stock.Open, RecentManager.Default);

            RecentFilter recentFilter = new RecentFilter ();
            recentFilter.AddApplication ("Pinta");

            (OpenRecent as RecentAction).AddFilter (recentFilter);

            Close = new Gtk.Action ("Close", Catalog.GetString ("Close"), null, Stock.Close);
            Save = new Gtk.Action ("Save", Catalog.GetString ("Save"), null, Stock.Save);
            SaveAs = new Gtk.Action ("SaveAs", Catalog.GetString ("Save As..."), null, Stock.SaveAs);
            Print = new Gtk.Action ("Print", Catalog.GetString ("Print"), null, Stock.Print);
            Exit = new Gtk.Action ("Exit", Catalog.GetString ("Quit"), null, Stock.Quit);

            New.ShortLabel = Catalog.GetString ("New");
            Open.ShortLabel = Catalog.GetString ("Open");
            Open.IsImportant = true;
            Save.IsImportant = true;

            Close.Sensitive = false;
            Print.Sensitive = false;
        }
开发者ID:RodH257,项目名称:Pinta,代码行数:26,代码来源:FileActions.cs

示例2: ImageActions

        public ImageActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.Image.CanvasSize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.CanvasSize.png")));
            fact.Add ("Menu.Image.Crop.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Crop.png")));
            fact.Add ("Menu.Image.Flatten.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Flatten.png")));
            fact.Add ("Menu.Image.FlipHorizontal.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.FlipHorizontal.png")));
            fact.Add ("Menu.Image.FlipVertical.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.FlipVertical.png")));
            fact.Add ("Menu.Image.Resize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Resize.png")));
            fact.Add ("Menu.Image.Rotate180CW.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Rotate180CW.png")));
            fact.Add ("Menu.Image.Rotate90CCW.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Rotate90CCW.png")));
            fact.Add ("Menu.Image.Rotate90CW.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Image.Rotate90CW.png")));
            fact.AddDefault ();

            CropToSelection = new Gtk.Action ("CropToSelection", Catalog.GetString ("Crop to Selection"), null, "Menu.Image.Crop.png");
            AutoCrop = new Gtk.Action ("AutoCrop", Catalog.GetString ("Auto Crop"), null, "Menu.Image.Crop.png");
            Resize = new Gtk.Action ("Resize", Catalog.GetString ("Resize Image..."), null, "Menu.Image.Resize.png");
            CanvasSize = new Gtk.Action ("CanvasSize", Catalog.GetString ("Resize Canvas..."), null, "Menu.Image.CanvasSize.png");
            FlipHorizontal = new Gtk.Action ("FlipHorizontal", Catalog.GetString ("Flip Horizontal"), null, "Menu.Image.FlipHorizontal.png");
            FlipVertical = new Gtk.Action ("FlipVertical", Catalog.GetString ("Flip Vertical"), null, "Menu.Image.FlipVertical.png");
            RotateCW = new Gtk.Action ("RotateCW", Catalog.GetString ("Rotate 90° Clockwise"), null, "Menu.Image.Rotate90CW.png");
            RotateCCW = new Gtk.Action ("RotateCCW", Catalog.GetString ("Rotate 90° Counter-Clockwise"), null, "Menu.Image.Rotate90CCW.png");
            Rotate180 = new Gtk.Action ("Rotate180", Catalog.GetString ("Rotate 180°"), null, "Menu.Image.Rotate180CW.png");
            Flatten = new Gtk.Action ("Flatten", Catalog.GetString ("Flatten"), null, "Menu.Image.Flatten.png");

            CropToSelection.Sensitive = false;
        }
开发者ID:JoeyScarr,项目名称:Pinta,代码行数:27,代码来源:ImageActions.cs

示例3: CategoriaListView

        public CategoriaListView()
        {
            TreeViewHelper t=new TreeViewHelper(treeView,"Select * from categoria");
            Gtk.Action refreshAction = new Gtk.Action("refreshAction", null, null, Stock.Refresh);
            //tengo acceso al actionGroup de IEntityListView
            actionGroup.Add(refreshAction);
            refreshAction.Activated += delegate {t.Refresh ();};
            Gtk.Action editAction = new Gtk.Action("editAction", null, null, Stock.Edit);
            actionGroup.Add(editAction);
            editAction.Activated += delegate {
                Window ventana=new Window("Editar");
                ventana.SetDefaultSize(500,500);
                VBox h=new VBox(true,10);
                ventana.Add (h);
                Label enunciado=new Label("Introduce el nuevo valor:");
                h.Add (enunciado);
                Entry caja=new Entry();
                h.Add (caja);
                Button b=new Button("Editar");
                h.Add (b);
                b.Clicked+=delegate
                {
                    IDbCommand dbCommand=App.Instance.DbConnection.CreateCommand();
                    dbCommand.CommandText =
                    string.Format ("update categoria set nombre='{1}' where id={0}", t.Id,caja.Text);
                    dbCommand.ExecuteNonQuery ();
                };

                ventana.ShowAll();

            };
        }
开发者ID:ruben206,项目名称:ad,代码行数:32,代码来源:CategoriaListView.cs

示例4: LayerActions

        public LayerActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.Layers.AddNewLayer.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.AddNewLayer.png")));
            fact.Add ("Menu.Layers.DeleteLayer.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.DeleteLayer.png")));
            fact.Add ("Menu.Layers.DuplicateLayer.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.DuplicateLayer.png")));
            fact.Add ("Menu.Layers.MergeLayerDown.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.MergeLayerDown.png")));
            fact.Add ("Menu.Layers.MoveLayerDown.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.MoveLayerDown.png")));
            fact.Add ("Menu.Layers.MoveLayerUp.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.MoveLayerUp.png")));
            fact.Add ("Menu.Layers.FlipHorizontal.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.FlipHorizontal.png")));
            fact.Add ("Menu.Layers.FlipVertical.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.FlipVertical.png")));
            fact.Add ("Menu.Layers.ImportFromFile.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.ImportFromFile.png")));
            fact.Add ("Menu.Layers.LayerProperties.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.LayerProperties.png")));
            fact.Add ("Menu.Layers.RotateZoom.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Layers.RotateZoom.png")));
            fact.AddDefault ();

            AddNewLayer = new Gtk.Action ("AddNewLayer", Catalog.GetString ("Add New Layer"), null, "Menu.Layers.AddNewLayer.png");
            DeleteLayer = new Gtk.Action ("DeleteLayer", Catalog.GetString ("Delete Layer"), null, "Menu.Layers.DeleteLayer.png");
            DuplicateLayer = new Gtk.Action ("DuplicateLayer", Catalog.GetString ("Duplicate Layer"), null, "Menu.Layers.DuplicateLayer.png");
            MergeLayerDown = new Gtk.Action ("MergeLayerDown", Catalog.GetString ("Merge Layer Down"), null, "Menu.Layers.MergeLayerDown.png");
            ImportFromFile = new Gtk.Action ("ImportFromFile", Catalog.GetString ("Import from File..."), null, "Menu.Layers.ImportFromFile.png");
            FlipHorizontal = new Gtk.Action ("FlipHorizontal", Catalog.GetString ("Flip Horizontal"), null, "Menu.Layers.FlipHorizontal.png");
            FlipVertical = new Gtk.Action ("FlipVertical", Catalog.GetString ("Flip Vertical"), null, "Menu.Layers.FlipVertical.png");
            RotateZoom = new Gtk.Action ("RotateZoom", Catalog.GetString ("Rotate / Zoom"), null, "Menu.Layers.RotateZoom.png");
            MoveLayerUp = new Gtk.Action ("MoveLayerUp", Catalog.GetString ("Move Layer Up"), null, "Menu.Layers.MoveLayerUp.png");
            MoveLayerDown = new Gtk.Action ("MoveLayerDown", Catalog.GetString ("Move Layer Down"), null, "Menu.Layers.MoveLayerDown.png");
            Properties = new Gtk.Action ("Properties", Catalog.GetString ("Layer Properties..."), null, "Menu.Layers.LayerProperties.png");

            RotateZoom.Sensitive = false;
        }
开发者ID:jonnyro,项目名称:Pinta,代码行数:30,代码来源:LayerActions.cs

示例5: FileActions

        public FileActions()
        {
            New = new Gtk.Action ("New", Catalog.GetString ("New..."), null, Stock.New);
            Open = new Gtk.Action ("Open", Catalog.GetString ("Open..."), null, Stock.Open);
            OpenRecent = new RecentAction ("OpenRecent", Catalog.GetString ("Open Recent"), null, Stock.Open, RecentManager.Default);

            RecentFilter recentFilter = new RecentFilter ();
            recentFilter.AddApplication ("Pinta");

            (OpenRecent as RecentAction).AddFilter (recentFilter);

            recentData = new RecentData ();
            recentData.AppName = "Pinta";
            recentData.AppExec = GetExecutablePathname ();
            recentData.MimeType = "image/*";

            lastDialogDir = System.Environment.GetFolderPath (Environment.SpecialFolder.MyPictures);

            Close = new Gtk.Action ("Close", Catalog.GetString ("Close"), null, Stock.Close);
            Save = new Gtk.Action ("Save", Catalog.GetString ("Save"), null, Stock.Save);
            SaveAs = new Gtk.Action ("SaveAs", Catalog.GetString ("Save As..."), null, Stock.SaveAs);
            Print = new Gtk.Action ("Print", Catalog.GetString ("Print"), null, Stock.Print);
            Exit = new Gtk.Action ("Exit", Catalog.GetString ("Quit"), null, Stock.Quit);

            New.ShortLabel = Catalog.GetString ("New");
            Open.ShortLabel = Catalog.GetString ("Open");
            Open.IsImportant = true;
            Save.IsImportant = true;

            Close.Sensitive = false;
            Print.Sensitive = false;
        }
开发者ID:joehillen,项目名称:Pinta,代码行数:32,代码来源:FileActions.cs

示例6: FileActions

        public FileActions()
        {
            New = new Gtk.Action ("New", Mono.Unix.Catalog.GetString ("New..."), null, "gtk-new");
            Open = new Gtk.Action ("Open", Mono.Unix.Catalog.GetString ("Open..."), null, "gtk-open");
            OpenRecent = new RecentAction ("OpenRecent", Catalog.GetString ("Open Recent"), null, "gtk-open",
                                           RecentManager.Default);

            RecentFilter recentFilter = new RecentFilter ();
            recentFilter.AddApplication ("Pinta");

            (OpenRecent as RecentAction).AddFilter (recentFilter);

            recentData = new RecentData ();
            recentData.AppName = "Pinta";
            recentData.AppExec = GetExecutablePathname ();
            recentData.MimeType = "image/*";

            Close = new Gtk.Action ("Close", Mono.Unix.Catalog.GetString ("Close"), null, "gtk-close");
            Save = new Gtk.Action ("Save", Mono.Unix.Catalog.GetString ("Save"), null, "gtk-save");
            SaveAs = new Gtk.Action ("SaveAs", Mono.Unix.Catalog.GetString ("Save As..."), null, "gtk-save-as");
            Print = new Gtk.Action ("Print", Mono.Unix.Catalog.GetString ("Print"), null, "gtk-print");
            Exit = new Gtk.Action ("Exit", Mono.Unix.Catalog.GetString ("Quit"), null, "gtk-quit");

            //			OpenRecent.Sensitive = false;
            Close.Sensitive = false;
            Print.Sensitive = false;
        }
开发者ID:sandyarmstrong,项目名称:Pinta,代码行数:27,代码来源:FileActions.cs

示例7: ViewActions

        public ViewActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.View.ActualSize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ActualSize.png")));
            fact.Add ("Menu.View.Grid.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Grid.png")));
            fact.Add ("Menu.View.Rulers.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Rulers.png")));
            fact.Add ("Menu.View.ZoomIn.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomIn.png")));
            fact.Add ("Menu.View.ZoomOut.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomOut.png")));
            fact.Add ("Menu.View.ZoomToSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToSelection.png")));
            fact.Add ("Menu.View.ZoomToWindow.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToWindow.png")));
            fact.AddDefault ();

            ZoomIn = new Gtk.Action ("ZoomIn", Catalog.GetString ("Zoom In"), null, Stock.ZoomIn);
            ZoomOut = new Gtk.Action ("ZoomOut", Catalog.GetString ("Zoom Out"), null, Stock.ZoomOut);
            ZoomToWindow = new Gtk.Action ("ZoomToWindow", Catalog.GetString ("Zoom to Window"), null, Stock.ZoomFit);
            ZoomToSelection = new Gtk.Action ("ZoomToSelection", Catalog.GetString ("Zoom to Selection"), null, "Menu.View.ZoomToSelection.png");
            ActualSize = new Gtk.Action ("ActualSize", Catalog.GetString ("Actual Size"), null, Stock.Zoom100);
            PixelGrid = new Gtk.ToggleAction ("PixelGrid", Catalog.GetString ("Pixel Grid"), null, "Menu.View.Grid.png");
            Rulers = new Gtk.ToggleAction ("Rulers", Catalog.GetString ("Rulers"), null, "Menu.View.Rulers.png");
            Pixels = new Gtk.Action ("Pixels", Catalog.GetString ("Pixels"), null, null);
            Inches = new Gtk.Action ("Inches", Catalog.GetString ("Inches"), null, null);
            Centimeters = new Gtk.Action ("Centimeters", Catalog.GetString ("Centimeters"), null, null);
            Fullscreen = new Gtk.Action ("Fullscreen", Catalog.GetString ("Fullscreen"), null, Stock.Fullscreen);

            ZoomComboBox = new ToolBarComboBox (75, 11, true, "3600%", "2400%", "1600%", "1200%", "800%", "700%", "600%", "500%", "400%", "300%", "200%", "100%", "66%", "50%", "33%", "25%", "16%", "12%", "8%", "5%", "Window");
            UnitComboBox = new ToolBarComboBox (100, 0, false, Catalog.GetString ("Pixels"), Catalog.GetString ("Inches"), Catalog.GetString ("Centimeters"));
        }
开发者ID:lucidfox,项目名称:Pinta,代码行数:27,代码来源:ViewActions.cs

示例8: EditActions

        public EditActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.Edit.Deselect.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.Deselect.png")));
            fact.Add ("Menu.Edit.EraseSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.EraseSelection.png")));
            fact.Add ("Menu.Edit.FillSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.FillSelection.png")));
            fact.Add ("Menu.Edit.InvertSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.InvertSelection.png")));
            fact.Add ("Menu.Edit.SelectAll.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.SelectAll.png")));
            fact.AddDefault ();

            Undo = new Gtk.Action ("Undo", Catalog.GetString ("Undo"), null, Stock.Undo);
            Redo = new Gtk.Action ("Redo", Catalog.GetString ("Redo"), null, Stock.Redo);
            Cut = new Gtk.Action ("Cut", Catalog.GetString ("Cut"), null, Stock.Cut);
            Copy = new Gtk.Action ("Copy", Catalog.GetString ("Copy"), null, Stock.Copy);
            Paste = new Gtk.Action ("Paste", Catalog.GetString ("Paste"), null, Stock.Paste);

                PasteSubmenu = new Gtk.Action("Paste into", Catalog.GetString("Paste into..."), null, Stock.Paste);
                PasteIntoNewImage = new Gtk.Action("PasteIntoNewImage", Catalog.GetString("New image"), null, Stock.New);
                PasteIntoNewLayer = new Gtk.Action("PasteIntoNewLayer", Catalog.GetString("New layer"), null, "Menu.Layers.AddNewLayer.png");

            EraseSelection = new Gtk.Action ("EraseSelection", Catalog.GetString ("Erase Selection"), null, "Menu.Edit.EraseSelection.png");
            FillSelection = new Gtk.Action ("FillSelection", Catalog.GetString ("Fill Selection"), null, "Menu.Edit.FillSelection.png");
            InvertSelection = new Gtk.Action ("InvertSelection", Catalog.GetString ("Invert Selection"), null, "Menu.Edit.InvertSelection.png");
            SelectAll = new Gtk.Action ("SelectAll", Catalog.GetString ("Select All"), null, Stock.SelectAll);
            Deselect = new Gtk.Action ("Deselect", Catalog.GetString ("Deselect"), null, "Menu.Edit.Deselect.png");

            Undo.IsImportant = true;
            Undo.Sensitive = false;
            Redo.Sensitive = false;
            InvertSelection.Sensitive = false;
            Deselect.Sensitive = false;
            EraseSelection.Sensitive = false;
            FillSelection.Sensitive = false;
        }
开发者ID:rikky,项目名称:Pinta,代码行数:34,代码来源:EditActions.cs

示例9: ViewActions

        public ViewActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.View.ActualSize.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ActualSize.png")));
            fact.Add ("Menu.View.Grid.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Grid.png")));
            fact.Add ("Menu.View.Rulers.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.Rulers.png")));
            fact.Add ("Menu.View.ZoomIn.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomIn.png")));
            fact.Add ("Menu.View.ZoomOut.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomOut.png")));
            fact.Add ("Menu.View.ZoomToSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToSelection.png")));
            fact.Add ("Menu.View.ZoomToWindow.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.View.ZoomToWindow.png")));
            fact.AddDefault ();

            ZoomIn = new Gtk.Action ("ZoomIn", Catalog.GetString ("Zoom In"), null, Stock.ZoomIn);
            ZoomOut = new Gtk.Action ("ZoomOut", Catalog.GetString ("Zoom Out"), null, Stock.ZoomOut);
            ZoomToWindow = new Gtk.Action ("ZoomToWindow", Catalog.GetString ("Best Fit"), null, Stock.ZoomFit);
            ZoomToSelection = new Gtk.Action ("ZoomToSelection", Catalog.GetString ("Zoom to Selection"), null, "Menu.View.ZoomToSelection.png");
            ActualSize = new Gtk.Action ("ActualSize", Catalog.GetString ("Normal Size"), null, Stock.Zoom100);
            ToolBar = new Gtk.ToggleAction ("Toolbar", Catalog.GetString ("Toolbar"), null, null);
            PixelGrid = new Gtk.ToggleAction ("PixelGrid", Catalog.GetString ("Pixel Grid"), null, "Menu.View.Grid.png");
            Rulers = new Gtk.ToggleAction ("Rulers", Catalog.GetString ("Rulers"), null, "Menu.View.Rulers.png");
            Pixels = new Gtk.RadioAction ("Pixels", Catalog.GetString ("Pixels"), null, null, 0);
            Inches = new Gtk.RadioAction ("Inches", Catalog.GetString ("Inches"), null, null, 1);
            Centimeters = new Gtk.RadioAction ("Centimeters", Catalog.GetString ("Centimeters"), null, null, 2);
            Fullscreen = new Gtk.Action ("Fullscreen", Catalog.GetString ("Fullscreen"), null, Stock.Fullscreen);

            ZoomCollection = new string[] { "3600%", "2400%", "1600%", "1200%", "800%", "700%", "600%", "500%", "400%", "300%", "200%", "175%", "150%", "125%", "100%", "66%", "50%", "33%", "25%", "16%", "12%", "8%", "5%", "Window" };
            ZoomComboBox = new ToolBarComboBox (75, DefaultZoomIndex(), true, ZoomCollection);

            // Make sure these are the same group so only one will be selected at a time
            Inches.Group = Pixels.Group;
            Centimeters.Group = Pixels.Group;
        }
开发者ID:manish,项目名称:Pinta,代码行数:32,代码来源:ViewActions.cs

示例10: EditActions

        public EditActions()
        {
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add ("Menu.Edit.Deselect.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.Deselect.png")));
            fact.Add ("Menu.Edit.EraseSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.EraseSelection.png")));
            fact.Add ("Menu.Edit.FillSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.FillSelection.png")));
            fact.Add ("Menu.Edit.InvertSelection.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.InvertSelection.png")));
            fact.Add ("Menu.Edit.SelectAll.png", new Gtk.IconSet (PintaCore.Resources.GetIcon ("Menu.Edit.SelectAll.png")));
            fact.AddDefault ();

            Undo = new Gtk.Action ("Undo", Mono.Unix.Catalog.GetString ("Undo"), null, "gtk-undo");
            Redo = new Gtk.Action ("Redo", Mono.Unix.Catalog.GetString ("Redo"), null, "gtk-redo");
            Cut = new Gtk.Action ("Cut", Mono.Unix.Catalog.GetString ("Cut"), null, "gtk-cut");
            Copy = new Gtk.Action ("Copy", Mono.Unix.Catalog.GetString ("Copy"), null, "gtk-copy");
            Paste = new Gtk.Action ("Paste", Mono.Unix.Catalog.GetString ("Paste"), null, "gtk-paste");
            PasteIntoNewLayer = new Gtk.Action ("PasteIntoNewLayer", Mono.Unix.Catalog.GetString ("Paste Into New Layer"), null, "gtk-paste");
            PasteIntoNewImage = new Gtk.Action ("PasteIntoNewImage", Mono.Unix.Catalog.GetString ("Paste Into New Image"), null, "gtk-paste");
            EraseSelection = new Gtk.Action ("EraseSelection", Mono.Unix.Catalog.GetString ("Erase Selection"), null, "Menu.Edit.EraseSelection.png");
            FillSelection = new Gtk.Action ("FillSelection", Mono.Unix.Catalog.GetString ("Fill Selection"), null, "Menu.Edit.FillSelection.png");
            InvertSelection = new Gtk.Action ("InvertSelection", Mono.Unix.Catalog.GetString ("Invert Selection"), null, "Menu.Edit.InvertSelection.png");
            SelectAll = new Gtk.Action ("SelectAll", Mono.Unix.Catalog.GetString ("Select All"), null, "Menu.Edit.SelectAll.png");
            Deselect = new Gtk.Action ("Deselect", Mono.Unix.Catalog.GetString ("Deselect"), null, "Menu.Edit.Deselect.png");

            Undo.Sensitive = false;
            Redo.Sensitive = false;
            PasteIntoNewImage.Sensitive = false;
            InvertSelection.Sensitive = false;
            Deselect.Sensitive = false;
        }
开发者ID:asbjornu,项目名称:Pinta,代码行数:29,代码来源:EditActions.cs

示例11: MainWindow

    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        UiManagerHelper uiManagerHelper = new UiManagerHelper(UIManager);

        ActionGroup actionGroup1 = new ActionGroup("pageActionGroup");
        Gtk.Action newAction = new Gtk.Action("newAction", null, null, Stock.New);
        actionGroup1.Add (newAction);
        Gtk.Action editAction = new Gtk.Action("editAction", null, null, Stock.Edit);
        actionGroup1.Add (editAction);

        ActionGroup actionGroup2 = new ActionGroup("pageActionGroup");
        Gtk.Action deleteAction = new Gtk.Action("deleteAction", null, null, Stock.Delete);
        actionGroup2.Add (deleteAction);

        ActionGroup currentActionGroup = actionGroup1;
        uiManagerHelper.SetActionGroup (currentActionGroup);

        executeAction.Activated += delegate {
            Console.WriteLine("executeAction.Activated");
            if (currentActionGroup == actionGroup1)
                currentActionGroup = actionGroup2;
            else
                currentActionGroup = actionGroup1;
            uiManagerHelper.SetActionGroup(currentActionGroup);
        };
    }
开发者ID:ruben206,项目名称:ad,代码行数:29,代码来源:MainWindow.cs

示例12: ArticuloListView

        public ArticuloListView()
        {
            string sql="select * from articulo";
             helper=new TreeViewHelper(treeView,sql);

            Gtk.Action editAction=new Gtk.Action("editAction",null,null, Stock.Edit);
            actionGroup.Add(editAction);

            Gtk.Action deleteAction=new Gtk.Action("deleteAction",null,null, Stock.Delete);
            actionGroup.Add(deleteAction);

            deleteAction.Activated+=delegate{
                executeNonQuery(string.Format("delete from articulo where id={0}",helper.Id));
            };

            Gtk.Action newAction=new Gtk.Action("newAction",null,null, Stock.New);
            actionGroup.Add(newAction);

            newAction.Activated+=delegate{

                executeNonQuery(string.Format("insert into articulo (nombre) values ('{0}')",DateTime.Now));
            };

            treeView.Selection.Changed += delegate {
                editAction.Sensitive=treeView.Selection.CountSelectedRows() >0;
                string id=getId();
                Console.WriteLine(id);
            };
        }
开发者ID:nerea123,项目名称:ad,代码行数:29,代码来源:ArticuloListView.cs

示例13: RegisterAdjustment

        /// <summary>
        /// Register a new adjustment with Pinta, causing it to be added to the Adjustments menu.
        /// </summary>
        /// <param name="adjustment">The adjustment to register</param>
        /// <returns>The action created for this adjustment</returns>
        public Gtk.Action RegisterAdjustment(BaseEffect adjustment)
        {
            // Add icon to IconFactory
            Gtk.IconFactory fact = new Gtk.IconFactory ();
            fact.Add (adjustment.Icon, new Gtk.IconSet (PintaCore.Resources.GetIcon (adjustment.Icon)));
            fact.AddDefault ();

            // Create a gtk action for each adjustment
            Gtk.Action act = new Gtk.Action (adjustment.GetType ().Name, adjustment.Name + (adjustment.IsConfigurable ? Catalog.GetString ("...") : ""), string.Empty, adjustment.Icon);
            act.Activated += delegate (object sender, EventArgs e) { PintaCore.LivePreview.Start (adjustment); };

            PintaCore.Actions.Adjustments.Actions.Add (act);

            // Create a menu item for each adjustment
            MenuItem menu_item;

            // If no key is specified, don't use an accelerated menu item
            if (adjustment.AdjustmentMenuKey == (Gdk.Key)0)
                menu_item = (MenuItem)act.CreateMenuItem ();
            else
                menu_item = act.CreateAcceleratedMenuItem (adjustment.AdjustmentMenuKey, adjustment.AdjustmentMenuKeyModifiers);

            ((Menu)((ImageMenuItem)PintaCore.Chrome.MainMenu.Children[5]).Submenu).AppendMenuItemSorted (menu_item);

            adjustments.Add (adjustment, act);
            adjustment_menuitems.Add (adjustment, menu_item);

            return act;
        }
开发者ID:robpvn,项目名称:Pinta,代码行数:34,代码来源:EffectsManager.cs

示例14: Window

        public Window(Inventory inventory)
            : this(new Builder("window.ui"))
        {
            Inventory = inventory;

            // load the menues and toolbars
            uiManager = new UIManager();

            // create the file actions
            Gtk.Action saveInventoryAction = new Gtk.Action("saveFile","Save","Save the active inventory",Stock.Save);
            saveInventoryAction.Activated += OnSaveInventory;
            Gtk.Action printLabelsAction = new Gtk.Action("printLabels","Print Labels","Print labels for items.",Stock.Print);
            printLabelsAction.Activated += OnPrintLabels;
            Gtk.Action quitAction = new Gtk.Action("quit","Quit","Quit the application",Stock.Quit);
            quitAction.Activated += OnQuit;
            Gtk.Action fileAction = new Gtk.Action("file","File");
            ActionGroup fileActionGroup = new ActionGroup("file");
            fileActionGroup.Add(saveInventoryAction);
            fileActionGroup.Add(printLabelsAction);
            fileActionGroup.Add(quitAction);
            fileActionGroup.Add(fileAction);
            uiManager.InsertActionGroup(fileActionGroup,0);

            // create items box
            itemsBox = new ItemsBox(inventory.Items, uiManager);
            itemsBox.DrawDescriptionEntry += OnDrawDescriptionEntry;
            itemsBox.ShowMe += OnShowItemsBox;
            itemsAlign.Add(itemsBox);

            // create locations box
            locationsBox = new LocationsBox(inventory.Locations, uiManager);
            locationsBox.DrawDescriptionEntry += OnDrawDescriptionEntry;
            locationsBox.ShowMe += OnShowLocationsBox;
            locationsBox.GotoItem += OnGotoLocationsItem;
            locationsAlign.Add(locationsBox);

            // create tags box
            tagsBox = new TagsBox(inventory.Tags, uiManager);
            tagsBox.ShowMe += OnShowTagsBox;
            tagsAlign.Add(tagsBox);

            // create tool and menubar
            uiManager.AddUiFromResource("window_menues.xml");
            menuBar = (MenuBar) uiManager.GetWidget("/menuBar");
            toolbar = (Toolbar) uiManager.GetWidget("/toolbar");
            toolbar.IconSize = IconSize.LargeToolbar;
            toolbar.ToolbarStyle = ToolbarStyle.Both;

            mainBox.PackStart(menuBar,false,true,0);
            mainBox.PackStart(toolbar,false,true,0);

            // laod category icons
            itemsTabImage.Pixbuf = ((GtkSettings)Inventory.Settings).ItemsTabIcon;
            locationsTabImage.Pixbuf = ((GtkSettings)Inventory.Settings).LocationsTabIcon;
            tagsTabImage.Pixbuf = ((GtkSettings)Inventory.Settings).TagsTabIcon;

            this.Icon = ((GtkSettings)Inventory.Settings).WindowIcon;
            this.Resize(((GtkSettings)Inventory.Settings).MainWindowWidth,((GtkSettings)Inventory.Settings).MainWindowHeight);
        }
开发者ID:konne88,项目名称:MyInventory,代码行数:59,代码来源:Window.cs

示例15: WindowActions

        public WindowActions()
        {
            SaveAll = new Gtk.Action ("SaveAll", Catalog.GetString ("Save All"), null, Stock.Save);
            CloseAll = new Gtk.Action ("CloseAll", Catalog.GetString ("Close All"), null, Stock.Close);

            OpenWindows = new List<RadioAction> ();
            action_menu_items = new Dictionary<RadioAction,CheckMenuItem> ();
        }
开发者ID:RudoCris,项目名称:Pinta,代码行数:8,代码来源:WindowActions.cs


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