예제 #1
0
        //---------------------------------------------------------------------------------------------

        private void CbxSortDirection_SelectedValueChanged(object sender, EventArgs e)
        {
            if (!this.initRun)
            {
                this.SortDir = (StatusFormWrapperSortDirection)this.cbxSortDirection.SelectedItem;//(StatusFormWrapperSortDirection)Enum.Parse(typeof(StatusFormWrapperSortDirection), this.cbxSortDirection.SelectedValue + String.Empty);
            }
        }
예제 #2
0
        private void InitializeComponent()
        {
            initRun = true;
            this.SuspendLayout();

            Font font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            this.name           = new Label();
            this.name.AutoSize  = true;
            this.name.BackColor = System.Drawing.Color.Transparent;
            this.name.Enabled   = false;
            this.name.Font      = font;
            this.name.Location  = new System.Drawing.Point(2, 2);
            this.name.Name      = "name";
            this.name.TabIndex  = 0;
            this.name.Text      = "" + this.WrapperType.ToString()[0].ToString();
            this.Controls.Add(this.name);

            this.cbxSortType            = new ComboBox();
            this.cbxSortType.DataSource = Enum.GetValues(typeof(StatusFormWrapperSortType));//Enum.GetNames(typeof(StatusFormWrapperSortType));
            this.cbxSortType.Name       = "cbxSortType";
            this.cbxSortType.Location   = new System.Drawing.Point(30, 2);
            this.cbxSortType.Size       = new System.Drawing.Size(50, 10);
            this.cbxSortType.Enabled    = true;
            this.Controls.Add(this.cbxSortType);


            this.cbxSortDirection            = new ComboBox();
            this.cbxSortDirection.DataSource = Enum.GetValues(typeof(StatusFormWrapperSortDirection));//Enum.GetNames(typeof(StatusFormWrapperSortDirection));
            this.cbxSortDirection.Name       = "cbxSortDirection";
            this.cbxSortDirection.Location   = new System.Drawing.Point(82, 2);
            this.cbxSortDirection.Size       = new System.Drawing.Size(36, 10);
            this.cbxSortDirection.Enabled    = true;
            this.Controls.Add(this.cbxSortDirection);


            this.cbxMaxBars            = new ComboBox();
            this.cbxMaxBars.DataSource = posibleMaxs;
            this.cbxMaxBars.Name       = "cbxMaxBars";
            this.cbxMaxBars.Location   = new System.Drawing.Point(118, 2);
            this.cbxMaxBars.Size       = new System.Drawing.Size(36, 10);
            this.cbxMaxBars.Enabled    = true;
            this.Controls.Add(this.cbxMaxBars);



            this.chbxAuto           = new CheckBox();
            this.chbxAuto.Name      = "chbxAuto";
            this.chbxAuto.Location  = new System.Drawing.Point(156, 4);
            this.chbxAuto.Size      = new System.Drawing.Size(12, 12);
            this.chbxAuto.TabIndex  = 1;
            this.chbxAuto.BackColor = Color.Transparent;
            this.Controls.Add(this.chbxAuto);


            this.ClientSize = new Size(190, 20);


            this.maxBars  = Config.Profile.UserSettings.GetAttribute(12, "Value", "StatusFormWrapper_" + this.WrapperType + "_MaxBars");
            this.auto     = Config.Profile.UserSettings.GetAttribute(this.WrapperType == StatusFormWrapperType.Enemy ? true : false, "Value", "StatusFormWrapper_" + this.WrapperType + "_Auto");
            this.sortType = (StatusFormWrapperSortType)Config.Profile.UserSettings.GetAttribute((int)StatusFormWrapperSortType.Distance, "Value", "StatusFormWrapper_" + this.WrapperType + "_SortType");
            this.sortDir  = (StatusFormWrapperSortDirection)Config.Profile.UserSettings.GetAttribute((int)StatusFormWrapperSortDirection.Asc, "Value", "StatusFormWrapper_" + this.WrapperType + "_SortDir");

            this.cbxSortType.SelectedValueChanged      += CbxSortType_SelectedValueChanged;
            this.cbxSortDirection.SelectedValueChanged += CbxSortDirection_SelectedValueChanged;
            this.cbxMaxBars.SelectedValueChanged       += CbxMaxBars_SelectedValueChanged;
            this.chbxAuto.CheckedChanged += ChbxAuto_CheckedChanged;

            this.DoubleBuffered = true;
            this.Name           = "StatusFormWrapper" + this.WrapperType;
            this.ResumeLayout(false);
            this.PerformLayout();
            //this.Invalidate();
            //this.Refresh();
        }