Exemple #1
0
        private void CreatePanels(WindowShell shell)
        {
            HBox panel_container = shell.CreateWorkspace();

            CreateDockAndPads(panel_container);
            panel_container.ShowAll();
        }
Exemple #2
0
        private void CreateToolToolBar(WindowShell shell)
        {
            var tool_toolbar = window_shell.CreateToolToolBar(delegate(object o, EventArgs e) {
                Logger.Log("\"Commands\" button pressed");
                if (!cmd_map.Visible)
                {
                    cmd_map.On(false);
                }
                else
                {
                    cmd_map.Off(true);
                }
            });

            tool_toolbar.ToolbarStyle = ToolbarStyle.Icons;
            tool_toolbar.IconSize     = IconSize.SmallToolbar;

            if (PintaCore.System.OperatingSystem == OS.Windows)
            {
                tool_toolbar.HeightRequest = 28;
            }
            else
            {
                tool_toolbar.HeightRequest = 32;
            }

            PintaCore.Chrome.InitializeToolToolBar(tool_toolbar);
        }
Exemple #3
0
        private void CreateMainMenu(WindowShell shell)
        {
            var main_menu = window_shell.CreateMainMenu("main_menu");

            main_menu.Append(new Gtk.Action("file", Catalog.GetString("_File")).CreateMenuItem());
            main_menu.Append(new Gtk.Action("edit", Catalog.GetString("_Edit")).CreateMenuItem());

            MenuItem view_menu = (MenuItem) new Gtk.Action("view", Catalog.GetString("_View")).CreateMenuItem();

            main_menu.Append(view_menu);

            main_menu.Append(new Gtk.Action("image", Catalog.GetString("_Image")).CreateMenuItem());
            main_menu.Append(new Gtk.Action("layers", Catalog.GetString("_Layers")).CreateMenuItem());
            main_menu.Append(new Gtk.Action("adjustments", Catalog.GetString("_Adjustments")).CreateMenuItem());
            main_menu.Append(new Gtk.Action("effects", Catalog.GetString("Effe_cts")).CreateMenuItem());
            main_menu.Append(new Gtk.Action("addins", Catalog.GetString("A_dd-ins")).CreateMenuItem());

            MenuItem window_menu = (MenuItem) new Gtk.Action("window", Catalog.GetString("_Window")).CreateMenuItem();

            window_menu.Submenu = new Menu();
            main_menu.Append(window_menu);

            Gtk.Action pads = new Gtk.Action("pads", Mono.Unix.Catalog.GetString("Tool Windows"), null, null);
            view_menu.Submenu = new Menu();
            show_pad          = (Menu)((Menu)(view_menu.Submenu)).AppendItem(pads.CreateSubMenuItem()).Submenu;

            main_menu.Append(new Gtk.Action("help", Catalog.GetString("_Help")).CreateMenuItem());

            PintaCore.Actions.CreateMainMenu(main_menu);

            if (PintaCore.System.OperatingSystem == OS.Mac)
            {
                try {
                    //enable the global key handler for keyboard shortcuts
                    IgeMacMenu.GlobalKeyHandlerEnabled = true;

                    //Tell the IGE library to use your GTK menu as the Mac main menu
                    IgeMacMenu.MenuBar = main_menu;

                    //tell IGE which menu item should be used for the app menu's quit item
                    IgeMacMenu.QuitMenuItem = (MenuItem)PintaCore.Actions.File.Exit.CreateMenuItem();

                    //add a new group to the app menu, and add some items to it
                    var      appGroup  = IgeMacMenu.AddAppMenuGroup();
                    MenuItem aboutItem = (MenuItem)PintaCore.Actions.Help.About.CreateMenuItem();
                    appGroup.AddMenuItem(aboutItem, Catalog.GetString("About"));

                    main_menu.Hide();
                } catch {
                    // If things don't work out, just use a normal menu.
                }
            }

            PintaCore.Chrome.InitializeMainMenu(main_menu);
        }
Exemple #4
0
        private void CreateMainToolBar(WindowShell shell)
        {
            var main_toolbar = window_shell.CreateToolBar("main_toolbar");

            if (PintaCore.System.OperatingSystem == OS.Windows)
            {
                main_toolbar.ToolbarStyle = ToolbarStyle.Icons;
                main_toolbar.IconSize     = IconSize.SmallToolbar;
            }

            PintaCore.Actions.CreateToolBar(main_toolbar);

            PintaCore.Chrome.InitializeMainToolBar(main_toolbar);
        }
Exemple #5
0
        private void CreateToolToolBar(WindowShell shell)
        {
            var tool_toolbar = window_shell.CreateToolBar("tool_toolbar");

            tool_toolbar.ToolbarStyle = ToolbarStyle.Icons;
            tool_toolbar.IconSize     = IconSize.SmallToolbar;

            if (PintaCore.System.OperatingSystem == OS.Windows)
            {
                tool_toolbar.HeightRequest = 28;
            }
            else
            {
                tool_toolbar.HeightRequest = 32;
            }

            PintaCore.Chrome.InitializeToolToolBar(tool_toolbar);
        }
Exemple #6
0
        private void CreateWindow()
        {
            // Check for stored window settings
            var width    = PintaCore.Settings.GetSetting <int> ("window-size-width", 1100);
            var height   = PintaCore.Settings.GetSetting <int> ("window-size-height", 750);
            var maximize = PintaCore.Settings.GetSetting <bool> ("window-maximized", false);

            window_shell = new WindowShell("Pinta.GenericWindow", "Pinta", width, height, maximize);

            CreateMainMenu(window_shell);
            CreateMainToolBar(window_shell);
            CreateToolToolBar(window_shell);

            CreatePanels(window_shell);

            window_shell.ShowAll();

            PintaCore.Chrome.InitializeWindowShell(window_shell);
        }
Exemple #7
0
        private void CreateWindow()
        {
            // Check for stored window settings
            var width = PintaCore.Settings.GetSetting<int> ("window-size-width", 1100);
            var height = PintaCore.Settings.GetSetting<int> ("window-size-height", 750);
            var maximize = PintaCore.Settings.GetSetting<bool> ("window-maximized", false);

            window_shell = new WindowShell ("Pinta.GenericWindow", "Pinta", width, height, maximize);

            CreateMainMenu (window_shell);
            CreateMainToolBar (window_shell);
            CreateToolToolBar (window_shell);

            CreatePanels (window_shell);

            window_shell.ShowAll ();

            PintaCore.Chrome.InitializeWindowShell (window_shell);
        }
Exemple #8
0
        private void CreateToolToolBar(WindowShell shell)
        {
            var tool_toolbar = window_shell.CreateToolToolBar(delegate(object o, EventArgs e) {
                Logger.Log("\"Commands\" button pressed");
                if (!cmd_map.Visible) {
                    cmd_map.On(false);
                } else {
                    cmd_map.Off(true);
                }
            });

            tool_toolbar.ToolbarStyle = ToolbarStyle.Icons;
            tool_toolbar.IconSize = IconSize.SmallToolbar;

            if (PintaCore.System.OperatingSystem == OS.Windows)
                tool_toolbar.HeightRequest = 28;
            else
                tool_toolbar.HeightRequest = 32;

            PintaCore.Chrome.InitializeToolToolBar (tool_toolbar);
        }
Exemple #9
0
        private void CreatePanels(WindowShell shell)
        {
            HBox panel_container = shell.CreateWorkspace ();

            CreateDockAndPads (panel_container);
            panel_container.ShowAll ();
        }
Exemple #10
0
        private void CreateMainToolBar(WindowShell shell)
        {
            var main_toolbar = window_shell.CreateToolBar ("main_toolbar");

            if (PintaCore.System.OperatingSystem == OS.Windows) {
                main_toolbar.ToolbarStyle = ToolbarStyle.Icons;
                main_toolbar.IconSize = IconSize.SmallToolbar;
            }

            PintaCore.Actions.CreateToolBar (main_toolbar);

            PintaCore.Chrome.InitializeMainToolBar (main_toolbar);
        }
Exemple #11
0
        private void CreateMainMenu(WindowShell shell)
        {
            var main_menu = window_shell.CreateMainMenu ("main_menu");

            main_menu.Append (new Gtk.Action ("file", Catalog.GetString ("_File")).CreateMenuItem ());
            main_menu.Append (new Gtk.Action ("edit", Catalog.GetString ("_Edit")).CreateMenuItem ());

            MenuItem view_menu = (MenuItem)new Gtk.Action ("view", Catalog.GetString ("_View")).CreateMenuItem ();
            main_menu.Append (view_menu);

            main_menu.Append (new Gtk.Action ("image", Catalog.GetString ("_Image")).CreateMenuItem ());
            main_menu.Append (new Gtk.Action ("layers", Catalog.GetString ("_Layers")).CreateMenuItem ());
            main_menu.Append (new Gtk.Action ("adjustments", Catalog.GetString ("_Adjustments")).CreateMenuItem ());
            main_menu.Append (new Gtk.Action ("effects", Catalog.GetString ("Effe_cts")).CreateMenuItem ());
            main_menu.Append (new Gtk.Action ("addins", Catalog.GetString ("A_dd-ins")).CreateMenuItem ());

            MenuItem window_menu = (MenuItem)new Gtk.Action ("window", Catalog.GetString ("_Window")).CreateMenuItem ();
            window_menu.Submenu = new Menu ();
            main_menu.Append (window_menu);

            Gtk.Action pads = new Gtk.Action ("pads", Mono.Unix.Catalog.GetString ("Tool Windows"), null, null);
            view_menu.Submenu = new Menu ();
            show_pad = (Menu)((Menu)(view_menu.Submenu)).AppendItem (pads.CreateSubMenuItem ()).Submenu;

            main_menu.Append (new Gtk.Action ("help", Catalog.GetString ("_Help")).CreateMenuItem ());

            PintaCore.Actions.CreateMainMenu (main_menu);

            if (PintaCore.System.OperatingSystem == OS.Mac) {
                try {
                    //enable the global key handler for keyboard shortcuts
                    IgeMacMenu.GlobalKeyHandlerEnabled = true;

                    //Tell the IGE library to use your GTK menu as the Mac main menu
                    IgeMacMenu.MenuBar = main_menu;

                    //tell IGE which menu item should be used for the app menu's quit item
                    IgeMacMenu.QuitMenuItem = (MenuItem)PintaCore.Actions.File.Exit.CreateMenuItem ();

                    //add a new group to the app menu, and add some items to it
                    var appGroup = IgeMacMenu.AddAppMenuGroup ();
                    MenuItem aboutItem = (MenuItem)PintaCore.Actions.Help.About.CreateMenuItem ();
                    appGroup.AddMenuItem (aboutItem, Catalog.GetString ("About"));

                    main_menu.Hide ();
                } catch {
                    // If things don't work out, just use a normal menu.
                }
            }

            PintaCore.Chrome.InitializeMainMenu (main_menu);
        }
Exemple #12
0
        private void CreateToolToolBar(WindowShell shell)
        {
            var tool_toolbar = window_shell.CreateToolBar ("tool_toolbar");

            tool_toolbar.ToolbarStyle = ToolbarStyle.Icons;
            tool_toolbar.IconSize = IconSize.SmallToolbar;

            if (PintaCore.System.OperatingSystem == OS.Windows)
                tool_toolbar.HeightRequest = 28;
            else
                tool_toolbar.HeightRequest = 32;

            PintaCore.Chrome.InitializeToolToolBar (tool_toolbar);
        }