Пример #1
0
        public override void InitializeTab()
        {
            base.InitializeTab();
            ControlUtilities.SetTableDoubleBuffered(dataGridViewCoin, true);

            listBoxCoinObjects.DataSource = CoinObject.GetCoinObjects();
            listBoxCoinObjects.ClearSelected();
            listBoxCoinObjects.SelectedValueChanged += (sender, e) => ListBoxSelectionChange();

            buttonCoinCalculate.Click += (sender, e) => CalculateCoinTrajectories();
            buttonCoinClear.Click     += (sender, e) => ClearCoinTrajectories();

            Color lightBlue   = Color.FromArgb(235, 255, 255);
            Color lightPink   = Color.FromArgb(255, 240, 255);
            Color lightYellow = Color.FromArgb(255, 255, 220);

            dataGridViewCoin.Columns[0].DefaultCellStyle.BackColor = lightBlue;
            dataGridViewCoin.Columns[1].DefaultCellStyle.BackColor = lightBlue;
            dataGridViewCoin.Columns[2].DefaultCellStyle.BackColor = lightPink;
            dataGridViewCoin.Columns[3].DefaultCellStyle.BackColor = lightYellow;
            dataGridViewCoin.Columns[4].DefaultCellStyle.BackColor = lightYellow;
            dataGridViewCoin.Columns[5].DefaultCellStyle.BackColor = lightYellow;
        }
Пример #2
0
        public CoinManager(TabPage tabControl)
        {
            // set controls

            SplitContainer splitContainerCoin = tabControl.Controls["splitContainerCoin"] as SplitContainer;

            _dataGridViewCoin = splitContainerCoin.Panel2.Controls["dataGridViewCoin"] as DataGridView;

            _listBoxCoinObjects = splitContainerCoin.Panel1.Controls["listBoxCoinObjects"] as ListBox;

            _textBoxCoinHSpeedScale  = splitContainerCoin.Panel1.Controls["textBoxCoinHSpeedScale"] as BetterTextbox;
            _textBoxCoinVSpeedScale  = splitContainerCoin.Panel1.Controls["textBoxCoinVSpeedScale"] as BetterTextbox;
            _textBoxCoinVSpeedOffset = splitContainerCoin.Panel1.Controls["textBoxCoinVSpeedOffset"] as BetterTextbox;
            _textBoxCoinParamOrder   = splitContainerCoin.Panel1.Controls["textBoxCoinParamOrder"] as BetterTextbox;
            _textBoxCoinNumCoins     = splitContainerCoin.Panel1.Controls["textBoxCoinNumCoins"] as BetterTextbox;

            _labelCoinHSpeedRange  = splitContainerCoin.Panel1.Controls["labelCoinHSpeedRange"] as Label;
            _labelCoinVSpeedRange  = splitContainerCoin.Panel1.Controls["labelCoinVSpeedRange"] as Label;
            _labelCoinTableEntries = splitContainerCoin.Panel1.Controls["labelCoinTableEntries"] as Label;

            GroupBox groupBoxCoinFilter = splitContainerCoin.Panel1.Controls["groupBoxCoinFilter"] as GroupBox;

            _textBoxCoinFilterHSpeedMin = groupBoxCoinFilter.Controls["textBoxCoinFilterHSpeedMin"] as BetterTextbox;
            _textBoxCoinFilterHSpeedMax = groupBoxCoinFilter.Controls["textBoxCoinFilterHSpeedMax"] as BetterTextbox;
            _textBoxCoinFilterVSpeedMin = groupBoxCoinFilter.Controls["textBoxCoinFilterVSpeedMin"] as BetterTextbox;
            _textBoxCoinFilterVSpeedMax = groupBoxCoinFilter.Controls["textBoxCoinFilterVSpeedMax"] as BetterTextbox;
            _textBoxCoinFilterAngleMin  = groupBoxCoinFilter.Controls["textBoxCoinFilterAngleMin"] as BetterTextbox;
            _textBoxCoinFilterAngleMax  = groupBoxCoinFilter.Controls["textBoxCoinFilterAngleMax"] as BetterTextbox;
            _textBoxCoinFilterRequiredNumOfQualifiedCoins =
                groupBoxCoinFilter.Controls["textBoxCoinFilterRequiredNumOfQualifiedCoins"] as BetterTextbox;

            GroupBox groupBoxCoinCustomization =
                splitContainerCoin.Panel1.Controls["groupBoxCoinCustomization"] as GroupBox;

            _checkBoxCoinCustomizatonDisplayNonQualifiedCoinsOfAQualifiedCoinGroup =
                groupBoxCoinCustomization.Controls[
                    "checkBoxCoinCustomizatonDisplayNonQualifiedCoinsOfAQualifiedCoinGroup"] as CheckBox;
            _textBoxCoinCustomizatonNumDecimalDigits =
                groupBoxCoinCustomization.Controls["textBoxCoinCustomizatonNumDecimalDigits"] as BetterTextbox;
            _textBoxCoinCustomizatonStartingRngIndex =
                groupBoxCoinCustomization.Controls["textBoxCoinCustomizatonStartingRngIndex"] as BetterTextbox;

            _buttonCoinClear     = splitContainerCoin.Panel1.Controls["buttonCoinClear"] as Button;
            _buttonCoinCalculate = splitContainerCoin.Panel1.Controls["buttonCoinCalculate"] as Button;

            // initialize controls

            ControlUtilities.SetTableDoubleBuffered(_dataGridViewCoin, true);

            _listBoxCoinObjects.DataSource = CoinObject.GetCoinObjects();
            _listBoxCoinObjects.ClearSelected();
            _listBoxCoinObjects.SelectedValueChanged += (sender, e) => ListBoxSelectionChange();

            _buttonCoinCalculate.Click += (sender, e) => CalculateCoinTrajectories();
            _buttonCoinClear.Click     += (sender, e) => ClearCoinTrajectories();

            Color lightBlue   = Color.FromArgb(235, 255, 255);
            Color lightPink   = Color.FromArgb(255, 240, 255);
            Color lightYellow = Color.FromArgb(255, 255, 220);

            _dataGridViewCoin.Columns[0].DefaultCellStyle.BackColor = lightBlue;
            _dataGridViewCoin.Columns[1].DefaultCellStyle.BackColor = lightBlue;
            _dataGridViewCoin.Columns[2].DefaultCellStyle.BackColor = lightPink;
            _dataGridViewCoin.Columns[3].DefaultCellStyle.BackColor = lightYellow;
            _dataGridViewCoin.Columns[4].DefaultCellStyle.BackColor = lightYellow;
            _dataGridViewCoin.Columns[5].DefaultCellStyle.BackColor = lightYellow;
        }