Esempio n. 1
0
        public void Initialize(Xwt.Backends.Orientation dir)
        {
            if (dir == Xwt.Backends.Orientation.Horizontal)
            {
                Widget = new Gtk.HScale(0, 1.0, 0.1);
            }
            else
            {
                Widget = new Gtk.VScale(0, 1.0, 0.1);
            }

            Widget.DrawValue = false;
            Widget.Show();
        }
Esempio n. 2
0
        public void Initialize(Orientation dir)
        {
            this.direction = dir;

            Grid = new PanedGrid () { Backend = this };

            // Create all the row/column definitions and the splitter

            if (direction == Orientation.Horizontal) {
                ColumnDefinition definition = new ColumnDefinition ();
                definition.Width = new GridLength (1, GridUnitType.Star);
                Grid.ColumnDefinitions.Add (definition);
                panel1.Definition = definition;

                splitter = new GridSplitter {
                    ResizeDirection = GridResizeDirection.Columns,
                    VerticalAlignment = VerticalAlignment.Stretch,
                    HorizontalAlignment = HorizontalAlignment.Center,
                    Width = SplitterSize
                };
                Grid.ColumnDefinitions.Add (new ColumnDefinition { Width = GridLength.Auto });
                Grid.SetColumn (splitter, 1);
                Grid.Children.Add (splitter);

                definition = new ColumnDefinition ();
                definition.Width = new GridLength (1, GridUnitType.Star);
                Grid.ColumnDefinitions.Add (definition);
                panel2.Definition = definition;
            }
            else {
                RowDefinition definition = new RowDefinition ();
                definition.Height = new GridLength (1, GridUnitType.Star);
                Grid.RowDefinitions.Add (definition);
                panel1.Definition = definition;

                splitter = new GridSplitter {
                    ResizeDirection = GridResizeDirection.Rows,
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment = VerticalAlignment.Center,
                    Height = SplitterSize
                };
                Grid.RowDefinitions.Add (new RowDefinition { Height = GridLength.Auto });
                Grid.SetRow (splitter, 1);
                Grid.Children.Add (splitter);

                definition = new RowDefinition ();
                definition.Height = new GridLength (1, GridUnitType.Star);
                Grid.RowDefinitions.Add (definition);
                panel2.Definition = definition;
            }
            panel1.PanelIndex = 0;
            panel2.PanelIndex = 2;
            splitter.Visibility = Visibility.Hidden;

            splitter.DragDelta += delegate
            {
                if (position != panel1.Size.Value) {
                    position = panel1.Size.Value;
                    NotifyPositionChanged ();
                }
            };
        }
Esempio n. 3
0
        public void Initialize(Orientation dir)
        {
            this.direction = dir;

            Grid = new PanedGrid()
            {
                Backend = this
            };

            // Create all the row/column definitions and the splitter

            if (direction == Orientation.Horizontal)
            {
                ColumnDefinition definition = new ColumnDefinition();
                definition.Width = new GridLength(1, GridUnitType.Star);
                Grid.ColumnDefinitions.Add(definition);
                panel1.Definition = definition;

                splitter = new GridSplitter {
                    ResizeDirection     = GridResizeDirection.Columns,
                    VerticalAlignment   = VerticalAlignment.Stretch,
                    HorizontalAlignment = HorizontalAlignment.Center,
                    Width = SplitterSize
                };
                Grid.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = GridLength.Auto
                });
                Grid.SetColumn(splitter, 1);
                Grid.Children.Add(splitter);

                definition       = new ColumnDefinition();
                definition.Width = new GridLength(1, GridUnitType.Star);
                Grid.ColumnDefinitions.Add(definition);
                panel2.Definition = definition;
            }
            else
            {
                RowDefinition definition = new RowDefinition();
                definition.Height = new GridLength(1, GridUnitType.Star);
                Grid.RowDefinitions.Add(definition);
                panel1.Definition = definition;

                splitter = new GridSplitter {
                    ResizeDirection     = GridResizeDirection.Rows,
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Height = SplitterSize
                };
                Grid.RowDefinitions.Add(new RowDefinition {
                    Height = GridLength.Auto
                });
                Grid.SetRow(splitter, 1);
                Grid.Children.Add(splitter);

                definition        = new RowDefinition();
                definition.Height = new GridLength(1, GridUnitType.Star);
                Grid.RowDefinitions.Add(definition);
                panel2.Definition = definition;
            }
            panel1.PanelIndex   = 0;
            panel2.PanelIndex   = 2;
            splitter.Visibility = Visibility.Hidden;

            splitter.DragDelta += delegate
            {
                if (position != panel1.Size.Value)
                {
                    position = panel1.Size.Value;
                    NotifyPositionChanged();
                }
            };
        }