예제 #1
0
        public override void OnDocked(DockObject requestor, DockPlacement position, object data)
        {
            if (Child == null)
            {
                return;
            }

            Paned paned = (Paned)Child;
            bool  done  = false;

            /* see if we can dock the item in our paned */
            switch (Orientation)
            {
            case Orientation.Horizontal:
                if (paned.Child1 == null && position == DockPlacement.Left)
                {
                    paned.Pack1(requestor, false, false);
                    done = true;
                }
                else if (paned.Child2 == null && position == DockPlacement.Right)
                {
                    paned.Pack2(requestor, true, true);
                    done = true;
                }
                break;

            case Orientation.Vertical:
                if (paned.Child1 == null && position == DockPlacement.Top)
                {
                    paned.Pack1(requestor, true, true);
                    done = true;
                }
                else if (paned.Child2 == null && position == DockPlacement.Bottom)
                {
                    paned.Pack2(requestor, false, false);
                    done = true;
                }
                break;
            }

            if (!done)
            {
                /* this will create another paned and reparent us there */
                base.OnDocked(requestor, position, data);
            }
            else
            {
                ((DockItem)requestor).ShowGrip();
                requestor.DockObjectFlags |= DockObjectFlags.Attached;
            }
        }
예제 #2
0
        private void BuildLibrary()
        {
            var box = new HeaderBox()
            {
                Title = Catalog.GetString("Library")
            };

            // Build the Library Header
            var header = new HBox()
            {
                Spacing     = 5,
                BorderWidth = 5
            };

            var app_button = new Button(new Image()
            {
                IconSize = (int)IconSize.LargeToolbar,
                IconName = "media-player-banshee"
            })
            {
                TooltipText = Catalog.GetString("Launch the Banshee Media Player")
            };

            app_button.Clicked += (o, e) => {
                ServiceManager.SourceManager.SetActiveSource(ServiceManager.SourceManager.MusicLibrary);
                ServiceManager.Get <MediaPanelService> ().PresentPrimaryInterface();
            };

            header.PackStart(source_combo_box = new SourceComboBox(), false, false, 0);
            header.PackStart(app_button, false, false, 0);
            header.PackStart(search_entry = new SearchEntry(), true, true, 0);
            box.PackStartHighlighted(header, false, false, 0, HeaderBox.HighlightFlags.Background);

            // Build the Library Views
            var pane = new Paned(Orientation.Horizontal);

            pane.Pack1(SetupView(artist_view = new ArtistListView()
            {
                Name                 = "media-panel-artists",
                WidthRequest         = 150,
                DoNotRenderNullModel = true
            }), false, false);
            pane.Pack2(SetupView(album_view = new AlbumListView()
            {
                Name = "media-panel-albums",
                DoNotRenderNullModel = true
            }), true, true);
            box.PackStart(pane, true, true, 0);
            box.Hexpand = box.Vexpand = true;
            box.Halign  = box.Valign = Align.Fill;

            Attach(box, 0, 0, 1, 1);
        }
예제 #3
0
        public void AddItem(DockItem item, DockPlacement placement)
        {
            switch (placement)
            {
            case DockPlacement.Center:
                pane.Pack1(item, resize: true, shrink: false);
                break;

            case DockPlacement.Right:
                right_panel.AddItem(item);
                break;
            }
        }
예제 #4
0
        private void UpdateContent1()
        {
            if (_paned != null)
            {
                var content1 = Element.Content1;

                if (content1 != null)
                {
                    var nativeContent1 = Platform.CreateRenderer(content1);
                    _paned.Pack1(nativeContent1.Container, true, true);
                }
            }
        }
예제 #5
0
        /// <summary>
        /// Creates a LinearAfterThresholdView instance.
        /// </summary>
        /// <param name="owner">Owner view.</param>
        public LinearAfterThresholdView(ViewBase owner) : base(owner)
        {
            properties = new PropertyView(this);
            graph      = new GraphView(this);

            panel = new Paned(Orientation.Vertical);

            panel.Pack1(properties.MainWidget, false, false);
            panel.Pack2(graph.MainWidget, true, false);
            panel.Destroyed += OnDestroyed;
            mainWidget       = panel;
            mainWidget.ShowAll();
        }
        private void Layout(bool top)
        {
            //Hyena.Log.Information ("ListBrowser LayoutLeft");
            Reset();

            SchemaEntry <int> current_entry = top ? pane_top_position : pane_left_position;

            container = GetPane(!top);
            Paned filter_box = GetPane(top);

            filter_box.PositionSet = true;
            Paned current_pane = filter_box;

            for (int i = 0; i < filter_scrolled_windows.Count; i++)
            {
                ScrolledWindow window           = filter_scrolled_windows[i];
                bool           last_even_filter = (i == filter_scrolled_windows.Count - 1 && filter_scrolled_windows.Count % 2 == 0);
                if (i > 0 && !last_even_filter)
                {
                    Paned new_pane = GetPane(top);
                    current_pane.Pack2(new_pane, true, false);
                    current_pane.Position = top ? 180 : 350;
                    PersistentPaneController.Control(current_pane, ControllerName(top, i));
                    current_pane = new_pane;
                }

                if (last_even_filter)
                {
                    current_pane.Pack2(window, true, false);
                    current_pane.Position = top ? 180 : 350;
                    PersistentPaneController.Control(current_pane, ControllerName(top, i));
                }
                else
                {
                    current_pane.Pack1(window, false, false);
                }
            }

            container.Pack1(filter_box, false, false);
            container.Pack2(main_scrolled_window, true, false);
            browser_container = filter_box;

            if (current_entry.Equals(SchemaEntry <int> .Zero))
            {
                throw new InvalidOperationException(String.Format("No SchemaEntry found for {0} position of {1}",
                                                                  top ? "top" : "left", this.GetType().FullName));
            }
            container.Position = current_entry.DefaultValue;
            PersistentPaneController.Control(container, current_entry);
            ShowPack();
        }
예제 #7
0
        private void Layout()
        {
            //Hyena.Log.Information ("ListBrowser LayoutLeft");
            Reset();

            container = new HPaned();
            Paned filter_box = new HPaned();

            filter_box.PositionSet = true;
            Paned current_pane = filter_box;

            for (int i = 0; i < filter_scrolled_windows.Count; i++)
            {
                ScrolledWindow window           = filter_scrolled_windows[i];
                bool           last_even_filter = (i == filter_scrolled_windows.Count - 1 && filter_scrolled_windows.Count % 2 == 0);
                if (i > 0 && !last_even_filter)
                {
                    Paned new_pane = new HPaned();
                    current_pane.Pack2(new_pane, true, false);
                    current_pane.Position = 350;
                    PersistentPaneController.Control(current_pane, ControllerName(i));
                    current_pane = new_pane;
                }

                if (last_even_filter)
                {
                    current_pane.Pack2(window, true, false);
                    current_pane.Position = 350;
                    PersistentPaneController.Control(current_pane, ControllerName(i));
                }
                else
                {
                    /*if (i == 0)
                     *  current_pane.Pack1 (window, false, false);
                     * else*/
                    current_pane.Pack1(window, true, false);
                }
            }

            container.Pack1(filter_box, true, false);
            container.Pack2(main_scrolled_window, true, false);
            browser_container = filter_box;

            container.Position = 275;
            PersistentPaneController.Control(container, ControllerName(-1));
            ShowPack();
        }
        /// <summary>
        /// Create the contents of the source contents in the desired layout.
        /// </summary>
        /// <param name="top">
        /// A <see cref="System.Boolean"/> -- whether to create a LayoutTop (true) or a LayoutLeft (false)
        /// </param>
        private void Layout(bool top)
        {
            Reset();

            container                  = GetPane(!top);
            filter_box                 = new LiveRadioFilterView();
            filter_box.Sensitive       = false;
            filter_box.GenreSelected  += OnViewGenreSelected;
            filter_box.GenreActivated += OnViewGenreSelected;
            filter_box.QuerySent      += OnViewQuerySent;

            container.Pack1(filter_box, false, false);
            container.Pack2(main_scrolled_window, true, false);
            browser_container = filter_box;

            container.Position = top ? 175 : 275;
            ShowPack();
        }
예제 #9
0
        private void Layout()
        {
            Reset();

            container = new VPaned();

            frame = new Hyena.Widgets.RoundedFrame();
            frame.SetFillColor(new Cairo.Color(0, 0, 0));
            frame.DrawBorder = false;
            frame.Add(filter_view);
            filter_view.Show();
            frame.Show();

            container.Pack1(frame, false, false);
            main_expander.Activated     += OnExpander;
            main_expander.SizeRequested += HandleSizeRequested;
            container.Pack2(main_expander, true, false);

            container.Position = 175;
            PersistentPaneController.Control(container, ControllerName(-1));

            ShowPack();
        }
예제 #10
0
        public BubbleChartView(ViewBase owner = null) : base(owner)
        {
            vpaned1               = new VPaned();
            mainWidget            = vpaned1;
            mainWidget.Destroyed += OnDestroyed;

            graphView = new DirectedGraphView(this);
            vpaned1.Pack1(graphView.MainWidget, true, true);

            VBox vbox1 = new VBox(false, 0);

            ctxBox = new VBox(false, 0);

            // Arc selection: rules & actions
            VBox arcSelBox = new VBox();

            Label l1 = new Label("Rules");

            l1.Xalign = 0;
            arcSelBox.PackStart(l1, true, true, 0);
            RuleList = new EditorView(owner);
            RuleList.TextHasChangedByUser += OnRuleChanged;
            //RuleList.ScriptMode = false;

            ScrolledWindow rules = new ScrolledWindow();

            rules.ShadowType = ShadowType.EtchedIn;
            rules.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            rules.Add((RuleList as ViewBase).MainWidget);

            (RuleList as ViewBase).MainWidget.ShowAll();
            arcSelBox.PackStart(rules, true, true, 0);
            rules.Show();

            Label l2 = new Label("Actions");

            l2.Xalign = 0;
            arcSelBox.PackStart(l2, true, true, 0);
            ActionList = new EditorView(owner);
            ActionList.TextHasChangedByUser += OnActionChanged;
            //ActionList.ScriptMode = false;

            ScrolledWindow actions = new ScrolledWindow();

            actions.ShadowType = ShadowType.EtchedIn;
            actions.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            actions.Add((ActionList as ViewBase).MainWidget);

            (ActionList as ViewBase).MainWidget.ShowAll();
            arcSelBox.PackStart(actions, true, true, 0); actions.Show();
            arcSelWdgt = arcSelBox as Widget;
            arcSelWdgt.Hide();
            ctxBox.PackStart(arcSelWdgt, true, true, 0);

            // Node selection:

            Grid t1 = new Grid();

            Label l3 = new Label("Name");

            l3.Xalign = 0;
            t1.Attach(l3, 0, 0, 1, 1);

            Label l4 = new Label("Description");

            l4.Xalign = 0;
            t1.Attach(l4, 0, 1, 1, 1);

            Label l5 = new Label("Colour");

            l5.Xalign = 0;
            t1.Attach(l5, 0, 2, 1, 1);

            nameEntry          = new Entry();
            nameEntry.Changed += OnNameChanged;
            nameEntry.Xalign   = 0;

            // Setting the WidthRequest to 350 will effectively
            // set the minimum size, beyond which it cannot be further
            // shrunk by dragging the HPaned's splitter.
            nameEntry.WidthRequest = 350;
            t1.Attach(nameEntry, 1, 0, 1, 1);

            descEntry              = new Entry();
            descEntry.Xalign       = 0;
            descEntry.Changed     += OnDescriptionChanged;
            descEntry.WidthRequest = 350;
            t1.Attach(descEntry, 1, 1, 1, 1);
            colourChooser              = new ColorButton();
            colourChooser.Xalign       = 0;
            colourChooser.ColorSet    += OnColourChanged;
            colourChooser.WidthRequest = 350;
            t1.Attach(colourChooser, 1, 2, 1, 1);
            nodeSelWdgt = t1;
            ctxBox.PackStart(t1, true, true, 0);

            // Info
            Label l6 = new Label();

            l6.LineWrap = true;
            l6.Text     = "<left-click>: select a node or arc.\n" +
                          "<right-click>: shows a context-sensitive menu.\n\n" +
                          "Once a node/arc is selected, it can be dragged to a new position.\n\n" +
                          "Nodes are created by right-clicking on a blank area.\n\n" +
                          "Transition arcs are created by firstly selecting a source node,\n" +
                          "then right-clicking over a target node.";
            infoWdgt = l6 as Widget;
            infoWdgt.ShowAll();
            l6.Xalign = 0;
            l6.Yalign = 0;
            l6.Wrap   = false;
            Alignment infoWdgtWrapper = new Alignment(0, 0, 1, 0);

            infoWdgtWrapper.Add(infoWdgt);
            //ctxBox.PackStart(infoWdgt, true, true, 0);
            //vbox1.PackStart(ctxBox, false, false, 0);

            PropertiesView = new PropertyView(this);
            ((ScrolledWindow)((ViewBase)PropertiesView).MainWidget).HscrollbarPolicy = PolicyType.Never;
            // settingsBox = new Table(2, 2, false);
            // settingsBox.Attach(new Label("Initial State"), 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            // combobox1 = new ComboBox();
            // combobox1.PackStart(comboRender, false);
            // combobox1.AddAttribute(comboRender, "text", 0);
            // combobox1.Model = comboModel;
            // settingsBox.Attach(combobox1, 1, 2, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            // chkVerbose = new CheckButton();
            // chkVerbose.Toggled += OnToggleVerboseMode;
            // settingsBox.Attach(new Label("Verbose Mode"), 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            // settingsBox.Attach(chkVerbose, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            hpaned1 = new HPaned();
            hpaned2 = new HPaned();
            Frame frame1 = new Frame("Rotation Settings");

            frame1.Add(((ViewBase)PropertiesView).MainWidget);
            frame1.ShadowType = ShadowType.In;
            Frame frame2 = new Frame();

            frame2.Add(hpaned2);
            frame2.ShadowType = ShadowType.In;
            ctxFrame          = new Frame();
            ctxFrame.Add(ctxBox);
            ctxFrame.ShadowType = ShadowType.In;
            Frame frame4 = new Frame("Instructions");

            frame4.Add(infoWdgtWrapper);
            frame4.ShadowType = ShadowType.In;
            hpaned1.Pack1(frame1, false, false);
            hpaned1.Pack2(frame2, true, false);
            hpaned2.Pack1(ctxFrame, true, false);
            hpaned2.Pack2(frame4, true, false);
            hpaned1.ShowAll();
            Alignment halign = new Alignment(0, 0, 1, 1);

            halign.Add(hpaned1);

            vpaned1.Pack2(halign, false, false);
            vpaned1.Show();

            graphView.OnGraphObjectSelected += OnGraphObjectSelected;
            graphView.OnGraphObjectMoved    += OnGraphObjectMoved;
            //combobox1.Changed += OnComboBox1SelectedValueChanged;

            contextMenuHelper              = new ContextMenuHelper(graphView.MainWidget);
            contextMenuHelper.ContextMenu += OnPopup;

            ContextMenu.SelectionDone += OnContextMenuDeactivated;
            ContextMenu.Mapped        += OnContextMenuRendered;

            // Ensure the menu is populated
            Select(null);
        }