[Quantproject-developers] QuantDownloader/Downloader/TickerSelectors TickerSelectorForm.cs,1.4,1.5
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2004-07-25 12:14:30
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5579/Downloader/TickerSelectors Modified Files: TickerSelectorForm.cs Log Message: Added checkBox to the form in order to visually interact with the TickerSelector class Index: TickerSelectorForm.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerSelectors/TickerSelectorForm.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TickerSelectorForm.cs 27 Jun 2004 19:21:42 -0000 1.4 --- TickerSelectorForm.cs 25 Jul 2004 12:14:18 -0000 1.5 *************** *** 57,60 **** --- 57,61 ---- private System.Windows.Forms.TextBox textBoxMaxNumOfReturnedTickers; private System.Windows.Forms.Label label3; + private System.Windows.Forms.CheckBox checkBoxASCMode; private DataTable tableOfSelectedTickers; *************** *** 66,73 **** this.dataGrid1.ContextMenu = new TickerViewerMenu(this); //TODO: complete comboBox's code with all possible types of selections ! this.comboBoxAvailableSelectionRules.Text = "Most liquid instruments"; ! this.comboBoxAvailableSelectionRules.Items.Add("Most liquid instruments"); ! this.comboBoxAvailableSelectionRules.Text = "Best performing instruments"; ! this.comboBoxAvailableSelectionRules.Items.Add("Best performing instruments"); } --- 67,74 ---- this.dataGrid1.ContextMenu = new TickerViewerMenu(this); //TODO: complete comboBox's code with all possible types of selections ! this.comboBoxAvailableSelectionRules.Text = "Liquidity"; ! this.comboBoxAvailableSelectionRules.Items.Add("Liquidity"); ! this.comboBoxAvailableSelectionRules.Text = "Performance"; ! this.comboBoxAvailableSelectionRules.Items.Add("Performance"); } *************** *** 123,126 **** --- 124,128 ---- this.dateTimePickerFirstDate = new System.Windows.Forms.DateTimePicker(); this.splitter1 = new System.Windows.Forms.Splitter(); + this.checkBoxASCMode = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); this.panel2.SuspendLayout(); *************** *** 163,166 **** --- 165,169 ---- // this.groupBoxSelectionRule.Controls.AddRange(new System.Windows.Forms.Control[] { + this.checkBoxASCMode, this.label3, this.comboBoxAvailableSelectionRules, *************** *** 175,179 **** this.groupBoxSelectionRule.Location = new System.Drawing.Point(8, 16); this.groupBoxSelectionRule.Name = "groupBoxSelectionRule"; ! this.groupBoxSelectionRule.Size = new System.Drawing.Size(376, 144); this.groupBoxSelectionRule.TabIndex = 14; this.groupBoxSelectionRule.TabStop = false; --- 178,182 ---- this.groupBoxSelectionRule.Location = new System.Drawing.Point(8, 16); this.groupBoxSelectionRule.Name = "groupBoxSelectionRule"; ! this.groupBoxSelectionRule.Size = new System.Drawing.Size(376, 184); this.groupBoxSelectionRule.TabIndex = 14; this.groupBoxSelectionRule.TabStop = false; *************** *** 269,272 **** --- 272,283 ---- this.splitter1.TabStop = false; // + // checkBoxASCMode + // + this.checkBoxASCMode.Location = new System.Drawing.Point(176, 144); + this.checkBoxASCMode.Name = "checkBoxASCMode"; + this.checkBoxASCMode.Size = new System.Drawing.Size(152, 24); + this.checkBoxASCMode.TabIndex = 27; + this.checkBoxASCMode.Text = "Order by ASC mode"; + // // TickerSelectorForm // *************** *** 288,317 **** - - - - - - // implementation of ITickerSelector interface public DataTable GetTableOfSelectedTickers() { - /* - DataTable dataTableOfDataGrid1 = (DataTable)this.dataGrid1.DataSource; - DataTable tableOfSelectedTickers = new DataTable(); - TickerDataTable.AddColumnsOfTickerTable(tableOfSelectedTickers); - int indexOfRow = 0; - while(indexOfRow != dataTableOfDataGrid1.Rows.Count) - { - if(this.dataGrid1.IsSelected(indexOfRow)) - { - DataRow dataRow = tableOfSelectedTickers.NewRow(); - dataRow["Ticker"] = (string)dataTableOfDataGrid1.Rows[indexOfRow][0]; - dataRow["CompanyName"] = (string)dataTableOfDataGrid1.Rows[indexOfRow][1]; - tableOfSelectedTickers.Rows.Add(dataRow); - } - indexOfRow++; - }*/ return TickerSelector.GetTableOfManuallySelectedTickers(this.dataGrid1); } --- 299,306 ---- *************** *** 331,354 **** private void buttonSelectTickers_Click(object sender, System.EventArgs e) { ! SelectionRule rule = new SelectionRule(this.GetTypeOfRuleSelectedByUser(), this.textBoxGroupID.Text, ! this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, ! Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! TickerSelector selector; ! if(this.textBoxGroupID.Text != "") ! selector= new TickerSelector(rule); ! else ! selector= new TickerSelector(this.tableOfSelectedTickers,rule); ! this.dataGrid1.DataSource = selector.GetTableOfSelectedTickers(); ! this.dataGrid1.Refresh(); } ! private SelectionType GetTypeOfRuleSelectedByUser() { ! SelectionType typeSelected = SelectionType.MostLiquid; ! if(this.comboBoxAvailableSelectionRules.Text == "Most liquid instruments") ! typeSelected = SelectionType.MostLiquid; ! else if (this.comboBoxAvailableSelectionRules.Text == "Best performing instruments") ! typeSelected = SelectionType.BestPerformer; return typeSelected; } --- 320,348 ---- private void buttonSelectTickers_Click(object sender, System.EventArgs e) { ! Cursor.Current = Cursors.WaitCursor; ! TickerSelector selector; ! if(this.textBoxGroupID.Text != "") ! selector= new TickerSelector(this.getTypeOfRuleSelectedByUser(), this.checkBoxASCMode.Checked, this.textBoxGroupID.Text, ! this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, ! Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! else ! selector= new TickerSelector(this.tableOfSelectedTickers, this.getTypeOfRuleSelectedByUser(), ! this.checkBoxASCMode.Checked, this.textBoxGroupID.Text, ! this.dateTimePickerFirstDate.Value, ! this.dateTimePickerLastDate.Value, ! Int32.Parse(this.textBoxMaxNumOfReturnedTickers.Text)); ! this.dataGrid1.DataSource = selector.GetTableOfSelectedTickers(); ! this.dataGrid1.Refresh(); ! Cursor.Current = Cursors.Default; } ! private SelectionType getTypeOfRuleSelectedByUser() { ! SelectionType typeSelected = SelectionType.Liquidity; ! if(this.comboBoxAvailableSelectionRules.Text == "Liquidity") ! typeSelected = SelectionType.Liquidity; ! else if (this.comboBoxAvailableSelectionRules.Text == "Performance") ! typeSelected = SelectionType.Performance; return typeSelected; } |