Esempio n. 1
0
        /// <summary>
        /// Configure the layout of DrawerBox to split or popover
        /// </summary>
        void ConfigureLayout()
        {
            _panel.SetContent(null, true);
            _panel.Hide();

            _splitPane.SetLeftPart(null, true);
            _splitPane.SetRightPart(null, true);
            _splitPane.Hide();

            UnPackAll();

            // the structure for split mode and for popover mode looks differently
            if (IsSplit)
            {
                _splitPane.SetLeftPart(_drawerBox, true);
                _splitPane.SetRightPart(_contentBox, true);
                _splitPane.Proportion = (SplitRatio > 0) ? SplitRatio : this.GetSplitRatio();
                _splitPane.Show();
                PackEnd(_splitPane);

                _mainWidget = _splitPane;

                if (!IsOpen)
                {
                    IsOpen = true;
                    Toggled?.Invoke(this, EventArgs.Empty);
                }
            }
            else
            {
                _panel.SetContent(_drawerBox, true);
                _panel.Show();

                if (_panel.IsOpen)
                {
                    _dimArea.Show();
                }

                PackEnd(_contentBox);
                PackEnd(_dimArea);
                PackEnd(_panel);

                _mainWidget = _contentBox;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Composes the structure of all the necessary widgets.
        /// </summary>
        void ConfigureLayout()
        {
            _drawer.SetContent(null, true);
            _drawer.Hide();

            _splitPane.SetPartContent("left", null, true);
            _splitPane.SetPartContent("right", null, true);
            _splitPane.Hide();

            UnPackAll();

            // the structure for split mode and for popover mode looks differently
            if (IsSplit)
            {
                _splitPane.SetPartContent("left", _masterCanvas, true);
                _splitPane.SetPartContent("right", _detailCanvas, true);
                _splitPane.Show();
                _mainWidget = _splitPane;
                PackEnd(_splitPane);

                IsPresented = true;
                UpdateIsPresentChangeable?.Invoke(this, new UpdateIsPresentChangeableEventArgs(false));
                UpdateFocusPolicy(true);
            }
            else
            {
                _drawer.SetContent(_masterCanvas, true);
                _drawer.Show();
                _mainWidget = _detailCanvas;
                PackEnd(_detailCanvas);
                PackEnd(_drawer);

                _drawer.IsOpen = IsPresented;
                UpdateIsPresentChangeable?.Invoke(this, new UpdateIsPresentChangeableEventArgs(true));
                UpdateFocusPolicy();
            }

            _masterCanvas.Show();
            _detailCanvas.Show();

            // even though child was changed, Layout callback was not called, so i manually call layout function.
            // Layout callback was filter out when geometry was not changed in Native.Box
            UpdateChildCanvasGeometry();
        }
Esempio n. 3
0
        /// <summary>
        /// Composes the structure of all the necessary widgets.
        /// </summary>
        void ConfigureLayout()
        {
            _drawer.SetContent(null, true);
            _drawer.Hide();

            _splitPane.SetPartContent("left", null, true);
            _splitPane.SetPartContent("right", null, true);
            _splitPane.Hide();

            UnPackAll();

            // the structure for split mode and for popover mode looks differently
            if (_internalMasterBehavior == MasterBehavior.Split)
            {
                _splitPane.SetPartContent("left", _masterCanvas, true);
                _splitPane.SetPartContent("right", _detailCanvas, true);
                _splitPane.Show();
                _mainWidget = _splitPane;
                PackEnd(_splitPane);

                IsPresented = true;
                UpdateIsPresentChangeable?.Invoke(this, new UpdateIsPresentChangeableEventArgs {
                    CanChange = false
                });
            }
            else
            {
                _drawer.SetContent(_masterCanvas, true);
                _drawer.Show();
                _mainWidget = _detailCanvas;
                PackEnd(_detailCanvas);
                PackEnd(_drawer);

                _drawer.IsOpen = IsPresented;
                UpdateIsPresentChangeable?.Invoke(this, new UpdateIsPresentChangeableEventArgs {
                    CanChange = false
                });
            }

            _masterCanvas.Show();
            _detailCanvas.Show();
        }
Esempio n. 4
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new Box(window);

            conformant.SetContent(box);
            box.Show();

            Rectangle redBox = new Rectangle(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
                Color      = Color.Red,
            };

            redBox.Show();
            Rectangle blueBox = new Rectangle(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
                Color      = Color.Blue,
            };
            Rectangle greenBox = new Rectangle(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
                Color      = Color.Green,
            };
            Panes subPanes = new Panes(window)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                WeightX      = 1,
                WeightY      = 1,
                Proportion   = 0.3,
                IsHorizontal = false
            };

            subPanes.Show();
            subPanes.SetPartContent("left", blueBox);
            subPanes.SetPartContent("right", greenBox);
            Panes panes = new Panes(window)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                WeightX      = 1,
                WeightY      = 1,
                Proportion   = 0.1,
                IsFixed      = true,
                IsHorizontal = true,
            };

            panes.SetPartContent("left", redBox);
            panes.SetPartContent("right", subPanes);
            panes.Show();
            box.PackEnd(panes);
        }