예제 #1
0
        /// <summary>
        /// Generates the labels.
        /// </summary>
        internal void GenerateLabels()
        {
            MLabels.Clear();
            MLabelValues.Clear();
            double value = MMinValue;

            for (int i = 0; i <= MIntervalCount; i++)
            {
                //if (value >= m_MinValue && value <= m_MaxValue)
                //{
                MLabels.Add(GetOriginalLabel(value));
                MLabelValues.Add(value);
                //}
                value += MInterval;
                if (_isIntervalCountZero)
                {
                    break;
                }
            }
        }
예제 #2
0
        /// <summary>
        /// 初始化界面
        /// </summary>
        protected void Initialize()
        {
            #region 窗口阴影
            WinAPI.SetClassLong(this.Handle, WinAPI.GCL_STYLE, WinAPI.GetClassLong(this.Handle, WinAPI.GCL_STYLE) | WinAPI.CS_DropSHADOW); //API函数加载,实现窗体边框阴影效果
            #endregion

            #region 画板初始化
            Logger.LogInfo("画板初始化!");
            RECT defult = new RECT();
            this.board              = new MBorad();
            this.board.Dock         = DockStyle.Fill;
            this.board.Location     = new Point(0, 0);
            this.board.Name         = "cBoard";
            this.board.BackColor    = Color.Black;
            this.board.Click       += Board_Click;
            this.board.DoubleClick += Board_DoubleClick;
            this.board.MouseWheel  += Board_MouseWheel;

            this.Controls.Add(board);
            #endregion

            #region 第二行

            #region 买卖基价
            lbs1 = new MLabels();
            Logger.LogInfo("初始化买入基价!");
            MLabel lbbuy = new MLabel();
            lbbuy.Text        = "买入基价:";
            lbbuy.ForeColor   = COLOR.RGB(Color.Red);
            lbbuy.BackColor   = -1;
            lbbuy.Font        = MCommonData.d2Font;
            lbbuy.LeftAligned = true;
            lbs1.lbs.Add(lbbuy);

            Logger.LogInfo("初始化买入基价值!");
            MLabel lbbuyvalue = new MLabel();
            lbbuyvalue.Text        = "     ";
            lbbuyvalue.ForeColor   = COLOR.RGB(Color.White);
            lbbuyvalue.BackColor   = -1;
            lbbuyvalue.Font        = MCommonData.d3Font;
            lbbuyvalue.LeftAligned = true;
            lbs1.lbs.Add(lbbuyvalue);

            Logger.LogInfo("初始化卖出基价!");
            MLabel lbsell = new MLabel();
            lbsell.Text        = "卖出基价:";
            lbsell.ForeColor   = COLOR.RGB(Color.Green);
            lbsell.BackColor   = -1;
            lbsell.Font        = MCommonData.d2Font;
            lbsell.LeftAligned = true;
            lbs1.lbs.Add(lbsell);

            Logger.LogInfo("初始化卖出基价值!");
            MLabel lbsellvalue = new MLabel();
            lbsellvalue.Text        = "     ";
            lbsellvalue.ForeColor   = COLOR.RGB(Color.White);
            lbsellvalue.BackColor   = -1;
            lbsellvalue.Font        = MCommonData.d3Font;
            lbsellvalue.LeftAligned = true;
            lbs1.lbs.Add(lbsellvalue);
            this.board.AddControl(lbs1);

            #endregion

            #endregion

            #region 表格

            table = new MUseTable();
            this.board.AddControl(table);

            #endregion

            #region  择框

            Logger.LogInfo("初始化第二行快捷按钮!");
            select = new MSelect();
            select.BackgroundImage               = Resources.select_normal;
            select.MouseClickImage               = Resources.select_press;
            select.MouseEnterImage               = Resources.select_normal;
            select.Font                          = MCommonData.d4Font;
            select.ForeColor                     = COLOR.RGB(MCommonData.fontColor4);
            select.DropDownBoxForeColor          = COLOR.RGB(MCommonData.fontColor5);
            select.DropDownBoxBackColor          = COLOR.RGB(MCommonData.fontColor4);
            select.DropDownBoxRowMouseEnterColor = COLOR.RGB(MCommonData.fontColor13);
            select.Text                          = "请选择";
            select.TextChangeEvent              += Select_TextChangeEvent;
            this.board.AddControl(select);
            #endregion

            Initialized();

            this.SizeChanged += Form1_SizeChanged;

            Draw();
        }