Beispiel #1
0
        public AutoHideBox(DockFrame frame, DockItem item, Gtk.PositionType pos, int size)
        {
            this.position = pos;
            this.frame = frame;
            this.targetSize = size;
            horiz = pos == PositionType.Left || pos == PositionType.Right;
            startPos = pos == PositionType.Top || pos == PositionType.Left;
            Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;

            Box fr;
            CustomFrame cframe = new CustomFrame ();
            switch (pos) {
                case PositionType.Left: cframe.SetMargins (1, 1, 0, 1); break;
                case PositionType.Right: cframe.SetMargins (1, 1, 1, 0); break;
                case PositionType.Top: cframe.SetMargins (0, 1, 1, 1); break;
                case PositionType.Bottom: cframe.SetMargins (1, 0, 1, 1); break;
            }
            EventBox sepBox = new EventBox ();
            cframe.Add (sepBox);

            if (horiz) {
                fr = new HBox ();
                sepBox.Realized += delegate { sepBox.GdkWindow.Cursor = resizeCursorW; };
                sepBox.WidthRequest = gripSize;
            } else {
                fr = new VBox ();
                sepBox.Realized += delegate { sepBox.GdkWindow.Cursor = resizeCursorH; };
                sepBox.HeightRequest = gripSize;
            }

            sepBox.Events = EventMask.AllEventsMask;

            if (pos == PositionType.Left || pos == PositionType.Top)
                fr.PackEnd (cframe, false, false, 0);
            else
                fr.PackStart (cframe, false, false, 0);

            Add (fr);
            ShowAll ();
            Hide ();

            scrollable = new ScrollableContainer ();
            scrollable.ScrollMode = false;
            scrollable.Show ();

            item.Widget.Show ();
            scrollable.Add (item.Widget);
            fr.PackStart (scrollable, true, true, 0);

            sepBox.ButtonPressEvent += OnSizeButtonPress;
            sepBox.ButtonReleaseEvent += OnSizeButtonRelease;
            sepBox.MotionNotifyEvent += OnSizeMotion;
            sepBox.ExposeEvent += OnGripExpose;
            sepBox.EnterNotifyEvent += delegate { insideGrip = true; sepBox.QueueDraw (); };
            sepBox.LeaveNotifyEvent += delegate { insideGrip = false; sepBox.QueueDraw (); };
        }
Beispiel #2
0
        public PlaceholderWindow(DockFrame frame)
            : base(Gtk.WindowType.Popup)
        {
            SkipTaskbarHint = true;
            Decorated = false;
            TransientFor = (Gtk.Window) frame.Toplevel;
            TypeHint = WindowTypeHint.Utility;

            // Create the mask for the arrow

            Realize ();
            redgc = new Gdk.GC (GdkWindow);
               		redgc.RgbFgColor = frame.Style.Background (StateType.Selected);
        }
Beispiel #3
0
        internal DockBar(DockFrame frame, Gtk.PositionType position)
        {
            frame.ShadedContainer.Add (this);
            VisibleWindow = false;
            this.frame = frame;
            this.position = position;
            Gtk.Alignment al = new Alignment (0,0,0,0);
            if (Orientation == Gtk.Orientation.Horizontal)
                box = new HBox ();
            else
                box = new VBox ();

            uint sizePadding = 1;
            uint startPadding = 6;
            switch (Frame.CompactGuiLevel) {
                case 1: sizePadding = 2; break;
                case 4: startPadding = 3; break;
                case 5: startPadding = 0; sizePadding = 0; break;
            }

            switch (position) {
                case PositionType.Top: al.BottomPadding = sizePadding; al.LeftPadding = al.RightPadding = startPadding; break;
                case PositionType.Bottom: al.TopPadding = sizePadding; al.LeftPadding = al.RightPadding = startPadding; break;
                case PositionType.Left: al.RightPadding = sizePadding; al.TopPadding = al.BottomPadding = startPadding; break;
                case PositionType.Right: al.LeftPadding = sizePadding; al.TopPadding = al.BottomPadding = startPadding; break;
            }

            box.Spacing = 3;
            al.Add (box);
            Add (al);

            filler = new Label ();
            filler.WidthRequest = 4;
            filler.HeightRequest = 4;
            box.PackEnd (filler);

            ShowAll ();
            UpdateVisibility ();
        }
Beispiel #4
0
 public DockObject(DockFrame frame)
 {
     this.frame = frame;
 }
Beispiel #5
0
 public virtual void CopyFrom(DockObject ob)
 {
     parentGroup = null;
     frame = ob.frame;
     rect = ob.rect;
     size = ob.size;
     allocSize = ob.allocSize;
     defaultHorSize = ob.defaultHorSize;
     defaultVerSize = ob.defaultVerSize;
     prefSize = ob.prefSize;
 }
Beispiel #6
0
 public DockGroupItem(DockFrame frame, DockItem item)
     : base(frame)
 {
     this.item = item;
     visibleFlag = item.Visible;
 }
Beispiel #7
0
 internal DockGroup(DockFrame frame)
     : base(frame)
 {
 }
Beispiel #8
0
 public DockGroup(DockFrame frame, DockGroupType type)
     : base(frame)
 {
     this.type = type;
 }
Beispiel #9
0
 public DockLayout(DockFrame frame)
     : base(frame, DockGroupType.Horizontal)
 {
 }
Beispiel #10
0
 internal DockItem(DockFrame frame, string id)
 {
     this.frame = frame;
     this.id = id;
 }
Beispiel #11
0
 internal DockItem(DockFrame frame, Widget w, string id)
 {
     this.frame = frame;
     this.id = id;
     content = w;
 }
Beispiel #12
0
 internal DockItem(DockFrame frame, Widget w, string id)
 {
     this.frame = frame;
     this.id    = id;
     content    = w;
 }
Beispiel #13
0
 internal DockItem(DockFrame frame, string id)
 {
     this.frame = frame;
     this.id    = id;
 }
Beispiel #14
0
 public static DockLayout Read(DockFrame frame, XmlReader reader)
 {
     DockLayout layout = new DockLayout (frame);
     layout.Read (reader);
     return layout;
 }
Beispiel #15
0
 public DockContainer(DockFrame frame)
 {
     this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask | EventMask.LeaveNotifyMask;
     this.frame = frame;
     frame.ShadedContainer.Add (this);
 }
Beispiel #16
0
        public DockItemContainer(DockFrame frame, DockItem item)
        {
            this.frame = frame;
            this.item = item;

            ResizeMode = Gtk.ResizeMode.Queue;
            Spacing = 0;

            title = new Gtk.Label ();
            title.Xalign = 0;
            title.Xpad = 3;
            title.UseMarkup = true;
            title.Ellipsize = Pango.EllipsizeMode.End;

            btnDock = new Button (new Gtk.Image (pixAutoHide));
            btnDock.Relief = ReliefStyle.None;
            btnDock.CanFocus = false;
            btnDock.WidthRequest = btnDock.HeightRequest = 17;
            btnDock.Clicked += OnClickDock;

            btnClose = new Button (new Gtk.Image (pixClose));
            btnClose.TooltipText = Catalog.GetString ("Hide");
            btnClose.Relief = ReliefStyle.None;
            btnClose.CanFocus = false;
            btnClose.WidthRequest = btnClose.HeightRequest = 17;
            btnClose.Clicked += delegate {
                item.Visible = false;
            };

            HBox box = new HBox (false, 0);
            box.PackStart (title, true, true, 0);
            box.PackEnd (btnClose, false, false, 0);
            box.PackEnd (btnDock, false, false, 0);

            headerAlign = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            headerAlign.TopPadding = headerAlign.BottomPadding = headerAlign.RightPadding = headerAlign.LeftPadding = 1;
            headerAlign.Add (box);

            header = new EventBox ();
            header.Events |= Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask;
            header.ButtonPressEvent += HeaderButtonPress;
            header.ButtonReleaseEvent += HeaderButtonRelease;
            header.MotionNotifyEvent += HeaderMotion;
            header.KeyPressEvent += HeaderKeyPress;
            header.KeyReleaseEvent += HeaderKeyRelease;
            header.Add (headerAlign);
            header.ExposeEvent += HeaderExpose;
            header.Realized += delegate {
                header.GdkWindow.Cursor = handCursor;
            };

            foreach (Widget w in new Widget [] { header, btnDock, btnClose }) {
                w.EnterNotifyEvent += HeaderEnterNotify;
                w.LeaveNotifyEvent += HeaderLeaveNotify;
            }

            PackStart (header, false, false, 0);
            ShowAll ();

            PackStart (item.GetToolbar (PositionType.Top).Container, false, false, 0);

            HBox hbox = new HBox ();
            hbox.Show ();
            hbox.PackStart (item.GetToolbar (PositionType.Left).Container, false, false, 0);

            contentBox = new HBox ();
            contentBox.Show ();
            hbox.PackStart (contentBox, true, true, 0);

            hbox.PackStart (item.GetToolbar (PositionType.Right).Container, false, false, 0);

            PackStart (hbox, true, true, 0);

            PackStart (item.GetToolbar (PositionType.Bottom).Container, false, false, 0);

            UpdateBehavior ();
        }
Beispiel #17
0
 public TabStrip(DockFrame frame)
 {
     this.frame = frame;
     frame.ShadedContainer.Add (this);
     VBox vbox = new VBox ();
     box = new HBox ();
     vbox.PackStart (box, false, false, 0);
     vbox.PackStart (bottomFiller, false, false, 0);
     AppendPage (vbox, null);
     ShowBorder = false;
     ShowTabs = false;
     ShowAll ();
     bottomFiller.Hide ();
     BottomPadding = 3;
 }
Beispiel #18
0
    void CreateComponents()
    {
        fullViewVBox = new VBox (false, 0);
        rootWidget = fullViewVBox;

        CreateMenuBar ();

        CreateToolBar();

        // Create the docking widget and add it to the window.
        dock = new DockFrame ();
        dock.Homogeneous = false;
        dock.DefaultItemHeight = 100;
        dock.DefaultItemWidth = 100;
        //dock.CompactGuiLevel = 1;

        toolbarFrame.AddContent (dock);

        // Create the notebook for the various documents.
        tabControl = new DragNotebook (); //(dock.ShadedContainer);
        tabControl.Scrollable = true;
        tabControl.AppendPage( new Label( "Other page" ), new Label( "Favorite Page  " ) );
        tabControl.AppendPage( new Label( "What page" ), new Label( "Welcome/Start Page  " ) );
        tabControl.AppendPage( new TextView(), new Image( "gtk-new", IconSize.Menu ) );
        tabControl.ShowAll();

        // The main document area
        documentDockItem = dock.AddItem ("Documents");
        documentDockItem.Behavior = DockItemBehavior.Locked;
        documentDockItem.Status = DockItemStatus.AutoHide;
        documentDockItem.DefaultHeight = 100;
        documentDockItem.DefaultWidth = 100;
        documentDockItem.DefaultStatus = DockItemStatus.AutoHide;
        documentDockItem.DefaultLocation = "Document/Right";
        documentDockItem.Expand = true;
        documentDockItem.DrawFrame = true;
        documentDockItem.Label = "Documents";
        documentDockItem.Content = tabControl;
        documentDockItem.DefaultVisible = true;
        documentDockItem.Visible = true;

        DockItem dit = dock.AddItem ("left");
        dit.Status = DockItemStatus.AutoHide;
        dit.DefaultHeight = 100;
        dit.DefaultWidth = 100;
        dit.DefaultStatus = DockItemStatus.AutoHide;
        dit.DefaultLocation = "left";
        dit.Behavior = DockItemBehavior.Normal;
        dit.Label = "Left";
        dit.DefaultVisible = true;
        dit.Visible = true;
        DockItemToolbar tb = dit.GetToolbar(PositionType.Top);
        ToolButton b = new ToolButton(null,"Hello");
        tb.Add(b,false);
        tb.Visible = true;
        tb.ShowAll();

        dit = dock.AddItem ("right");
        dit.Status = DockItemStatus.AutoHide;
        dit.DefaultHeight = 100;
        dit.DefaultWidth = 100;
        dit.DefaultStatus = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Right";
        dit.Behavior = DockItemBehavior.Normal;
        dit.Label = "Right";
        dit.DefaultVisible = true;
        dit.Visible = true;
        //dit.Icon = Gdk.Pixbuf.LoadFromResource("Cage.Shell.Docking.stock-close-12.png");

        dit = dock.AddItem ("top");
        dit.Status = DockItemStatus.AutoHide;
        dit.DefaultHeight = 100;
        dit.DefaultWidth = 100;
        dit.DefaultStatus = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Top";
        dit.Behavior = DockItemBehavior.Normal;
        dit.Label = "Top";
        dit.DefaultVisible = true;
        dit.Visible = true;

        dit = dock.AddItem ("bottom");
        dit.Status = DockItemStatus.AutoHide;
        dit.DefaultHeight = 100;
        dit.DefaultWidth = 100;
        dit.DefaultStatus = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Bottom";
        dit.Behavior = DockItemBehavior.Normal;
        dit.Label = "Bottom";
        dit.DefaultVisible = true;
        dit.Visible = true;

        if ( File.Exists( "toolbar.status" ) )
        {
            toolbarFrame.LoadStatus("toolbar.status");
        }

        if ( File.Exists( "config.layout" ) )
        {
            dock.LoadLayouts( "config.layout" );
        }
        else
        {
            dock.CreateLayout( "test", true );
        }

        dock.CurrentLayout = "test";
        dock.HandlePadding = 0;
        dock.HandleSize = 10;

        dock.SaveLayouts( "config.layout" );
        toolbarFrame.SaveStatus("toolbar.status");

        Add (fullViewVBox);
        fullViewVBox.ShowAll ();

        statusBar = new Gtk.Statusbar();
        fullViewVBox.PackEnd (statusBar, false, true, 0);
    }