Beispiel #1
0
        private Notebook notebook; //TODO switch to notebook mode

        #endregion Fields

        #region Constructors

        public DockContainer(DockFrame dockframe)
            : base(Orientation.Vertical)
        {
            //dockItemAlignment = new Box();
            //dockItemAlignment.Orientation = Orientation.Vertical;
            frame = dockframe;
            //items = new List<DockItemContainer>(10);
            notebook = new Notebook();
            notebook.Visible = false;
        }
Beispiel #2
0
        private void setFrame(Widget widget=null)
        {
            if (widget == null)
            {
                if (this.Parent != null)
                {
                    setFrame(this.Parent);
                }
            }

            if (widget != null)
            {
                if (widget is DockFrame)
                {
                    frame = (DockFrame)widget;
                } else
                {
                    if (widget.Parent != null)
                    {
                        setFrame(widget.Parent);
                    }
                }
            }
        }
Beispiel #3
0
        public DockItemContainer(DockFrame dockframe, Widget widget)
        {
            this.Expand = true;
            this.FadeOutHeader = true;
            //initIcons();

            frame = dockframe;
            CurrentContainer = null;

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

            title = new Gtk.Label();
            title.Justify = Justification.Left;

            Gtk.Image img1 = new Gtk.Image("gtk-zoom-out",IconSize.Menu);
            btnDock = new Button(img1);
            btnDock.Relief = ReliefStyle.None;
            btnDock.Clicked += HandleBtnDockClicked;
            btnDock.EnterNotifyEvent += HandleButtonEnterNotifyEvent;

            Gtk.Image img = new Gtk.Image("gtk-close",IconSize.SmallToolbar);
            btnClose = new Button(img);
            btnClose.Visible = true;
            btnClose.Clicked += HandleBtnCloseClicked;
            btnClose.Relief = ReliefStyle.None;
            btnClose.EnterNotifyEvent += HandleButtonEnterNotifyEvent;

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

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

            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.Drawn += HandleHeaderDrawn;

            //header.Add(new Gtk.Button("gtk-close"));

            header.Realized += delegate {
                header.Window.Cursor = handCursor;
            };

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

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

            if (widget != null)
            {
                CurrentWidget = widget;
                widget.Visible = true;
                PackEnd(widget,true,true,0);

                if (widget is CustomWidget)
                {
                    title.Text = (widget as DockableWidget).Title;
                }
            }

            doRemove = true;
            GLib.Timeout.Add(5000,new GLib.TimeoutHandler(removeHeader));
        }
Beispiel #4
0
 public DockItemContainer(DockFrame dockframe)
     : this(dockframe,null)
 {
     CurrentContainer = null;
     FadeOutHeader = true;
     //Console.WriteLine("create new DockItemContainer");
 }