Exemplo n.º 1
0
        /// <summary>
        /// Tunes the middle dock item or the data visualizer.
        /// </summary>
        private void TuneMiddleDockItem()
        {
            // Attach the comboBox first.
            vbMiddle.PackStart(comboBox, false, false, 0);
            ScrolledWindow scroll = new ScrolledWindow();

            // Attach the treeView to the scroll bar.
            scroll.AddWithViewport(treeView);
            // Attach the scrollBar to the box.
            vbMiddle.PackStart(scroll, true, true, 0);

            // Set up DrawingArea.
            drawingArea = new DrawingArea();
            drawingArea.SetSizeRequest(800, 500);
            ScrolledWindow scrollDA = new ScrolledWindow();

            Gtk.VBox vBoxDA     = new Gtk.VBox();
            Viewport viewPortDA = new Viewport();

            viewPortDA.Add(drawingArea);
            scrollDA.Add(viewPortDA);
            vBoxDA.PackStart(scrollDA, true, true, 0);

            // Add Paned container in order to make the two boxes resizable
            Gtk.VPaned splitter = new Gtk.VPaned();
            splitter.Pack1(vBoxDA, true, true);
            splitter.Pack2(vbMiddle, true, true);
            splitter.Position = 400;
            splitter.ShowAll();

            nbMiddleDock.AppendPage(splitter, new Gtk.Label("Schema Visualizer"));
            nbMiddleDock.ShowAll();

            schemaV = new SchemaVisualizer(drawingArea);

            // Get the selected shape.
            SelectionModel selectionModel = schemaV.Selection;

            selectionModel.ModelChanged += HandleSelectionModelChanged;
        }