Exemplo n.º 1
0
        public DockToolbarFrame()
        {
            vbox = new VBox ();
            Add (vbox);

            DockToolbarPanel topPanel = new DockToolbarPanel (this, Placement.Top);
            DockToolbarPanel bottomPanel = new DockToolbarPanel (this, Placement.Bottom);
            DockToolbarPanel leftPanel = new DockToolbarPanel (this, Placement.Left);
            DockToolbarPanel rightPanel = new DockToolbarPanel (this, Placement.Right);

            panels = new DockToolbarPanel [4];
            panels [(int)Placement.Top] = topPanel;
            panels [(int)Placement.Bottom] = bottomPanel;
            panels [(int)Placement.Left] = leftPanel;
            panels [(int)Placement.Right] = rightPanel;

            vbox.PackStart (topPanel, false, false, 0);

            HBox hbox = new HBox ();
            contentBox = new VBox ();

            hbox.PackStart (leftPanel, false, false, 0);
            hbox.PackStart (contentBox, true, true, 0);
            hbox.PackStart (rightPanel, false, false, 0);

            vbox.PackStart (hbox, true, true, 0);
            vbox.PackStart (bottomPanel, false, false, 0);

            this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask;
            ShowAll ();
        }
Exemplo n.º 2
0
        public DockToolbarFrame()
        {
            vbox = new VBox();
            Add(vbox);

            DockToolbarPanel topPanel    = new DockToolbarPanel(this, Placement.Top);
            DockToolbarPanel bottomPanel = new DockToolbarPanel(this, Placement.Bottom);
            DockToolbarPanel leftPanel   = new DockToolbarPanel(this, Placement.Left);
            DockToolbarPanel rightPanel  = new DockToolbarPanel(this, Placement.Right);

            panels = new DockToolbarPanel [4];
            panels [(int)Placement.Top]    = topPanel;
            panels [(int)Placement.Bottom] = bottomPanel;
            panels [(int)Placement.Left]   = leftPanel;
            panels [(int)Placement.Right]  = rightPanel;

            vbox.PackStart(topPanel, false, false, 0);

            HBox hbox = new HBox();

            contentBox = new VBox();

            hbox.PackStart(leftPanel, false, false, 0);
            hbox.PackStart(contentBox, true, true, 0);
            hbox.PackStart(rightPanel, false, false, 0);

            vbox.PackStart(hbox, true, true, 0);
            vbox.PackStart(bottomPanel, false, false, 0);

            this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask;
            ShowAll();
        }
Exemplo n.º 3
0
 internal void StartDragBar(DockToolbar bar, int x, int y, uint time)
 {
     dragBar  = bar;
     xDragDif = -x;
     yDragDif = -y;
     Pointer.Grab(this.GdkWindow, false, EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask, null, handCursor, time);
     if (!bar.Floating)
     {
         DockToolbarPanel panel = (DockToolbarPanel)dragBar.Parent;
         panel.StartDragBar(bar);
     }
 }
Exemplo n.º 4
0
        internal void DockToolbar(DockToolbar bar, Placement placement, int offset, int row)
        {
            DockToolbarPanel p = GetPanel(placement);

            if (row != -1)
            {
                p.AddDockToolbar(bar, offset, row);
            }
            else
            {
                p.AddDockToolbar(bar);
            }
        }
Exemplo n.º 5
0
        protected override bool OnMotionNotifyEvent(EventMotion e)
        {
            if (dragBar != null)
            {
                int sx, sy;
                this.GdkWindow.GetOrigin(out sx, out sy);
                int rx = (int)e.XRoot - sx;
                int ry = (int)e.YRoot - sy;

                if (dragBar.Floating)
                {
                    bool foundPanel = false;
                    dragBar.FloatingDock.Move((int)e.XRoot + xDragDif, (int)e.YRoot + yDragDif);
                    Rectangle barRect = new Rectangle(rx + xDragDif, ry + yDragDif, dragBar.Allocation.Width, dragBar.DefaultHeight);
                    foreach (DockToolbarPanel p in panels)
                    {
                        if (p.Allocation.IntersectsWith(barRect))
                        {
                            if (targetPanel != null && targetPanel != p)
                            {
                                targetPanel.EndDragBar(dragBar);
                            }
                            p.Reposition(dragBar, rx, ry, xDragDif, yDragDif);
                            targetPanel = p;
                            foundPanel  = true;
                            break;
                        }
                    }
                    if (!foundPanel && targetPanel != null)
                    {
                        targetPanel.EndDragBar(dragBar);
                    }
                }
                else
                {
                    DockToolbarPanel panel = (DockToolbarPanel)dragBar.Parent;
                    panel.Reposition(dragBar, rx, ry, xDragDif, yDragDif);
                }
            }
            return(base.OnMotionNotifyEvent(e));
        }
Exemplo n.º 6
0
        protected override bool OnMotionNotifyEvent(EventMotion e)
        {
            if (dragBar != null) {
                int sx,sy;
                this.GdkWindow.GetOrigin (out sx, out sy);
                int rx = (int)e.XRoot - sx;
                int ry = (int)e.YRoot - sy;

                if (dragBar.Floating) {
                    bool foundPanel = false;
                    dragBar.FloatingDock.Move ((int)e.XRoot + xDragDif, (int)e.YRoot + yDragDif);
                    Rectangle barRect = new Rectangle (rx + xDragDif, ry + yDragDif, dragBar.Allocation.Width, dragBar.DefaultHeight);
                    foreach (DockToolbarPanel p in panels) {
                        if (p.Allocation.IntersectsWith (barRect)) {
                            if (targetPanel != null && targetPanel != p)
                                targetPanel.EndDragBar (dragBar);
                            p.Reposition (dragBar, rx, ry, xDragDif, yDragDif);
                            targetPanel = p;
                            foundPanel = true;
                            break;
                        }
                    }
                    if (!foundPanel && targetPanel != null)
                        targetPanel.EndDragBar (dragBar);
                } else {
                    DockToolbarPanel panel = (DockToolbarPanel) dragBar.Parent;
                    panel.Reposition (dragBar, rx, ry, xDragDif, yDragDif);
                }
            }
            return base.OnMotionNotifyEvent (e);
        }
Exemplo n.º 7
0
 internal bool CanDockTo(DockToolbarPanel panel)
 {
     return true;
 }
Exemplo n.º 8
0
 internal bool CanDockTo(DockToolbarPanel panel)
 {
     return(true);
 }