Beispiel #1
0
 internal static DockPosition GetDockPosition(SWF.DockStyle dockStyle)
 {
     if (dockStyle == SWF.DockStyle.Top)
     {
         return(DockPosition.Top);
     }
     else if (dockStyle == SWF.DockStyle.Bottom)
     {
         return(DockPosition.Bottom);
     }
     else if (dockStyle == SWF.DockStyle.Left)
     {
         return(DockPosition.Left);
     }
     else if (dockStyle == SWF.DockStyle.Right)
     {
         return(DockPosition.Right);
     }
     else if (dockStyle == SWF.DockStyle.Fill)
     {
         return(DockPosition.Fill);
     }
     else
     {
         return(DockPosition.None);
     }
 }
Beispiel #2
0
        public static WeifenLuo.WinFormsUI.Docking.DockState ConvertToDockState(System.Windows.Forms.DockStyle dockStyle)
        {
            switch (dockStyle)
            {
            case System.Windows.Forms.DockStyle.Bottom:
                return(WeifenLuo.WinFormsUI.Docking.DockState.DockBottom);

            case System.Windows.Forms.DockStyle.Fill:
                return(WeifenLuo.WinFormsUI.Docking.DockState.Document);

            case System.Windows.Forms.DockStyle.Left:
                return(WeifenLuo.WinFormsUI.Docking.DockState.DockLeft);

            case System.Windows.Forms.DockStyle.None:
                return(WeifenLuo.WinFormsUI.Docking.DockState.Float);

            case System.Windows.Forms.DockStyle.Right:
                return(WeifenLuo.WinFormsUI.Docking.DockState.DockRight);

            case System.Windows.Forms.DockStyle.Top:
                return(WeifenLuo.WinFormsUI.Docking.DockState.DockTop);

            default:
                throw new NotImplementedException();
            }
        }
Beispiel #3
0
        /// <summary>
        /// 根据Forms.DockStyle设置WeiFenLuo的Dock方式
        /// </summary>
        public static WeifenLuo.WinFormsUI.Docking.DockState SimplifyDockstate(System.Windows.Forms.DockStyle dockStyle)
        {
            switch (dockStyle)
            {
            case System.Windows.Forms.DockStyle.Bottom:
                return(WeifenLuo.WinFormsUI.Docking.DockState.DockBottom);

            case System.Windows.Forms.DockStyle.Fill:
                return(WeifenLuo.WinFormsUI.Docking.DockState.Document);

            case System.Windows.Forms.DockStyle.Left:
                return(WeifenLuo.WinFormsUI.Docking.DockState.DockLeft);

            case System.Windows.Forms.DockStyle.None:
                return(WeifenLuo.WinFormsUI.Docking.DockState.Float);

            case System.Windows.Forms.DockStyle.Right:
                return(WeifenLuo.WinFormsUI.Docking.DockState.Float);

            case System.Windows.Forms.DockStyle.Top:
                return(WeifenLuo.WinFormsUI.Docking.DockState.DockTop);

            default:
                return(WeifenLuo.WinFormsUI.Docking.DockState.Float);
            }
        }
        /// <summary>
        /// Richard Todd. Annotate a chart and export to MS Word
        /// </summary>
        /// <returns></returns>
        public Indicator.ZAnnotate2 ZAnnotate2(Data.IDataSeries input, System.Windows.Forms.DockStyle dockWhere)
        {
            if (InInitialize && input == null)
            {
                throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");
            }

            return(_indicator.ZAnnotate2(input, dockWhere));
        }
Beispiel #5
0
 public void AddControlToTabPage(System.Windows.Forms.DockStyle DockStyle, Control oControl)
 {
     if (this.TabPages.Count > 0)
     {
         int     nCurrentTabPage = this.SelectedIndex;
         TabPage oTabPage        = this.TabPages[nCurrentTabPage];
         oControl.Dock = DockStyle;
         oTabPage.Controls.Add(oControl);
     }
 }
        /// <summary>
        /// Richard Todd. Annotate a chart and export to MS Word
        /// </summary>
        /// <returns></returns>
        public ZAnnotate2 ZAnnotate2(Data.IDataSeries input, System.Windows.Forms.DockStyle dockWhere)
        {
            if (cacheZAnnotate2 != null)
            {
                for (int idx = 0; idx < cacheZAnnotate2.Length; idx++)
                {
                    if (cacheZAnnotate2[idx].DockWhere == dockWhere && cacheZAnnotate2[idx].EqualsInput(input))
                    {
                        return(cacheZAnnotate2[idx]);
                    }
                }
            }

            lock (checkZAnnotate2)
            {
                checkZAnnotate2.DockWhere = dockWhere;
                dockWhere = checkZAnnotate2.DockWhere;

                if (cacheZAnnotate2 != null)
                {
                    for (int idx = 0; idx < cacheZAnnotate2.Length; idx++)
                    {
                        if (cacheZAnnotate2[idx].DockWhere == dockWhere && cacheZAnnotate2[idx].EqualsInput(input))
                        {
                            return(cacheZAnnotate2[idx]);
                        }
                    }
                }

                ZAnnotate2 indicator = new ZAnnotate2();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input     = input;
                indicator.DockWhere = dockWhere;
                Indicators.Add(indicator);
                indicator.SetUp();

                ZAnnotate2[] tmp = new ZAnnotate2[cacheZAnnotate2 == null ? 1 : cacheZAnnotate2.Length + 1];
                if (cacheZAnnotate2 != null)
                {
                    cacheZAnnotate2.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1] = indicator;
                cacheZAnnotate2     = tmp;
                return(indicator);
            }
        }
Beispiel #7
0
        public frmTreeViewZoomView(string caption, System.Windows.Forms.TreeView treeViewControl)
        {
            this._treeViewControl           = treeViewControl;
            this._controlParentContainer    = _treeViewControl.Parent;
            this._previousControlDockStatus = _treeViewControl.Dock;
            this._caption = caption;

            // This call is required by the Windows Form Designer.
            InitializeComponent();

            // Add any initialization after the InitializeComponent() call.
            this.lblHEaderLabelTExt.Text = caption;
            this.Visible = false;
        }
        public frmListViewZoomView(string caption, System.Windows.Forms.DataGridView controlToView)
        {
            this._controlToView             = controlToView;
            this._controlParentContainer    = controlToView.Parent;
            this._previousControlDockStatus = controlToView.Dock;
            this._caption = caption;

            // This call is required by the Windows Form Designer.
            InitializeComponent();

            // Add any initialization after the InitializeComponent() call.
            this.lblHEaderLabelTExt.Text = caption;
            this.Visible = false;
        }
Beispiel #9
0
        /// <summary>
        /// 返回一个能够用作添加可停靠内容(dockable content)到MainProgram的系统panel
        /// 先创建一个可停靠Form,再在Form里面添加一个Panel,返回这个Panel给调用者。
        /// </summary>
        public System.Windows.Forms.Panel CreatePanel(string caption, System.Windows.Forms.DockStyle dockStyle)
        {
            if (m_Panels.ContainsKey(caption))
            {
                if (m_Panels[caption].Controls["ContentPanel"] != null)
                {
                    return((System.Windows.Forms.Panel)(m_Panels[caption].Controls["ContentPanel"]));
                }
                return((System.Windows.Forms.Panel)(m_Panels[caption].Controls[0]));
            }

            Panel contentPanel = new Panel();

            contentPanel.Name = "ContentPanel";
            contentPanel.Dock = DockStyle.Fill;

            MWDockPanel floatPanel = new MWDockPanel(caption);

            floatPanel.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Float;
            floatPanel.Controls.Add(contentPanel);
            floatPanel.FormClosing += new FormClosingEventHandler(MarkClosed);
            floatPanel.Show(Program.frmMain.dckPanel);
            floatPanel.Icon = MapWinGIS.MainProgram.Properties.Resources.MapWinGIS;
            if (dockStyle == DockStyle.None)
            {
                floatPanel.DockState = WeifenLuo.WinFormsUI.Docking.DockState.Float;
            }
            else
            {
                floatPanel.DockState = SimplifyDockstate(dockStyle);
            }

            //我希望创建该窗体时也要创建一个该窗体显示与关闭的菜单
            Program.frmMain.m_Menu.AddMenu("mnu" + caption, "mnuRestoreMenu", (object)null, caption).Checked = floatPanel == null ? false : true;

            m_Panels.Add(caption, floatPanel);
            m_OnCloseHandlers.Add(caption, null);
            return(contentPanel);
        }
Beispiel #10
0
 public Indicator.ZAnnotate2 ZAnnotate2(System.Windows.Forms.DockStyle dockWhere)
 {
     return(_indicator.ZAnnotate2(Input, dockWhere));
 }
Beispiel #11
0
 /// <summary>
 /// Richard Todd. Annotate a chart and export to MS Word
 /// </summary>
 /// <returns></returns>
 public Indicator.ZAnnotate2 ZAnnotate2(Data.IDataSeries input, System.Windows.Forms.DockStyle dockWhere)
 {
     return(_indicator.ZAnnotate2(input, dockWhere));
 }
Beispiel #12
0
 /// <summary>
 /// Richard Todd. Annotate a chart and export to MS Word
 /// </summary>
 /// <returns></returns>
 public ZAnnotate2 ZAnnotate2(System.Windows.Forms.DockStyle dockWhere)
 {
     return(ZAnnotate2(Input, dockWhere));
 }