public DockContainer(DockFrame frame)
        {
            Docking.Helper.GtkWorkarounds.FixContainerLeak(this);

             this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask | EventMask.LeaveNotifyMask;
             this.frame = frame;
        }
        public DockItemTitleTab(DockItem item, DockFrame frame)
        {
            this.item = item;
             this.frame = frame;
             this.VisibleWindow = false;
             UpdateVisualStyle();
             NoShowAll = true;

             Events |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask;
             KeyPressEvent += HeaderKeyPress;
             KeyReleaseEvent += HeaderKeyRelease;

             this.SubscribeLeaveEvent(OnLeave);
        }
        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);
        }
Esempio n. 4
0
        public TabStrip(DockFrame frame)
        {
            xbox = new HBox();
             Add(xbox);

             vBox = new TabStripVBox() { TabStrip = this };
             hBox = new TabStripHBox() { TabStrip = this };

             box = hBox;

             xbox.PackStart(hBox, false, false, 0);
             xbox.PackStart(vBox, false, false, 0);

             ShowAll();
             vBox.Hide();
             bottomFiller.Hide();
             BottomPadding = 3;
             WidthRequest = 0;

             box.Removed += HandleRemoved;
        }
Esempio n. 5
0
        internal DockBar(DockFrame frame, Gtk.PositionType position)
        {
            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 ();

             al.Add (box);
             Add (al);

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

             ShowAll ();
             UpdateVisibility ();
        }
Esempio n. 6
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;
 }
        public DockItemContainer(DockFrame frame, DockItem item)
        {
            this.item = item;

             mainBox = new VBox ();
             Add (mainBox);

             mainBox.ResizeMode = Gtk.ResizeMode.Queue;
             mainBox.Spacing = 0;
             mainBox.BorderWidth = 5;

             ShowAll ();

             mainBox.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);

             mainBox.PackStart (hbox, true, true, 0);

             mainBox.PackStart (item.GetToolbar (PositionType.Bottom).Container, false, false, 0);
        }
 public DockGroupItem(DockFrame frame, DockItem item)
     : base(frame)
 {
     this.item = item;
     visibleFlag = item.Visible;
 }
Esempio n. 9
0
 public DockLayout(DockFrame frame)
     : base(frame, DockGroupType.Horizontal)
 {
 }
Esempio n. 10
0
 public static DockLayout Read(DockFrame frame, XmlReader reader)
 {
     DockLayout layout = new DockLayout (frame);
     layout.Read (reader);
     return layout;
 }
Esempio n. 11
0
 public DockObject(DockFrame frame)
 {
     this.frame = frame;
 }
Esempio n. 12
0
 public DockGroup(DockFrame frame, DockGroupType type)
     : base(frame)
 {
     this.type = type;
 }
        public PadTitleWindow(DockFrame frame, DockItem draggedItem)
            : base(Gtk.WindowType.Popup)
        {
            SkipTaskbarHint = true;
            Decorated = false;
            TransientFor = (Gtk.Window) frame.Toplevel;
            TypeHint = WindowTypeHint.Utility;

            VBox mainBox = new VBox ();

            HBox box = new HBox (false, 3);
            if (draggedItem.Icon != null) {
                Gtk.Image img = new Gtk.Image (draggedItem.Icon);
                box.PackStart (img, false, false, 0);
            }
            Gtk.Label la = new Label ();
            la.Markup = draggedItem.Title;
            box.PackStart (la, false, false, 0);

            mainBox.PackStart (box, false, false, 0);

            /*			if (draggedItem.Widget.IsRealized) {
                var win = draggedItem.Widget.GdkWindow;
                var alloc = draggedItem.Widget.Allocation;
                Gdk.Pixbuf img = Gdk.Pixbuf.FromDrawable (win, win.Colormap, alloc.X, alloc.Y, 0, 0, alloc.Width, alloc.Height);

                double mw = 140, mh = 140;
                if (img.Width > img.Height)
                    mw *= 2;
                else
                    mh *= 2;

                double r = Math.Min (mw / img.Width, mh / img.Height);
                img = img.ScaleSimple ((int)(img.Width * r), (int)(img.Height * r), Gdk.InterpType.Hyper);
                mainBox.PackStart (new Gtk.Image (img), false, false, 0);
            }*/

            CustomFrame f = new CustomFrame ();
            f.SetPadding (12, 12, 12, 12);
            f.SetMargins (1, 1, 1, 1);
            f.Add (mainBox);

            Add (f);
            ShowAll ();
        }
Esempio n. 14
0
 internal DockGroup(DockFrame frame)
     : base(frame)
 {
 }
Esempio n. 15
0
 internal DockItem(DockFrame frame, Widget w, string id)
     : this(frame, id)
 {
     content = w;
 }
Esempio n. 16
0
 internal DockItem(DockFrame frame, string id)
 {
     this.frame = frame;
      this.id = id;
      currentVisualStyle = regionStyle = frame.GetRegionStyleForItem(this);
 }
Esempio n. 17
0
 public DockLayout(DockFrame frame) : base(frame, DockGroupType.Horizontal)
 {
 }
Esempio n. 18
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 (0, 0, 1, 1); break;
                case PositionType.Right: cframe.SetMargins (0, 0, 1, 1); break;
                case PositionType.Top: cframe.SetMargins (1, 1, 0, 0); break;
                case PositionType.Bottom: cframe.SetMargins (1, 1, 0, 0); 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();

            #if ANIMATE_DOCKING
                scrollable = new ScrollableContainer();
                scrollable.ScrollMode = false;
                scrollable.Show();
            #endif
            VBox itemBox = new VBox ();
            itemBox.Show ();
            item.TitleTab.Active = true;
            itemBox.PackStart (item.TitleTab, false, false, 0);
            itemBox.PackStart (item.Widget, true, true, 0);

            item.Widget.Show();
            #if ANIMATE_DOCKING
            scrollable.Add (itemBox);
                fr.PackStart(scrollable, true, true, 0);
            #else
            fr.PackStart (itemBox, true, true, 0);
            #endif

            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 (); };
        }
Esempio n. 19
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(0, 0, 1, 1); break;

            case PositionType.Right: cframe.SetMargins(0, 0, 1, 1); break;

            case PositionType.Top: cframe.SetMargins(1, 1, 0, 0); break;

            case PositionType.Bottom: cframe.SetMargins(1, 1, 0, 0); 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();

#if ANIMATE_DOCKING
            scrollable            = new ScrollableContainer();
            scrollable.ScrollMode = false;
            scrollable.Show();
#endif
            VBox itemBox = new VBox();
            itemBox.Show();
            item.TitleTab.Active = true;
            itemBox.PackStart(item.TitleTab, false, false, 0);
            itemBox.PackStart(item.Widget, true, true, 0);

            item.Widget.Show();
#if ANIMATE_DOCKING
            scrollable.Add(itemBox);
            fr.PackStart(scrollable, true, true, 0);
#else
            fr.PackStart(itemBox, true, true, 0);
#endif

            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(); };
        }