Пример #1
0
        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.Behavior |= DockItemBehavior.CantClose;

            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(); };
        }
Пример #2
0
        private void CreateExperimentControlToolbar()
        {
            DockItemToolbar toolbar             = m_experimentPad.GetToolbar(PositionType.Top);
            Button          runExperimentButton = new Button(new Gtk.Image(Gdk.Pixbuf.LoadFromResource("TraceLab.UI.GTK.Resources.Icon_Play16.png")));

            runExperimentButton.Clicked    += new EventHandler(OnRunExperimentButtonClick);
            runExperimentButton.TooltipText = "Run Experiment";
            toolbar.Add(runExperimentButton);

            Button stopExperimentButton = new Button(new Gtk.Image(Gdk.Pixbuf.LoadFromResource("TraceLab.UI.GTK.Resources.Stop.png")));

            stopExperimentButton.Clicked    += new EventHandler(OnStopExperimentButtonClick);
            stopExperimentButton.TooltipText = "Stop experiment after all currently running components have finished processing";
            toolbar.Add(stopExperimentButton);

            Button defineCompositeComponentButton = new Button(new Gtk.Image(Gdk.Pixbuf.LoadFromResource("TraceLab.UI.GTK.Resources.DefineCompositeComponent.png")));

            defineCompositeComponentButton.Clicked    += new EventHandler(OnDefineCompositeComponentButtonClick);
            defineCompositeComponentButton.TooltipText = "Define composite component from selected nodes";
            toolbar.Add(defineCompositeComponentButton);

            Button packageExperimentButton = new Button(new Gtk.Image(Gdk.Pixbuf.LoadFromResource("TraceLab.UI.GTK.Resources.Icon_PkgCreate16.png")));

            packageExperimentButton.Clicked    += OnPackageExperimentButtonClicked;
            packageExperimentButton.TooltipText = "Build package from experiment";
            toolbar.Add(packageExperimentButton);

            Button aboutExperimentButton = new Button(new Gtk.Image(Gdk.Pixbuf.LoadFromResource("TraceLab.UI.GTK.Resources.Icon_Info16.png")));

            aboutExperimentButton.Clicked    += new EventHandler(OnAboutExperimentButtonClick);
            aboutExperimentButton.TooltipText = "About Experiment";
            toolbar.Add(aboutExperimentButton);

            toolbar.ShowAll();
        }
Пример #3
0
        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;
        }
Пример #4
0
        /// <summary>
        /// Initialize the window pad in the given dock frame.
        /// </summary>
        /// <param name='dockFrame'>
        /// Dock frame.
        /// </param>
        public void Initialize(DockFrame dockFrame)
        {
            m_dockFrame = dockFrame;
            DockItem outputDockingWindow = m_dockFrame.AddItem("Output");

            outputDockingWindow.Label           = Catalog.GetString("Output");
            outputDockingWindow.DefaultHeight   = 100;
            outputDockingWindow.DefaultLocation = "ExperimentPad/Bottom"; //or experiment
            outputDockingWindow.Behavior       |= DockItemBehavior.CantClose;

            DockItemToolbar toolbar = outputDockingWindow.GetToolbar(PositionType.Top);

            m_buttonClear          = new Button(new Gtk.Image("gtk-clear", IconSize.Menu));
            m_buttonClear.Clicked += new EventHandler(OnButtonClearClick);
            toolbar.Add(m_buttonClear);

            toolbar.ShowAll();

            outputDockingWindow.Content = CreateOutputView();

            LoadIcons();

            m_initialized = true;
        }
Пример #5
0
    void CreateComponents()
    {
        fullViewVBox = new VBox(false, 0);
        rootWidget   = fullViewVBox;

        CreateMenuBar();

        CreateToolBar();

        // Create the docking widget and add it to the window.
        dock                   = new DockFrame();
        dock.Homogeneous       = false;
        dock.DefaultItemHeight = 100;
        dock.DefaultItemWidth  = 100;
        //dock.CompactGuiLevel = 1;

        toolbarFrame.AddContent(dock);

        // Create the notebook for the various documents.
        tabControl            = new DragNotebook(); //(dock.ShadedContainer);
        tabControl.Scrollable = true;
        tabControl.AppendPage(new Label("Other page"), new Label("Favorite Page  "));
        tabControl.AppendPage(new Label("What page"), new Label("Welcome/Start Page  "));
        tabControl.AppendPage(new TextView(), new Image("gtk-new", IconSize.Menu));
        tabControl.ShowAll();

        // The main document area
        documentDockItem                 = dock.AddItem("Documents");
        documentDockItem.Behavior        = DockItemBehavior.Locked;
        documentDockItem.Status          = DockItemStatus.AutoHide;
        documentDockItem.DefaultHeight   = 100;
        documentDockItem.DefaultWidth    = 100;
        documentDockItem.DefaultStatus   = DockItemStatus.AutoHide;
        documentDockItem.DefaultLocation = "Document/Right";
        documentDockItem.Expand          = true;
        documentDockItem.DrawFrame       = true;
        documentDockItem.Label           = "Documents";
        documentDockItem.Content         = tabControl;
        documentDockItem.DefaultVisible  = true;
        documentDockItem.Visible         = true;


        DockItem dit = dock.AddItem("left");

        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "left";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Left";
        dit.DefaultVisible  = true;
        dit.Visible         = true;
        DockItemToolbar tb = dit.GetToolbar(PositionType.Top);
        ToolButton      b  = new ToolButton(null, "Hello");

        tb.Add(b, false);
        tb.Visible = true;
        tb.ShowAll();

        dit                 = dock.AddItem("right");
        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Right";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Right";
        dit.DefaultVisible  = true;
        dit.Visible         = true;
        //dit.Icon = Gdk.Pixbuf.LoadFromResource("Cage.Shell.Docking.stock-close-12.png");

        dit                 = dock.AddItem("top");
        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Top";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Top";
        dit.DefaultVisible  = true;
        dit.Visible         = true;

        dit                 = dock.AddItem("bottom");
        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Bottom";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Bottom";
        dit.DefaultVisible  = true;
        dit.Visible         = true;



        if (File.Exists("toolbar.status"))
        {
            toolbarFrame.LoadStatus("toolbar.status");
        }

        if (File.Exists("config.layout"))
        {
            dock.LoadLayouts("config.layout");
        }
        else
        {
            dock.CreateLayout("test", true);
        }


        dock.CurrentLayout = "test";
        dock.HandlePadding = 0;
        dock.HandleSize    = 10;

        dock.SaveLayouts("config.layout");
        toolbarFrame.SaveStatus("toolbar.status");

        Add(fullViewVBox);
        fullViewVBox.ShowAll();

        statusBar = new Gtk.Statusbar();
        fullViewVBox.PackEnd(statusBar, false, true, 0);
    }