Example #1
0
        /// <summary>
        /// Creates the dock frame and pads.
        /// </summary>
        /// <param name='container'>
        /// Container.
        /// </param>
        private void CreateDockAndPads(HBox container)
        {
            var componentsLibraryPad = new ComponentsLibraryPad();
            var workspaceWindowPad   = new WorkspaceWindowPad();
            var experimentCanvasPad  = new ExperimentCanvasPad(m_applicationContext);
            var outputWindowPad      = new OutputWindowPad();

            IDockPad[] pads = new IDockPad[]
            {
                componentsLibraryPad,
                workspaceWindowPad,
                experimentCanvasPad,
                outputWindowPad
            };

            foreach (IDockPad pad in pads)
            {
                pad.Initialize(m_dockFrame);
            }

            this.ApplicationPads      = pads;
            this.ComponentsLibraryPad = componentsLibraryPad;
            this.WorkspaceWindowPad   = workspaceWindowPad;
            this.ExperimentCanvasPad  = experimentCanvasPad;
            this.OutputWindowPad      = outputWindowPad;

            container.PackStart(m_dockFrame, true, true, 0);

            //TODO: save last layout - see how Pinta has done it
//            string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory(), "layouts.xml");
//
//            if (System.IO.File.Exists(layout_file))
//            {
//                try
//                {
//                    dock.LoadLayouts(layout_file);
//                }
//                // If parsing layouts.xml fails for some reason, proceed to create the default layout.
//                catch (Exception e)
//                {
//                    System.Console.Error.WriteLine ("Error reading layouts.xml: " + e.ToString());
//                }
//            }

            if (!m_dockFrame.HasLayout("Default"))
            {
                m_dockFrame.CreateLayout("Default", false);
            }

            m_dockFrame.CurrentLayout = "Default";
        }
Example #2
0
        private void CreateDockAndPads(HBox container)
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("Tools.Pencil.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Tools.Pencil.png")));
            fact.Add("Pinta.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Pinta.png")));
            fact.AddDefault();

            // Dock widget
            dock = new DockFrame();
            dock.CompactGuiLevel = 5;

            // Toolbox pad
            var toolboxpad = new ToolBoxPad();

            toolboxpad.Initialize(dock, show_pad);

            // Palette pad
            var palettepad = new ColorPalettePad();

            palettepad.Initialize(dock, show_pad);

            // Canvas pad
            canvas_pad = new CanvasPad();
            canvas_pad.Initialize(dock, show_pad);

            sw = canvas_pad.ScrolledWindow;

            // Layer pad
            var layers_pad = new LayersPad();

            layers_pad.Initialize(dock, show_pad);

            // Open Images pad
            var open_images_pad = new OpenImagesPad();

            open_images_pad.Initialize(dock, show_pad);

            // History pad
            var history_pad = new HistoryPad();

            history_pad.Initialize(dock, show_pad);

            container.PackStart(dock, true, true, 0);

            string layout_file = System.IO.Path.Combine(PintaCore.Settings.GetUserSettingsDirectory(), "layouts.xml");

            if (System.IO.File.Exists(layout_file))
            {
                try
                {
                    dock.LoadLayouts(layout_file);
                }
                // If parsing layouts.xml fails for some reason, proceed to create the default layout.
                catch (Exception e)
                {
                    System.Console.Error.WriteLine("Error reading layouts.xml: " + e.ToString());
                }
            }

            if (!dock.HasLayout("Default"))
            {
                dock.CreateLayout("Default", false);
            }

            dock.CurrentLayout = "Default";
        }
Example #3
0
        private void CreateDockAndPads(HBox container)
        {
            Gtk.IconFactory fact = new Gtk.IconFactory();
            fact.Add("Tools.Pencil.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Tools.Pencil.png")));
            fact.Add("Pinta.png", new Gtk.IconSet(PintaCore.Resources.GetIcon("Pinta.png")));
            fact.AddDefault();

            // Dock widget
            dock = new DockFrame();
            dock.CompactGuiLevel = 5;

            var style = new DockVisualStyle();

            style.PadTitleLabelColor         = Styles.PadLabelColor;
            style.PadBackgroundColor         = Styles.PadBackground;
            style.InactivePadBackgroundColor = Styles.InactivePadBackground;
            style.TabStyle          = DockTabStyle.Normal;
            style.ShowPadTitleIcon  = false;
            dock.DefaultVisualStyle = style;

            // Toolbox pad
            var toolboxpad = new ToolBoxPad();

            toolboxpad.Initialize(dock, show_pad);

            // Palette pad
            var palettepad = new ColorPalettePad();

            palettepad.Initialize(dock, show_pad);

            // Canvas pad
            canvas_pad = new CanvasPad();
            canvas_pad.Initialize(dock, show_pad);

            dock_container = canvas_pad.NotebookContainer;

            // Layer pad
            var layers_pad = new LayersPad();

            layers_pad.Initialize(dock, show_pad);

            // Open Images pad
            var open_images_pad = new OpenImagesPad();

            open_images_pad.Initialize(dock, show_pad);

            // History pad
            var history_pad = new HistoryPad();

            history_pad.Initialize(dock, show_pad);

            container.PackStart(dock, true, true, 0);

            string layout_file = PintaCore.Settings.LayoutFilePath;

            if (System.IO.File.Exists(layout_file))
            {
                try
                {
                    dock.LoadLayouts(layout_file);
                }
                // If parsing layouts.xml fails for some reason, proceed to create the default layout.
                catch (Exception e)
                {
                    System.Console.Error.WriteLine("Error reading " + PintaCore.Settings.LayoutFile + ": " + e.ToString());
                }
            }

            if (!dock.HasLayout("Default"))
            {
                dock.CreateLayout("Default", false);
            }

            dock.CurrentLayout = "Default";
        }