private void DockBtn_OnUnChecked(object sender, RoutedEventArgs e)
 {
     if (_dockButton != null)
     {
         _dockButton.Close();
         _dockButton = null;
     }
 }
 private void DockBtn_OnChecked(object sender, RoutedEventArgs e)
 {
     if (_dockButton == null)
     {
         _dockButton = new DockButton {
             Owner = this
         }
     }
     ;
     _dockButton.Show();
 }
Esempio n. 3
0
 /// <summary>
 /// 加载科室管理按钮
 /// </summary>
 private void AddButtonPacsDeptManage()
 {
     string[] Name  = new string[] { "类别对照", "检查类别", "用户管理" };
     string[] Place = new string[] { "SIS.DeptManage.frmUserExamClass", "SIS.DeptManage.frmExamClass", "SIS.DeptManage.frmFpaxUsers" };
     for (int i = 0; i < Name.Length; i++)
     {
         DockButton dButton = GetNewButton(Name[i], Place[i], Name[i]);
         this.p_Two.Controls.Add(dButton);
     }
     this.p_TwoAndThree.Visible = false;
 }
Esempio n. 4
0
 /// <summary>
 /// AddPACS的功能按钮
 /// </summary>
 private void AddButtonPacs()
 {
     string[] Name  = new string[] { "报表统计", "排队分诊", "检查登记", "检查记录" };
     string[] Place = new string[] { "SIS.frmStat", "SIS.frmSubArea", "SIS.frmRegister", "SIS.frmQuickQuery" };
     for (int i = 0; i < Name.Length; i++)
     {
         DockButton db = GetNewButton(Name[i], Place[i], Name[i]);
         this.p_Two.Controls.Add(db);
     }
     this.p_TwoAndThree.Visible = false;
 }
Esempio n. 5
0
        public DockHelper(Control parent) : base(parent)
        {
            var bSize = 30;

            addUp     = new DockButton(this, AddUp, "up");
            addLeft   = new DockButton(this, AddLeft, "left");
            addDown   = new DockButton(this, AddDown, "down");
            addRigth  = new DockButton(this, AddRigth, "rigth");
            addCenter = new DockButton(this, AddCenter, "center");

            addUp.SetPosition(bSize, 0);
            addLeft.SetPosition(0, bSize);
            addDown.SetPosition(bSize, 2 * bSize);
            addRigth.SetPosition(2 * bSize, bSize);
            addCenter.SetPosition(bSize, bSize);

            SizeToChildren();
        }
Esempio n. 6
0
        public DockHelper(PaneGroup parent)
            : base(parent)
        {
            var bSize = 30;

            addUp = new DockButton(this, AddUp, "up");
            addLeft = new DockButton(this, AddLeft, "left");
            addDown = new DockButton(this, AddDown, "down");
            addRigth = new DockButton(this, AddRigth, "rigth");
            addCenter = new DockButton(this, AddCenter, "center");

            addUp.SetPosition(bSize, 0);
            addLeft.SetPosition(0, bSize);
            addDown.SetPosition(bSize, 2 * bSize);
            addRigth.SetPosition(2 * bSize, bSize);
            addCenter.SetPosition(bSize, bSize);

            SizeToChildren();
        }
Esempio n. 7
0
        /// <summary>
        /// 获取新按钮
        /// </summary>
        /// <param name="ButtonText">按钮显示文本</param>
        /// <param name="Tag">用户定义数据</param>
        /// <param name="Name">按钮名称</param>
        /// <returns></returns>
        private SIS.comm.DockButton GetNewButton(string ButtonText, string Tag, string Name)
        {
            DockButton dButton = new DockButton();

            dButton.vistaButton.ButtonText = ButtonText;
            dButton.vistaButton.Tag        = Tag;
            dButton.vistaButton.Name       = Name;
            dButton.vistaButton.MouseDown += new MouseEventHandler(vistaButton_MouseDown);
            if (this.isDockTop)
            {
                dButton.Height = 60;
                dButton.Dock   = DockStyle.Top;
            }
            else
            {
                dButton.Width = 120;
                dButton.Dock  = DockStyle.Left;
            }
            return(dButton);
        }
            public void SetDocuments(IDockContent[] docs)
            {
                this.docs = docs;

                var current = this.Children.OfType <DockButton>().ToArray();

                //   var tl = new TextLayout(this);

                double x = 0;

                foreach (var doc in docs)
                {
                    var o = current.FirstOrDefault(_b => object.ReferenceEquals(_b.doc, doc));

                    if (o == null)
                    {
                        var b = new DockButton(this, doc)
                        {
                        };
                        this.AddChild(b, x, 0);

                        o = b;
                    }
                    o.Update();
                    var ox   = x;
                    var size = o.GetBackend().GetPreferredSize(SizeConstraint.Unconstrained, SizeConstraint.Unconstrained);
                    var w    = Math.Max(size.Width, 10);
                    this.SetChildBounds(o, new Rectangle(scrollpos + x, (this.Bounds.Height - size.Height) / 2, w, size.Height));
                    x += w + TitleBarButtonSpacing;
                }
                var tr = current.Where(_b => !docs.Any(_d => object.ReferenceEquals(_b.doc, _d))).ToArray();

                foreach (var o in tr)
                {
                    o.RemoveCloseButton();
                    this.RemoveChild(o);
                    o.Dispose();
                }
                this.QueueDraw();
            }
Esempio n. 9
0
        /// <summary>
        /// 设置图片
        /// </summary>
        private void SetImages()
        {
            bool isSetDock = false;

            try
            {
                if (isDockTop)
                {
                    for (int i = 0; i < this.p_Two.Controls.Count; i++)
                    {
                        DockButton ctl = (DockButton)this.p_Two.Controls[i];
                        if (isDockStateChanged)
                        {
                            ctl.Height = 60;
                            ctl.Dock   = DockStyle.Top;
                            isSetDock  = true;
                        }
                    }
                    for (int i = 0; i < this.p_Three.Controls.Count; i++)
                    {
                        DockButton ctl = (DockButton)this.p_Three.Controls[i];
                        if (isDockStateChanged)
                        {
                            ctl.Height = 60;
                            ctl.Dock   = DockStyle.Top;
                            isSetDock  = true;
                        }
                    }
                    this.outlookBar.Height = 120;
                    this.outlookBar.Dock   = DockStyle.Bottom;
                }
                else
                {
                    for (int i = 0; i < this.p_Two.Controls.Count; i++)
                    {
                        DockButton ctl = (DockButton)this.p_Two.Controls[i];
                        if (isDockStateChanged)
                        {
                            ctl.Width = 120;
                            ctl.Dock  = DockStyle.Left;
                            isSetDock = true;
                        }
                    }
                    for (int i = 0; i < this.p_Three.Controls.Count; i++)
                    {
                        DockButton ctl = (DockButton)this.p_Three.Controls[i];
                        if (isDockStateChanged)
                        {
                            ctl.Width = 120;
                            ctl.Dock  = DockStyle.Left;
                            isSetDock = true;
                        }
                    }
                    this.outlookBar.Width = 120;
                    this.outlookBar.Dock  = DockStyle.Right;
                }
            }
            catch { }
            if (isSetDock)
            {
                this.isDockStateChanged = false;
            }
        }