Beispiel #1
0
        public void HideItem()
        {
            if (!IsAttached)
            {
                /* already hidden/detached */
                return;
            }

            /* if the object is manual, create a new placeholder to be
             * able to restore the position later */
            if (!IsAutomatic)
            {
                dockPlaceHolder = new DockPlaceholder(this, false);
            }

            Freeze();

            /* hide our children first, so they can also set placeholders */
            if (IsCompound)
            {
                Foreach(new Callback(HideChildItem));
            }

            Detach(true);
            Thaw();
        }
Beispiel #2
0
        public virtual void SetDefaultPosition(DockObject reference)
        {
            dockPlaceHolder = null;

            if (reference != null && reference.IsAttached)
            {
                if (reference is DockPlaceholder)
                {
                    dockPlaceHolder = (DockPlaceholder)reference;
                }
                else
                {
                    dockPlaceHolder = new DockPlaceholder(reference, true);
                }
            }
        }
Beispiel #3
0
        public void ShowItem()
        {
            DockObjectFlags &= ~(DockObjectFlags.Iconified);

            if (dockPlaceHolder != null)
            {
                dockPlaceHolder.Add(this);
                dockPlaceHolder = null;
            }
            else if (IsBound)
            {
                if (Master.Controller != null)
                {
                    Master.Controller.Dock(this, DockPlacement.Floating, null);
                }
            }
        }
Beispiel #4
0
 protected override void OnDestroyed()
 {
     if (tabLabel != null)
     {
         tabLabel = null;
     }
     if (menu != null)
     {
         menu.Detach();
         menu = null;
     }
     if (grip != null)
     {
         Remove(grip);
         grip = null;
     }
     if (dockPlaceHolder != null)
     {
         dockPlaceHolder = null;
     }
     base.OnDestroyed();
 }
    T(string[] args)
    {
        Application.Init ();
        Window app = new Window ("test");
        app.SetDefaultSize (400, 400);
        app.WindowPosition = WindowPosition.Center;
        app.DeleteEvent += new DeleteEventHandler (OnAppDelete);

        Box table = new VBox (false, 5);
        table.BorderWidth = 10;
        app.Add (table);

        Dock dock = new Dock ();
        layout = new DockLayout (dock);
        layout.LoadFromFile ("layout.xml");
        DockBar dockbar = new DockBar (dock);

        Box box = new HBox (false, 5);
        box.PackStart (dockbar, false, false, 0);
        box.PackEnd (dock, true, true, 0);
        table.PackStart (box, true, true, 0);

        DockItem di = new DockItem ("item1", "Item #1", DockItemBehavior.Locked);
        di.Add (CreateTextView ());
        dock.AddItem (di, DockPlacement.Top);

        DockItem di2 = new DockItem ("item2", "Item #2 has some large title",
                         Gtk.Stock.Execute, DockItemBehavior.Normal);
        di2.Add (new Button ("Button 2"));
        dock.AddItem (di2, DockPlacement.Right);

        DockItem di3 = new DockItem ("item3", "Item #3 has accented characters (áéíóúñ)",
                         Gtk.Stock.Convert, DockItemBehavior.Normal | DockItemBehavior.CantClose);
        di3.Add (new Button ("Button 3"));
        dock.AddItem (di3, DockPlacement.Bottom);

        DockItem[] items = new DockItem[4];
        items[0] = new DockItem ("item4", "Item #4", Gtk.Stock.JustifyFill,
                     DockItemBehavior.Normal | DockItemBehavior.CantIconify);
        items[0].Add (CreateTextView ());
        dock.AddItem (items[0], DockPlacement.Bottom);

        for (int i = 1; i < 3; i++) {
            string name = "Item #" + (i + 4);
            items[i] = new DockItem (name, name, Gtk.Stock.New,
                         DockItemBehavior.Normal);
            items[i].Add (CreateTextView ());
            items[i].Show ();

                items[0].Dock (items[i], DockPlacement.Center, null);
        }

        di3.DockTo (di, DockPlacement.Top);
        di2.DockTo (di3, DockPlacement.Right);
        di2.DockTo (di3, DockPlacement.Left);
        di2.DockTo (null, DockPlacement.Floating);

        box = new HBox (true, 5);
        table.PackEnd (box, false, false, 0);

        Button button = new Button (Gtk.Stock.Save);
        button.Clicked += new EventHandler (OnSaveLayout);
        box.PackEnd (button, false, true, 0);

        button = new Button ("Layout Manager");
        button.Clicked += new EventHandler (OnRunLayoutManager);
        box.PackEnd (button, false, true, 0);

        button = new Button ("Dump XML");
        button.Clicked += new EventHandler (OnDumpXML);
        box.PackEnd (button, false, true, 0);

        app.ShowAll ();

        // placeholders
        DockPlaceholder ph1 = new DockPlaceholder ("ph1", dock, DockPlacement.Top, false);
        DockPlaceholder ph2 = new DockPlaceholder ("ph2", dock, DockPlacement.Bottom, false);
        DockPlaceholder ph3 = new DockPlaceholder ("ph3", dock, DockPlacement.Left, false);
        DockPlaceholder ph4 = new DockPlaceholder ("ph4", dock, DockPlacement.Right, false);

        Application.Run ();
    }
 protected override void OnDestroyed()
 {
     if (tabLabel != null)
         tabLabel = null;
     if (menu != null) {
         menu.Detach ();
         menu = null;
     }
     if (grip != null) {
         Remove (grip);
         grip = null;
     }
     if (ph != null) {
         ph = null;
     }
     base.OnDestroyed ();
 }
        public void ShowItem()
        {
            DockObjectFlags &= ~(DockObjectFlags.Iconified);

            if (ph != null) {
                ph.Add (this);
                ph = null;
            } else if (IsBound) {
                if (Master.Controller != null) {
                    Master.Controller.Dock (this, DockPlacement.Floating, null);
                }
            }
        }
        public virtual void SetDefaultPosition(DockObject reference)
        {
            ph = null;

            if (reference != null && reference.IsAttached) {
                if (reference is DockPlaceholder) {
                    ph = (DockPlaceholder)reference;
                } else {
                    ph = new DockPlaceholder (reference, true);
                }
            }
        }
        public void HideItem()
        {
            if (!IsAttached)
                /* already hidden/detached */
                return;

            /* if the object is manual, create a new placeholder to be
               able to restore the position later */
            if (!IsAutomatic)
                ph = new DockPlaceholder (this, false);

            Freeze ();

            /* hide our children first, so they can also set placeholders */
            if (IsCompound)
                Foreach (new Callback (HideChildItem));

            Detach (true);
            Thaw ();
        }
Beispiel #10
0
 protected override void OnDestroyed()
 {
     if (tabLabel != null)
         tabLabel = null;
     if (menu != null) {
         menu.Detach ();
         menu = null;
     }
     if (grip != null) {
         Remove (grip);
         grip = null;
     }
     if (dockPlaceHolder != null) {
         dockPlaceHolder = null;
     }
     base.OnDestroyed ();
 }