Пример #1
0
 protected void DeactivateWarningMessage()
 {
     if (TabPageStatus.InvokeRequired)
     {
         TabPageStatus.BeginInvoke(new DeactivateWarningMessageDelegate(DeactivateWarningMessage));
     }
     else
     {
         DeactivateFailedCloseOrderWarning();
     }
 }
        /// <summary>
        /// Init tab page status
        /// </summary>
        /// <param name="tabPage"></param>
        private static void InitTabPageStatus(TabPage tabPage)
        {
            TabPageStatus tabPageStatus = new TabPageStatus();

            tabPageStatus.TabPage            = tabPage;
            tabPageStatus.Language           = StylesClass.DefaultLanguage;
            tabPageStatus.CanUndo            = false;
            tabPageStatus.CanRedo            = false;
            tabPageStatus.DocumentMapEnabled = false;
            listOfTabPageStatus.Add(tabPageStatus);
        }
Пример #3
0
        /// <summary>
        ///     Sets controls size and position after resizing.
        /// </summary>
        private void TabPageStatusResize(object sender, EventArgs e)
        {
            TabPageStatus.SuspendLayout();

            const int border = 2;
            int       width  = TabPageStatus.ClientSize.Width;
            int       height = TabPageStatus.ClientSize.Height;

            PnlWarning.Width    = width;
            PnlWarning.Location = new Point(0, 0);
            int pnlWarningBottom = PnlWarning.Enabled ? PnlWarning.Bottom + Space : 0;

            var miWidth  = (int)(220 * Data.HDpiScale);
            var miHeight = (int)(150 * Data.VDpiScale);

            PnlMarketInfo.Size     = new Size(miWidth, miHeight);
            PnlMarketInfo.Location = new Point(width - PnlMarketInfo.Width, pnlWarningBottom);

            PnlConnection.Size     = new Size(PnlMarketInfo.Left - Space, 110);
            PnlConnection.Location = new Point(0, pnlWarningBottom);

            LblConnection.Size     = new Size(PnlConnection.Width - 2 * Space - 2 * border, 21);
            LblConnection.Location = new Point(border + Space, (int)PnlConnection.CaptionHeight + Space);

            PnlDataInfoBase.Size     = new Size(PnlConnection.Width, height - PnlConnection.Bottom - Space);
            PnlDataInfoBase.Location = new Point(0, PnlConnection.Bottom + Space);

            PnlUsefulLinks.Size     = new Size(PnlMarketInfo.Width, (height - PnlMarketInfo.Bottom - 2 * Space) / 2);
            PnlUsefulLinks.Location = new Point(PnlMarketInfo.Left, PnlMarketInfo.Bottom + Space);

            PnlForexBrokers.Size     = new Size(PnlMarketInfo.Width, height - PnlUsefulLinks.Bottom - Space);
            PnlForexBrokers.Location = new Point(PnlMarketInfo.Left, PnlUsefulLinks.Bottom + Space);

            const int buttonWith   = 100;
            int       buttonHeight = BtnShowAccountInfo.Height;

            PnlDataInfoButtons.Height = buttonHeight + 2 * Space;

            BtnShowMarketInfo.Width     = buttonWith;
            BtnShowAccountInfo.Width    = buttonWith;
            BtnShowBars.Width           = buttonWith;
            BtnShowMarketInfo.Location  = new Point(Space, Space);
            BtnShowAccountInfo.Location = new Point(BtnShowMarketInfo.Right + Space, Space);
            BtnShowBars.Location        = new Point(BtnShowAccountInfo.Right + Space, Space);

            TabPageStatus.ResumeLayout();
        }
        /// <summary>
        /// Delete status of current tabpage
        /// </summary>
        /// <param name="tabPage"></param>
        public static void RemoveTabPageStatus(TabPage tabPage)
        {
            TabPageStatus tabStatusToDelete = null;

            foreach (TabPageStatus tabPageStatus in listOfTabPageStatus)
            {
                if (tabPageStatus.TabPage == tabPage)
                {
                    tabStatusToDelete = tabPageStatus;
                }
            }

            if (tabStatusToDelete != null)
            {
                listOfTabPageStatus.Remove(tabStatusToDelete);
            }
        }