[MonoDevelop] MonoDevelop.Dock

Markus Meissner markus at marmei.net
Tue Oct 28 08:00:11 EDT 2008


For my diploma I need to implement a GUI Application with several time
continuous plot's. There are about 12 single Plot windows. For usability I
would like to implement it using Gdl or MonoDevelop.Dock. I think the Gdl
implementation is obsolete, isn't it? - But it includes an example
Application (GdlTestDock.cs) included in monodevelop-0.15.tar.bz2. Is
there a example Application of the new MonoDocking lib included in
Monodevelop-1.0.
I would appreciate it if someone could send me a working example or a hint
how to implement docking in the recent MonoDevelop.Dock - lib.

How do I implement a DockBar?

I adapted some code from the old GdlTestDock.cs and Monodevelop.Ide to the
new Docking lib - Why doesn't it show a Frame?    :


using System;
using Gtk;
using System.IO;
using MonoDevelop.Components.Docking;

class VBoxTester {

  static void Main ()
  {
    Application.Init ();
    Window myWindow = new Window ("VBox Widget");
    myWindow.SetDefaultSize (400, 400);
    myWindow.WindowPosition = WindowPosition.Center;

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

    DockFrame dock = new DockFrame();

    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 documentDockItem;

    documentDockItem = dock.AddItem ("Documents");
    documentDockItem.Behavior = DockItemBehavior.Locked;
    documentDockItem.Expand = true;
    documentDockItem.DrawFrame = false;
    documentDockItem.Content = new Button ("Button");

    // Add some hiden items to be used as position reference
    DockItem dit = dock.AddItem ("__left");
    dit.DefaultLocation = "Documents/Left";
    dit.Behavior = DockItemBehavior.Locked;
    dit.DefaultVisible = false;

    dit = dock.AddItem ("__right");
    dit.DefaultLocation = "Documents/Right";
    dit.Behavior = DockItemBehavior.Locked;
    dit.DefaultVisible = false;

    dit = dock.AddItem ("__top");
    dit.DefaultLocation = "Documents/Top";
    dit.Behavior = DockItemBehavior.Locked;
    dit.DefaultVisible = false;

    dit = dock.AddItem ("__bottom");
    dit.DefaultLocation = "Documents/Bottom";
    dit.Behavior = DockItemBehavior.Locked;
    dit.DefaultVisible = false;


    DockItem di1;
    di1 = dock.AddItem ("test");
    di1.Content = new Button ("Button");
    di1.Label = "test1";
    di1.Behavior = DockItemBehavior.Normal;

    di1.DefaultLocation = "__top/Bottom";
    di1.Behavior = DockItemBehavior.Normal;

    // di2.DockTo (null, DockPlacement.Floating);

    dock.CreateLayout("mylayout", true);
    dock.SaveLayouts("testLayout");
    pmfile();


    myWindow.ShowAll ();
    Application.Run ();
    }
}

Thanks very much in advanced!

Markus







More information about the Monodevelop-list mailing list