quantproject-developers Mailing List for QuantProject (Page 142)
Brought to you by:
glauco_1
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(103) |
Dec
(67) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(52) |
Feb
(9) |
Mar
(69) |
Apr
(53) |
May
(80) |
Jun
(23) |
Jul
(24) |
Aug
(112) |
Sep
(9) |
Oct
|
Nov
(58) |
Dec
(93) |
| 2005 |
Jan
(90) |
Feb
(93) |
Mar
(61) |
Apr
(56) |
May
(37) |
Jun
(61) |
Jul
(55) |
Aug
(68) |
Sep
(25) |
Oct
(46) |
Nov
(41) |
Dec
(37) |
| 2006 |
Jan
(33) |
Feb
(7) |
Mar
(19) |
Apr
(27) |
May
(73) |
Jun
(49) |
Jul
(83) |
Aug
(66) |
Sep
(45) |
Oct
(16) |
Nov
(15) |
Dec
(7) |
| 2007 |
Jan
(14) |
Feb
(33) |
Mar
|
Apr
(21) |
May
|
Jun
(34) |
Jul
(18) |
Aug
(100) |
Sep
(39) |
Oct
(55) |
Nov
(12) |
Dec
(2) |
| 2008 |
Jan
(120) |
Feb
(133) |
Mar
(129) |
Apr
(104) |
May
(42) |
Jun
(2) |
Jul
(52) |
Aug
(99) |
Sep
(134) |
Oct
|
Nov
(137) |
Dec
(48) |
| 2009 |
Jan
(48) |
Feb
(55) |
Mar
(61) |
Apr
(3) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(51) |
Sep
|
Oct
(7) |
Nov
|
Dec
|
| 2010 |
Jan
(7) |
Feb
(1) |
Mar
(145) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
|
| 2011 |
Jan
(78) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(88) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:39:07
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30602/Downloader Modified Files: QuotesDataGrid.cs Log Message: The column style has been improved (custom horizontal alignment and format are supported now) Index: QuotesDataGrid.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesDataGrid.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QuotesDataGrid.cs 25 Jan 2004 14:57:12 -0000 1.1 --- QuotesDataGrid.cs 21 Mar 2004 16:28:25 -0000 1.2 *************** *** 38,63 **** } #region setTableStyles ! private void setTableStyles_setColumnStyle( string mappingName , string headerText ) { - this.dataGridTableStyle.ColumnHeadersVisible = true; DataGridTextBoxColumn dataGridColumnStyle = new DataGridTextBoxColumn(); dataGridColumnStyle.MappingName = mappingName; dataGridColumnStyle.HeaderText = headerText; Graphics g = this.CreateGraphics(); dataGridColumnStyle.Width = (int)g.MeasureString( headerText , this.Font ).Width + 5; this.dataGridTableStyle.GridColumnStyles.Add( dataGridColumnStyle ); } private void setTableStyles() { this.dataGridTableStyle = new DataGridTableStyle(); this.dataGridTableStyle.MappingName = "quotes"; ! this.setTableStyles_setColumnStyle( "quTicker" , "Ticker" ); ! this.setTableStyles_setColumnStyle( "quDate" , "Date" ); ! this.setTableStyles_setColumnStyle( "quOpen" , "Open" ); ! this.setTableStyles_setColumnStyle( "quHigh" , "High" ); ! this.setTableStyles_setColumnStyle( "quLow" , "Low" ); ! this.setTableStyles_setColumnStyle( "quClose" , "Close" ); ! this.setTableStyles_setColumnStyle( "quAdjustedClose" , "Adj. Close" ); ! this.setTableStyles_setColumnStyle( "ValidationWarning" , "Warning" ); this.setTableStyles_setColumnStyle( "Yuppy" , "Ew" ); this.TableStyles.Add( dataGridTableStyle ); --- 38,80 ---- } #region setTableStyles ! private void setTableStyles_setColumnStyle( string mappingName , string headerText , ! HorizontalAlignment horizontalAlignment , string format ) { DataGridTextBoxColumn dataGridColumnStyle = new DataGridTextBoxColumn(); dataGridColumnStyle.MappingName = mappingName; dataGridColumnStyle.HeaderText = headerText; + dataGridColumnStyle.Alignment = horizontalAlignment; + dataGridColumnStyle.Format = format; + // dataGridColumnStyle.Format = "#,#.00"; Graphics g = this.CreateGraphics(); dataGridColumnStyle.Width = (int)g.MeasureString( headerText , this.Font ).Width + 5; this.dataGridTableStyle.GridColumnStyles.Add( dataGridColumnStyle ); } + private void setTableStyles_setColumnStyle( string mappingName , string headerText , + HorizontalAlignment horizontalAlignment ) + { + this.setTableStyles_setColumnStyle( mappingName , headerText , horizontalAlignment , + "#,#.00" ); + } + private void setTableStyles_setColumnStyle( string mappingName , string headerText ) + { + this.setTableStyles_setColumnStyle( mappingName , headerText , HorizontalAlignment.Left ); + } private void setTableStyles() { this.dataGridTableStyle = new DataGridTableStyle(); this.dataGridTableStyle.MappingName = "quotes"; ! this.RowHeaderWidth = 15; ! this.setTableStyles_setColumnStyle( "quTicker" , "Ticker" , HorizontalAlignment.Left , "" ); ! this.setTableStyles_setColumnStyle( "quDate" , "Date" , HorizontalAlignment.Left , "d" ); ! this.setTableStyles_setColumnStyle( "quOpen" , "Open" , HorizontalAlignment.Right , "#,#.00" ); ! this.setTableStyles_setColumnStyle( "quHigh" , "High" , HorizontalAlignment.Right , "#,#.00" ); ! this.setTableStyles_setColumnStyle( "quLow" , "Low" , HorizontalAlignment.Right , "#,#.00" ); ! this.setTableStyles_setColumnStyle( "quClose" , "Close" , HorizontalAlignment.Right , ! "#,#.00" ); ! this.setTableStyles_setColumnStyle( "quAdjustedClose" , "Adj. Close" , ! HorizontalAlignment.Right , "#,#.00" ); ! this.setTableStyles_setColumnStyle( "ValidationWarning" , "Warning" , ! HorizontalAlignment.Left , ""); this.setTableStyles_setColumnStyle( "Yuppy" , "Ew" ); this.TableStyles.Add( dataGridTableStyle ); |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:36:40
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29926/Downloader/QuotesEditor Modified Files: QuotesEditor.cs Log Message: The code has been completely restructured: many form controls have been moved from a visual tool aided placement, to a programmatic approach Index: QuotesEditor.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/QuotesEditor.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QuotesEditor.cs 25 Jan 2004 15:42:39 -0000 1.2 --- QuotesEditor.cs 21 Mar 2004 16:25:58 -0000 1.3 *************** *** 16,35 **** public class QuotesEditor : System.Windows.Forms.Form { ! private double suspiciousRatio = 8; ! private string ticker; ! private ValidateDataTable validateDataTable = new ValidateDataTable(); ! private System.Windows.Forms.TabControl tabControl1; ! private System.Windows.Forms.TabPage tabPageChart; ! private System.Windows.Forms.TabPage tabPageQuotes; ! private System.Windows.Forms.TabPage tabPageValidation; ! private System.Windows.Forms.TextBox textBoxTicker; ! private System.Windows.Forms.TabControl tabControl2; ! private System.Windows.Forms.TabPage tabPageOHLC; ! private System.Windows.Forms.TabPage tabPageCloseToClose; ! private QuantProject.Applications.Downloader.QuotesChart quotesChart; ! private QuantProject.Applications.Downloader.OHLCuserControl openHighLowCloseUserControl; ! private QuantProject.Applications.Downloader.CloseToCloseUserControl closeToCloseUserControl; /// <summary> /// Required designer variable. --- 16,31 ---- public class QuotesEditor : System.Windows.Forms.Form { ! private double suspiciousRatio = 8; ! private ValidateDataTable validateDataTable; ! private CloseToCloseTabPage closeToCloseTabPage = new CloseToCloseTabPage(); ! private ValidationTabPage validationTabPage = new ValidationTabPage(); ! private ValidationTabControl validationTabControl = new ValidationTabControl(); ! private System.Windows.Forms.TabControl tabControl1; ! private System.Windows.Forms.TabPage tabPageChart; ! private System.Windows.Forms.TabPage tabPageQuotes; ! private System.Windows.Forms.TextBox textBoxTicker; ! private QuantProject.Applications.Downloader.QuotesChart quotesChart; /// <summary> /// Required designer variable. *************** *** 37,233 **** private System.ComponentModel.Container components = null; ! public QuotesEditor( string ticker ) { ! // ! // Required for Windows Form Designer support ! // ! InitializeComponent(); ! ! this.ticker = ticker; } ! /// <summary> ! /// Clean up any resources being used. ! /// </summary> ! protected override void Dispose( bool disposing ) { ! if( disposing ) { ! if(components != null) { ! components.Dispose(); } } - base.Dispose( disposing ); } #region Windows Form Designer generated code ! /// <summary> ! /// Required method for Designer support - do not modify ! /// the contents of this method with the code editor. ! /// </summary> ! private void InitializeComponent() ! { ! this.tabControl1 = new System.Windows.Forms.TabControl(); ! this.tabPageChart = new System.Windows.Forms.TabPage(); ! this.quotesChart = new QuantProject.Applications.Downloader.QuotesChart(); ! this.tabPageQuotes = new System.Windows.Forms.TabPage(); ! this.tabPageValidation = new System.Windows.Forms.TabPage(); ! this.tabControl2 = new System.Windows.Forms.TabControl(); ! this.tabPageOHLC = new System.Windows.Forms.TabPage(); ! this.openHighLowCloseUserControl = new QuantProject.Applications.Downloader.OHLCuserControl(); ! this.tabPageCloseToClose = new System.Windows.Forms.TabPage(); ! this.closeToCloseUserControl = new QuantProject.Applications.Downloader.CloseToCloseUserControl(); ! this.textBoxTicker = new System.Windows.Forms.TextBox(); ! this.tabControl1.SuspendLayout(); ! this.tabPageChart.SuspendLayout(); ! this.tabPageValidation.SuspendLayout(); ! this.tabControl2.SuspendLayout(); ! this.tabPageOHLC.SuspendLayout(); ! this.tabPageCloseToClose.SuspendLayout(); ! this.SuspendLayout(); ! // ! // tabControl1 ! // ! this.tabControl1.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.tabPageChart, ! this.tabPageQuotes, ! this.tabPageValidation}); ! this.tabControl1.Location = new System.Drawing.Point(8, 40); ! this.tabControl1.Name = "tabControl1"; ! this.tabControl1.SelectedIndex = 0; ! this.tabControl1.Size = new System.Drawing.Size(688, 320); ! this.tabControl1.TabIndex = 0; ! // ! // tabPageChart ! // ! this.tabPageChart.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.quotesChart}); ! this.tabPageChart.Location = new System.Drawing.Point(4, 22); ! this.tabPageChart.Name = "tabPageChart"; ! this.tabPageChart.Size = new System.Drawing.Size(680, 294); ! this.tabPageChart.TabIndex = 2; ! this.tabPageChart.Text = "Chart"; ! this.tabPageChart.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageChart_Paint); ! // ! // quotesChart ! // ! this.quotesChart.AllowSelection = false; ! this.quotesChart.BackColor = System.Drawing.SystemColors.ControlLightLight; ! this.quotesChart.HorizontalEdgeLegendPlacement = scpl.Legend.Placement.Inside; ! this.quotesChart.LegendBorderStyle = scpl.Legend.BorderType.Shadow; ! this.quotesChart.LegendXOffset = 10F; ! this.quotesChart.LegendYOffset = 1F; ! this.quotesChart.Location = new System.Drawing.Point(8, 8); ! this.quotesChart.Name = "quotesChart"; ! this.quotesChart.Padding = 10; ! this.quotesChart.PlotBackColor = System.Drawing.Color.White; ! this.quotesChart.ShowLegend = false; ! this.quotesChart.Size = new System.Drawing.Size(664, 288); ! this.quotesChart.TabIndex = 0; ! this.quotesChart.Title = ""; ! this.quotesChart.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); ! this.quotesChart.VerticalEdgeLegendPlacement = scpl.Legend.Placement.Outside; ! this.quotesChart.XAxis1 = null; ! this.quotesChart.XAxis2 = null; ! this.quotesChart.YAxis1 = null; ! this.quotesChart.YAxis2 = null; ! // ! // tabPageQuotes ! // ! this.tabPageQuotes.Location = new System.Drawing.Point(4, 22); ! this.tabPageQuotes.Name = "tabPageQuotes"; ! this.tabPageQuotes.Size = new System.Drawing.Size(680, 294); ! this.tabPageQuotes.TabIndex = 0; ! this.tabPageQuotes.Text = "Quotes"; ! this.tabPageQuotes.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageChart_Paint); ! // ! // tabPageValidation ! // ! this.tabPageValidation.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.tabControl2}); ! this.tabPageValidation.Location = new System.Drawing.Point(4, 22); ! this.tabPageValidation.Name = "tabPageValidation"; ! this.tabPageValidation.Size = new System.Drawing.Size(680, 294); ! this.tabPageValidation.TabIndex = 1; ! this.tabPageValidation.Text = "Validation"; ! this.tabPageValidation.Click += new System.EventHandler(this.tabPageValidation_Click); ! this.tabPageValidation.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageValidation_Paint); ! // ! // tabControl2 ! // ! this.tabControl2.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.tabPageOHLC, ! this.tabPageCloseToClose}); ! this.tabControl2.Location = new System.Drawing.Point(8, 8); ! this.tabControl2.Multiline = true; ! this.tabControl2.Name = "tabControl2"; ! this.tabControl2.RightToLeft = System.Windows.Forms.RightToLeft.No; ! this.tabControl2.SelectedIndex = 0; ! this.tabControl2.Size = new System.Drawing.Size(664, 280); ! this.tabControl2.TabIndex = 0; ! // ! // tabPageOHLC ! // ! this.tabPageOHLC.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.openHighLowCloseUserControl}); ! this.tabPageOHLC.Location = new System.Drawing.Point(4, 22); ! this.tabPageOHLC.Name = "tabPageOHLC"; ! this.tabPageOHLC.Size = new System.Drawing.Size(656, 254); ! this.tabPageOHLC.TabIndex = 0; ! this.tabPageOHLC.Text = "OHLC"; ! this.tabPageOHLC.Click += new System.EventHandler(this.tabPageOHLC_Click); ! this.tabPageOHLC.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageOHLC_Paint); ! // ! // openHighLowCloseUserControl ! // ! this.openHighLowCloseUserControl.Location = new System.Drawing.Point(8, 8); ! this.openHighLowCloseUserControl.Name = "openHighLowCloseUserControl"; ! this.openHighLowCloseUserControl.Size = new System.Drawing.Size(646, 244); ! this.openHighLowCloseUserControl.TabIndex = 0; ! // ! // tabPageCloseToClose ! // ! this.tabPageCloseToClose.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.closeToCloseUserControl}); ! this.tabPageCloseToClose.Location = new System.Drawing.Point(4, 22); ! this.tabPageCloseToClose.Name = "tabPageCloseToClose"; ! this.tabPageCloseToClose.Size = new System.Drawing.Size(656, 254); ! this.tabPageCloseToClose.TabIndex = 1; ! this.tabPageCloseToClose.Text = "Close To Close"; ! this.tabPageCloseToClose.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageCloseToClose_Paint); ! // ! // closeToCloseUserControl ! // ! this.closeToCloseUserControl.Location = new System.Drawing.Point(8, 8); ! this.closeToCloseUserControl.Name = "closeToCloseUserControl"; ! this.closeToCloseUserControl.Size = new System.Drawing.Size(646, 244); ! this.closeToCloseUserControl.TabIndex = 0; ! // ! // textBoxTicker ! // ! this.textBoxTicker.Location = new System.Drawing.Point(288, 8); ! this.textBoxTicker.Name = "textBoxTicker"; ! this.textBoxTicker.TabIndex = 1; ! this.textBoxTicker.Text = "CCE"; ! // ! // QuotesEditor ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(704, 365); ! this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.textBoxTicker, ! this.tabControl1}); ! this.Name = "QuotesEditor"; ! this.Text = "QuotesEditor"; ! this.tabControl1.ResumeLayout(false); ! this.tabPageChart.ResumeLayout(false); ! this.tabPageValidation.ResumeLayout(false); ! this.tabControl2.ResumeLayout(false); ! this.tabPageOHLC.ResumeLayout(false); ! this.tabPageCloseToClose.ResumeLayout(false); ! this.ResumeLayout(false); ! } #endregion --- 33,189 ---- private System.ComponentModel.Container components = null; ! private void updateValidateDataTable() { ! if ( this.validateDataTable == null ) ! { ! this.validateDataTable = new ValidateDataTable(); ! } ! this.validateDataTable.Clear(); ! this.validateDataTable.Rows.Clear(); ! this.validateDataTable.AddRows( this.textBoxTicker.Text , ! this.suspiciousRatio ); } ! public ValidateDataTable ValidateDataTable { ! get { ! if ( this.validateDataTable == null ) { ! this.updateValidateDataTable(); } + return this.validateDataTable; } } + public string Ticker + { + get { return this.textBoxTicker.Text; } + } + public QuotesEditor( string ticker ) + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); + + + this.tabControl1.Width = this.Width - 20; + this.tabControl1.Height = this.Height - 80; + + this.validationTabPage.Controls.Add( this.validationTabControl ); + this.tabControl1.Controls.Add( this.validationTabPage ); + + this.textBoxTicker.Text = ticker; + } + + /// <summary> + /// Clean up any resources being used. + /// </summary> + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + #region Windows Form Designer generated code ! /// <summary> ! /// Required method for Designer support - do not modify ! /// the contents of this method with the code editor. ! /// </summary> ! private void InitializeComponent() ! { ! this.tabControl1 = new System.Windows.Forms.TabControl(); ! this.tabPageChart = new System.Windows.Forms.TabPage(); ! this.quotesChart = new QuantProject.Applications.Downloader.QuotesChart(); ! this.tabPageQuotes = new System.Windows.Forms.TabPage(); ! this.textBoxTicker = new System.Windows.Forms.TextBox(); ! this.tabControl1.SuspendLayout(); ! this.tabPageChart.SuspendLayout(); ! this.SuspendLayout(); ! // ! // tabControl1 ! // ! this.tabControl1.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.tabPageChart, ! this.tabPageQuotes}); ! this.tabControl1.Location = new System.Drawing.Point(8, 40); ! this.tabControl1.Name = "tabControl1"; ! this.tabControl1.SelectedIndex = 0; ! this.tabControl1.Size = new System.Drawing.Size(688, 320); ! this.tabControl1.TabIndex = 0; ! // ! // tabPageChart ! // ! this.tabPageChart.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.quotesChart}); ! this.tabPageChart.Location = new System.Drawing.Point(4, 22); ! this.tabPageChart.Name = "tabPageChart"; ! this.tabPageChart.Size = new System.Drawing.Size(680, 294); ! this.tabPageChart.TabIndex = 2; ! this.tabPageChart.Text = "Chart"; ! this.tabPageChart.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageChart_Paint); ! // ! // quotesChart ! // ! this.quotesChart.AllowSelection = false; ! this.quotesChart.BackColor = System.Drawing.SystemColors.ControlLightLight; ! this.quotesChart.HorizontalEdgeLegendPlacement = scpl.Legend.Placement.Inside; ! this.quotesChart.LegendBorderStyle = scpl.Legend.BorderType.Shadow; ! this.quotesChart.LegendXOffset = 10F; ! this.quotesChart.LegendYOffset = 1F; ! this.quotesChart.Location = new System.Drawing.Point(8, 8); ! this.quotesChart.Name = "quotesChart"; ! this.quotesChart.Padding = 10; ! this.quotesChart.PlotBackColor = System.Drawing.Color.White; ! this.quotesChart.ShowLegend = false; ! this.quotesChart.Size = new System.Drawing.Size(664, 288); ! this.quotesChart.TabIndex = 0; ! this.quotesChart.Ticker = null; ! this.quotesChart.Title = ""; ! this.quotesChart.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); ! this.quotesChart.VerticalEdgeLegendPlacement = scpl.Legend.Placement.Outside; ! this.quotesChart.XAxis1 = null; ! this.quotesChart.XAxis2 = null; ! this.quotesChart.YAxis1 = null; ! this.quotesChart.YAxis2 = null; ! // ! // tabPageQuotes ! // ! this.tabPageQuotes.Location = new System.Drawing.Point(4, 22); ! this.tabPageQuotes.Name = "tabPageQuotes"; ! this.tabPageQuotes.Size = new System.Drawing.Size(680, 294); ! this.tabPageQuotes.TabIndex = 0; ! this.tabPageQuotes.Text = "Quotes"; ! this.tabPageQuotes.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPageChart_Paint); ! // ! // textBoxTicker ! // ! this.textBoxTicker.Location = new System.Drawing.Point(288, 8); ! this.textBoxTicker.Name = "textBoxTicker"; ! this.textBoxTicker.TabIndex = 1; ! this.textBoxTicker.Text = "CCE"; ! this.textBoxTicker.Leave += new System.EventHandler(this.textBoxTicker_Leave); ! // ! // QuotesEditor ! // ! this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(736, 373); ! this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.textBoxTicker, ! this.tabControl1}); ! this.Name = "QuotesEditor"; ! this.Text = "QuotesEditor"; ! this.tabControl1.ResumeLayout(false); ! this.tabPageChart.ResumeLayout(false); ! this.ResumeLayout(false); ! } #endregion *************** *** 237,240 **** --- 193,197 ---- { this.quotesChart.Ticker = this.textBoxTicker.Text; + this.quotesChart.Invalidate(); // quotesChart.PaintingHandler( this.textBoxTicker.Text ); } *************** *** 244,256 **** private void tabPageValidation_Click(object sender, System.EventArgs e) { ! } ! ! private void tabPageValidation_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! this.validateDataTable.Clear(); this.validateDataTable.AddRows( this.textBoxTicker.Text , this.suspiciousRatio ); ! this.openHighLowCloseUserControl.ValidateDataTable = this.validateDataTable; ! this.closeToCloseUserControl.ValidateDataTable = this.validateDataTable; ! this.closeToCloseUserControl.Ticker = this.textBoxTicker.Text; } --- 201,208 ---- private void tabPageValidation_Click(object sender, System.EventArgs e) { ! this.validateDataTable.Rows.Clear(); this.validateDataTable.AddRows( this.textBoxTicker.Text , this.suspiciousRatio ); ! // this.openHighLowCloseUserControl.ValidateDataTable = this.validateDataTable; ! // this.closeToCloseUserControl.Ticker = this.textBoxTicker.Text; } *************** *** 270,281 **** private void openHighLowCloseUserControl_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { ! this.openHighLowCloseUserControl.PaintingHandler(); } private void tabPageCloseToClose_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { ! this.closeToCloseUserControl.PaintingHandler(); } } } --- 222,260 ---- private void openHighLowCloseUserControl_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { ! // this.openHighLowCloseUserControl.PaintingHandler(); } private void tabPageCloseToClose_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { ! // this.closeToCloseUserControl.PaintingHandler(); ! } ! ! private void tabPageValidation_Enter(object sender, System.EventArgs e) ! { ! this.validateDataTable.Rows.Clear(); ! this.validateDataTable.AddRows( this.textBoxTicker.Text , this.suspiciousRatio ); ! // this.openHighLowCloseUserControl.ValidateDataTable = this.validateDataTable; ! // this.closeToCloseUserControl.Ticker = this.textBoxTicker.Text; ! } ! ! private void tabControl1_SelectedIndexChanged(object sender, System.EventArgs e) ! { ! if ( this.tabControl1.SelectedIndex == 2 ) ! { ! // this.validateDataTable.Rows.Clear(); ! // this.validateDataTable.AddRows( this.textBoxTicker.Text , this.suspiciousRatio ); ! // this.openHighLowCloseUserControl.ValidateDataTable = this.validateDataTable; ! // this.closeToCloseUserControl.Ticker = this.textBoxTicker.Text; ! } } + private void textBoxTicker_Leave(object sender, System.EventArgs e) + { + this.tabPageChart.Invalidate(); + this.validationTabControl.Clear(); + this.updateValidateDataTable(); + this.validationTabControl.Rebuild(); + } + } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:33:32
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29279/Downloader/Validate Modified Files: ValidateDataTable.cs Log Message: The code to add the CloseToCloseHasBeenVisuallyValidated boolean datacolumn has been fixed Index: ValidateDataTable.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/ValidateDataTable.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ValidateDataTable.cs 26 Jan 2004 23:01:31 -0000 1.9 --- ValidateDataTable.cs 21 Mar 2004 16:22:57 -0000 1.10 *************** *** 63,68 **** this.oleDbDataAdapter.UpdateCommand = this.oleDbCommandBuilder.GetUpdateCommand(); this.oleDbDataAdapter.Fill( this ); ! this.Columns.Add( new DataColumn( "CloseToCloseHasBeenVisuallyValidated" , ! System.Type.GetType( "System.Boolean" ) ) ); this.TableName = "quotes"; //<<<<<<< ValidateDataTable.cs --- 63,70 ---- this.oleDbDataAdapter.UpdateCommand = this.oleDbCommandBuilder.GetUpdateCommand(); this.oleDbDataAdapter.Fill( this ); ! DataColumn dataColumn = new DataColumn( "CloseToCloseHasBeenVisuallyValidated" , ! System.Type.GetType( "System.Boolean" ) ); ! dataColumn.DefaultValue = false; ! this.Columns.Add( dataColumn ); this.TableName = "quotes"; //<<<<<<< ValidateDataTable.cs |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:31:28
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29041/Downloader/Validate Modified Files: ValidateForm.cs Log Message: The private variable validateDataTable is properly initialized now Index: ValidateForm.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/ValidateForm.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ValidateForm.cs 4 Feb 2004 19:33:40 -0000 1.8 --- ValidateForm.cs 21 Mar 2004 16:21:20 -0000 1.9 *************** *** 16,20 **** private System.Windows.Forms.Button buttonGo; private System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1; ! private ValidateDataTable validateDataTable; private DataTable tableOfTickersToBeValidated; private System.Data.OleDb.OleDbCommand oleDbSelectCommand1; --- 16,20 ---- private System.Windows.Forms.Button buttonGo; private System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1; ! private ValidateDataTable validateDataTable = new ValidateDataTable(); private DataTable tableOfTickersToBeValidated; private System.Data.OleDb.OleDbCommand oleDbSelectCommand1; |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:29:57
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28677 Modified Files: QuantProject.suo Log Message: Added the HashProvider class and other minor changes Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 Binary files /tmp/cvs5c7bOq and /tmp/cvsJucoal differ |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:29:14
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28374/b1_ADT Modified Files: b1_ADT.csproj Log Message: Added the HashProvider class Index: b1_ADT.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/b1_ADT.csproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** b1_ADT.csproj 20 Dec 2003 18:39:37 -0000 1.4 --- b1_ADT.csproj 21 Mar 2004 16:18:41 -0000 1.5 *************** *** 98,101 **** --- 98,106 ---- /> <File + RelPath = "HashProvider.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Keyed.cs" SubType = "Code" |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:28:08
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28137/b2_DataAccess Modified Files: b2_DataAccess.csproj Log Message: Added a connection open call Index: b2_DataAccess.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/b2_DataAccess.csproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** b2_DataAccess.csproj 1 Jan 2004 19:08:17 -0000 1.4 --- b2_DataAccess.csproj 21 Mar 2004 16:17:31 -0000 1.5 *************** *** 113,120 **** --- 113,140 ---- /> <File + RelPath = "OleDbSingleTableAdapter.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "SQLBuilder.cs" SubType = "Code" BuildAction = "Compile" /> + <File + RelPath = "SqlExecutor.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Tables\Quotes.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Tables\VisuallyValidatedTickers.cs" + SubType = "Code" + BuildAction = "Compile" + /> </Include> </Files> |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:27:07
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27973/b2_DataAccess Modified Files: ConnectionProvider.cs Log Message: Added a connection open call Index: ConnectionProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/ConnectionProvider.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConnectionProvider.cs 3 Jan 2004 16:05:59 -0000 1.3 --- ConnectionProvider.cs 21 Mar 2004 16:16:51 -0000 1.4 *************** *** 56,59 **** --- 56,60 ---- @";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"; oleDbConnection = new OleDbConnection( connectionString ); + oleDbConnection.Open(); DataBaseVersionManager dataBaseVersionManager = new DataBaseVersionManager(oleDbConnection); dataBaseVersionManager.UpdateDataBaseStructure(); |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:26:04
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27759/b2_DataAccess Modified Files: DataBaseVersionManager.cs Log Message: Unneeded connection closing and opening are avoided now Index: DataBaseVersionManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DataBaseVersionManager.cs 9 Feb 2004 17:32:07 -0000 1.8 --- DataBaseVersionManager.cs 21 Mar 2004 16:15:56 -0000 1.9 *************** *** 77,81 **** { this.oleDbConnection = oleDbConnection; - this.oleDbConnection.Open(); this.initialize_updatingMethods(); } --- 77,80 ---- *************** *** 213,222 **** handler(); } - this.oleDbConnection.Close(); } catch(Exception ex) { MessageBox.Show(ex.ToString()); - this.oleDbConnection.Close(); } } --- 212,219 ---- |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:24:41
|
Update of /cvsroot/quantproject/QuantProject/b3_Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27273/b3_Data Modified Files: DataProvider.cs Log Message: Added GetHighHistory and GetLowHistory Index: DataProvider.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataProvider.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DataProvider.cs 3 Jan 2004 16:17:41 -0000 1.2 --- DataProvider.cs 21 Mar 2004 16:13:58 -0000 1.3 *************** *** 89,106 **** } ! public static History GetCloseHistory( string instrumentKey ) ! { ! if ( ( !cachedHistories.Contains( instrumentKey ) ) || ! ( !((Hashtable)cachedHistories[ instrumentKey ]).Contains( BarComponent.Close ) ) ) ! { ! Add( instrumentKey , BarComponent.Close ); ! ((Hashtable)cachedHistories[ instrumentKey ])[ BarComponent.Close ] = ! DataBase.GetHistory( instrumentKey , BarComponent.Close ); ! } ! return (History)((Hashtable)cachedHistories[ instrumentKey ])[ ! BarComponent.Close ]; ! } ! public static double GetMarketValue( string instrumentKey , ExtendedDateTime extendedDateTime ) { //DateTime dateTime = --- 89,128 ---- } ! private static History getHistory( string instrumentKey , BarComponent barComponent ) ! { ! if ( ( !cachedHistories.Contains( instrumentKey ) ) || ! ( !((Hashtable)cachedHistories[ instrumentKey ]).Contains( barComponent ) ) ) ! { ! Add( instrumentKey , barComponent ); ! ((Hashtable)cachedHistories[ instrumentKey ])[ barComponent ] = ! DataBase.GetHistory( instrumentKey , barComponent ); ! } ! return (History)((Hashtable)cachedHistories[ instrumentKey ])[ barComponent ]; ! } ! public static History GetCloseHistory( string instrumentKey ) ! { ! if ( ( !cachedHistories.Contains( instrumentKey ) ) || ! ( !((Hashtable)cachedHistories[ instrumentKey ]).Contains( BarComponent.Close ) ) ) ! { ! Add( instrumentKey , BarComponent.Close ); ! ((Hashtable)cachedHistories[ instrumentKey ])[ BarComponent.Close ] = ! DataBase.GetHistory( instrumentKey , BarComponent.Close ); ! } ! return (History)((Hashtable)cachedHistories[ instrumentKey ])[ ! BarComponent.Close ]; ! } ! ! public static History GetHighHistory( string instrumentKey ) ! { ! return getHistory( instrumentKey , BarComponent.High ); ! } ! ! public static History GetLowHistory( string instrumentKey ) ! { ! return getHistory( instrumentKey , BarComponent.Low ); ! } ! ! public static double GetMarketValue( string instrumentKey , ExtendedDateTime extendedDateTime ) { //DateTime dateTime = |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:21:46
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26490/b1_ADT Added Files: HashProvider.cs Log Message: Provides hashing values --- NEW FILE: HashProvider.cs --- using System; using System.Security.Cryptography; namespace QuantProject.ADT { /// <summary> /// Provides hashing values /// </summary> public class HashProvider { public HashProvider() { // // TODO: Add constructor logic here // } /// <summary> /// Returns an hash value for the string toBeHashed /// </summary> /// <param name="toBeHashed">parameter for which the hash value must be computed</param> /// <returns>Computed hash value</returns> public static string GetHashValue( string toBeHashed ) { SHA1CryptoServiceProvider sha1CryptoServiceProvider = new SHA1CryptoServiceProvider(); // converts the original string to an array of bytes byte[] bytes = System.Text.Encoding.UTF8.GetBytes( toBeHashed ); // computes the Hash, and returns an array of bytes byte[] hashBytes = sha1CryptoServiceProvider.ComputeHash( bytes ); sha1CryptoServiceProvider.Clear(); // returns a base 64 encoded string of the hash value return Convert.ToBase64String( hashBytes ); } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:21:18
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26368/b2_DataAccess Added Files: OleDbSingleTableAdapter.cs Log Message: Returns a complete OleDbDataAdapter (with proper edit commands already set) to work with the given table --- NEW FILE: OleDbSingleTableAdapter.cs --- using System; using System.Data; using System.Data.OleDb; namespace QuantProject.DataAccess { /// <summary> /// Returns a complete OleDbDataAdapter (with proper edit commands already set) to work with /// the given table /// </summary> public class OleDbSingleTableAdapter { private string tableName; public string TableName { get { return this.tableName; } set { this.tableName = value; } } private OleDbDataAdapter oleDbDataAdapter; public OleDbDataAdapter OleDbDataAdapter { get { return this.oleDbDataAdapter; } } private DataTable dataTable; public DataTable DataTable { get { return this.dataTable; } } public OleDbSingleTableAdapter( string selectStatement ) { try { // string selectStatement = // "select * from " + tableName + " where 1=2"; this.oleDbDataAdapter = new OleDbDataAdapter( selectStatement , ConnectionProvider.OleDbConnection ); OleDbCommandBuilder oleDbCommandBuilder = new OleDbCommandBuilder( oleDbDataAdapter ); this.oleDbDataAdapter.InsertCommand = oleDbCommandBuilder.GetInsertCommand(); this.oleDbDataAdapter.UpdateCommand = oleDbCommandBuilder.GetUpdateCommand(); this.oleDbDataAdapter.DeleteCommand = oleDbCommandBuilder.GetDeleteCommand(); this.dataTable = new DataTable(); this.oleDbDataAdapter.Fill( this.dataTable ); } catch ( Exception ex ) { string exceptionMessage = ex.Message + "\n" + ex.StackTrace; Console.WriteLine( exceptionMessage ); } } // public void SetAdapterAndDataTable( string tableName ) // { // } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:20:23
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26190/b2_DataAccess Added Files: SqlExecutor.cs Log Message: Executes Sql queries returning a DataTable --- NEW FILE: SqlExecutor.cs --- using System; using System.Data; using System.Data.OleDb; namespace QuantProject.DataAccess { /// <summary> /// Executes Sql queries returning a DataTable /// </summary> public class SqlExecutor { public SqlExecutor() { // // TODO: Add constructor logic here // } public static DataTable GetDataTable( string SqlQuery ) { DataTable dataTable = new DataTable(); OleDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter( SqlQuery , ConnectionProvider.OleDbConnection ); oleDbDataAdapter.Fill( dataTable ); return dataTable; } public static void ExecuteNonQuery( string SqlNonQuery ) { OleDbCommand oleDbCommand = new OleDbCommand( SqlNonQuery , ConnectionProvider.OleDbConnection ); oleDbCommand.ExecuteNonQuery(); } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-21 16:19:46
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26022/b2_DataAccess/Tables Added Files: VisuallyValidatedTickers.cs Log Message: Class to access the VisuallyValidatedTickers table --- NEW FILE: VisuallyValidatedTickers.cs --- using System; using System.Data; using QuantProject.DataAccess; namespace QuantProject.DataAccess.Tables { /// <summary> /// Class to access the VisuallyValidatedTickers table /// </summary> public class VisuallyValidatedTickers { private string ticker; public string Ticker { get { return this.ticker; } set { this.ticker = value; } } public VisuallyValidatedTickers() { // // TODO: Add constructor logic here // } /// <summary> /// writes to the database the visual validation of the Close to Close suspicious ratios /// </summary> /// <param name="ticker">ticker to be validated</param> public static void ValidateCloseToClose( string ticker ) { try { OleDbSingleTableAdapter oleDbSingleTableAdapter = new OleDbSingleTableAdapter( "select * from visuallyValidatedTickers where vvTicker='" + ticker + "'" ); string hashValue = Quotes.GetHashValue( ticker ); if ( oleDbSingleTableAdapter.DataTable.Rows.Count == 0 ) // this ticker was not visually validated yet oleDbSingleTableAdapter.DataTable.Rows.Add( oleDbSingleTableAdapter.DataTable.NewRow() ); else if ( ( (DateTime)oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvEndDate" ] != Quotes.GetEndDate( ticker ) ) || ( (DateTime)oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvEndDate" ] != Quotes.GetEndDate( ticker ) ) || ( (string)oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvHashValue" ] != hashValue ) ) // this ticker was visually already validated, but with different values oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvRangeToRangeRatio" ] = true; oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvTicker" ] = ticker; oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvStartDate" ] = Quotes.GetStartDate( ticker ); oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvEndDate" ] = Quotes.GetEndDate( ticker ); oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvHashValue" ] = hashValue; oleDbSingleTableAdapter.DataTable.Rows[ 0 ][ "vvCloseToCloseRatio" ] = true; oleDbSingleTableAdapter.OleDbDataAdapter.Update( oleDbSingleTableAdapter.DataTable ); } catch ( Exception ex ) { string exceptionMessage = ex.Message + "\n" + ex.StackTrace; Console.WriteLine( exceptionMessage ); } } } } |
|
From: Glauco S. <gla...@us...> - 2004-03-18 22:47:03
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27314 Added Files: Quotes.cs Log Message: Class to access the Quotes table --- NEW FILE: Quotes.cs --- using System; using System.Data; using System.Text; using QuantProject.ADT; namespace QuantProject.DataAccess.Tables { /// <summary> /// Class to access the Quotes table /// </summary> public class Quotes { public Quotes() { // // TODO: Add constructor logic here // } /// <summary> /// Returns the first date for the given ticker /// </summary> /// <param name="ticker">ticker for which the starting date has to be returned</param> /// <returns></returns> public static DateTime GetStartDate( string ticker ) { DataTable dataTable = SqlExecutor.GetDataTable( "select * from quotes where quTicker='" + ticker + "'" ); return (DateTime)(dataTable.Rows[ 0 ][ "quDate" ]); } /// <summary> /// Returns the last date for the given ticker /// </summary> /// <param name="ticker">ticker for which the lasat date has to be returned</param> /// <returns></returns> public static DateTime GetEndDate( string ticker ) { DataTable dataTable = SqlExecutor.GetDataTable( "select * from quotes where quTicker='" + ticker + "'" ); return (DateTime)(dataTable.Rows[ 0 ][ "quDate" ]); } #region GetHashValue private static string getHashValue_getQuoteString_getRowString_getSingleValueString( Object value ) { string returnValue; if ( value.GetType() == Type.GetType( "System.DateTime" ) ) returnValue = ( (DateTime) value ).ToString(); else { if ( value.GetType() == Type.GetType( "System.Double" ) ) returnValue = ( (float) value ).ToString( "F2" ); else returnValue = value.ToString(); } return returnValue + ";"; } /// <summary> /// Computes the string representing the concatenation for a single quote row /// </summary> /// <param name="dataRow"></param> /// <returns></returns> private static StringBuilder getHashValue_getQuoteString_getRowString( DataRow dataRow ) { StringBuilder returnValue = new StringBuilder( "" ); foreach ( DataColumn dataColumn in dataRow.Table.Columns ) if ( dataColumn.ColumnName != "quTicker" ) returnValue.Append( getHashValue_getQuoteString_getRowString_getSingleValueString( dataRow[ dataColumn ] ) ); // returnValue += "ggg"; // returnValue += getHashValue_getQuoteString_getRowString_getSingleValueString( // dataRow[ dataColumn ] ); return returnValue; } /// <summary> /// Computes the string representing the concatenation of all the quotes /// </summary> /// <param name="ticker"></param> /// <returns></returns> private static string getHashValue_getQuoteString( string ticker ) { StringBuilder returnValue = new StringBuilder( "" ); DataTable dataTable = SqlExecutor.GetDataTable( "select * from quotes where quTicker='" + ticker + "'" ); foreach ( DataRow dataRow in dataTable.Rows ) returnValue.Append( getHashValue_getQuoteString_getRowString( dataRow ) ); return returnValue.ToString(); } /// <summary> /// Computes the hash value for the quotes for the given ticker /// </summary> /// <param name="ticker">Ticker whose quotes must be hashed</param> /// <returns>Hash value for all the quotes for the given ticker</returns> public static string GetHashValue( string ticker ) { return HashProvider.GetHashValue( getHashValue_getQuoteString( ticker ) ); } #endregion } } |
|
From: Glauco S. <gla...@us...> - 2004-03-18 22:45:37
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27062/Tables Log Message: Directory /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables added to the repository |
|
From: <mi...@us...> - 2004-02-09 17:35:28
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25505/b2_DataAccess Modified Files: DataBaseVersionManager.cs Log Message: Added code for creation of table faultyTickers (used in downloading methods) Index: DataBaseVersionManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DataBaseVersionManager.cs 4 Feb 2004 19:39:19 -0000 1.7 --- DataBaseVersionManager.cs 9 Feb 2004 17:32:07 -0000 1.8 *************** *** 152,155 **** --- 152,160 ---- "qsEditDate DATETIME , " + "CONSTRAINT myKey PRIMARY KEY ( qsTicker , qsDate , qsSource ) )" ); + + // faultyTickers will contain tickers not downloaded from the web + this.executeCommand( "CREATE TABLE faultyTickers " + + "(ftTicker TEXT(8) , " + + "ftDate DATETIME)"); } |
|
From: <mi...@us...> - 2004-02-09 17:26:16
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23381/Downloader Modified Files: TickerViewer.cs Log Message: Fixed some bugs in GUI properties Index: TickerViewer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerViewer.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TickerViewer.cs 4 Feb 2004 19:29:12 -0000 1.4 --- TickerViewer.cs 9 Feb 2004 17:23:00 -0000 1.5 *************** *** 54,57 **** --- 54,58 ---- private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Splitter splitter1; + private System.Windows.Forms.MenuItem menuItemCopySelectedTickersToClipboard; private DataTable tableTickers; *************** *** 103,106 **** --- 104,108 ---- this.panel2 = new System.Windows.Forms.Panel(); this.splitter1 = new System.Windows.Forms.Splitter(); + this.menuItemCopySelectedTickersToClipboard = new System.Windows.Forms.MenuItem(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); this.panel1.SuspendLayout(); *************** *** 112,116 **** this.textBoxStringToFind.Location = new System.Drawing.Point(16, 32); this.textBoxStringToFind.Name = "textBoxStringToFind"; ! this.textBoxStringToFind.Size = new System.Drawing.Size(176, 20); this.textBoxStringToFind.TabIndex = 0; this.textBoxStringToFind.Text = "%"; --- 114,118 ---- this.textBoxStringToFind.Location = new System.Drawing.Point(16, 32); this.textBoxStringToFind.Name = "textBoxStringToFind"; ! this.textBoxStringToFind.Size = new System.Drawing.Size(136, 20); this.textBoxStringToFind.TabIndex = 0; this.textBoxStringToFind.Text = "%"; *************** *** 127,133 **** // textBoxStringToFindInName // this.textBoxStringToFindInName.Location = new System.Drawing.Point(16, 112); this.textBoxStringToFindInName.Name = "textBoxStringToFindInName"; ! this.textBoxStringToFindInName.Size = new System.Drawing.Size(176, 20); this.textBoxStringToFindInName.TabIndex = 4; this.textBoxStringToFindInName.Text = "%"; --- 129,136 ---- // textBoxStringToFindInName // + this.textBoxStringToFindInName.AllowDrop = true; this.textBoxStringToFindInName.Location = new System.Drawing.Point(16, 112); this.textBoxStringToFindInName.Name = "textBoxStringToFindInName"; ! this.textBoxStringToFindInName.Size = new System.Drawing.Size(136, 20); this.textBoxStringToFindInName.TabIndex = 4; this.textBoxStringToFindInName.Text = "%"; *************** *** 136,147 **** // dataGrid1 // this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.None; this.dataGrid1.ContextMenu = this.contextMenuTickerViewer; this.dataGrid1.DataMember = ""; - this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGrid1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.dataGrid1.Name = "dataGrid1"; ! this.dataGrid1.Size = new System.Drawing.Size(200, 478); this.dataGrid1.TabIndex = 2; // --- 139,152 ---- // dataGrid1 // + this.dataGrid1.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right); this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.None; this.dataGrid1.ContextMenu = this.contextMenuTickerViewer; this.dataGrid1.DataMember = ""; this.dataGrid1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.dataGrid1.Name = "dataGrid1"; ! this.dataGrid1.Size = new System.Drawing.Size(270, 478); this.dataGrid1.TabIndex = 2; // *************** *** 150,154 **** this.contextMenuTickerViewer.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItemValidateCurrentRows, ! this.menuItemDownloadCurrentRows}); // // menuItemValidateCurrentRows --- 155,160 ---- this.contextMenuTickerViewer.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItemValidateCurrentRows, ! this.menuItemDownloadCurrentRows, ! this.menuItemCopySelectedTickersToClipboard}); // // menuItemValidateCurrentRows *************** *** 179,183 **** this.panel1.Dock = System.Windows.Forms.DockStyle.Left; this.panel1.Name = "panel1"; ! this.panel1.Size = new System.Drawing.Size(200, 478); this.panel1.TabIndex = 4; // --- 185,189 ---- this.panel1.Dock = System.Windows.Forms.DockStyle.Left; this.panel1.Name = "panel1"; ! this.panel1.Size = new System.Drawing.Size(288, 478); this.panel1.TabIndex = 4; // *************** *** 195,199 **** this.label2.Location = new System.Drawing.Point(16, 88); this.label2.Name = "label2"; ! this.label2.Size = new System.Drawing.Size(168, 16); this.label2.TabIndex = 5; this.label2.Text = "Company Name is like"; --- 201,205 ---- this.label2.Location = new System.Drawing.Point(16, 88); this.label2.Name = "label2"; ! this.label2.Size = new System.Drawing.Size(136, 16); this.label2.TabIndex = 5; this.label2.Text = "Company Name is like"; *************** *** 209,215 **** this.label1}); this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; ! this.panel2.Location = new System.Drawing.Point(200, 0); this.panel2.Name = "panel2"; ! this.panel2.Size = new System.Drawing.Size(200, 478); this.panel2.TabIndex = 7; // --- 215,221 ---- this.label1}); this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; ! this.panel2.Location = new System.Drawing.Point(288, 0); this.panel2.Name = "panel2"; ! this.panel2.Size = new System.Drawing.Size(184, 478); this.panel2.TabIndex = 7; // *************** *** 217,221 **** // this.splitter1.BackColor = System.Drawing.SystemColors.Highlight; ! this.splitter1.Location = new System.Drawing.Point(200, 0); this.splitter1.Name = "splitter1"; this.splitter1.Size = new System.Drawing.Size(3, 478); --- 223,227 ---- // this.splitter1.BackColor = System.Drawing.SystemColors.Highlight; ! this.splitter1.Location = new System.Drawing.Point(288, 0); this.splitter1.Name = "splitter1"; this.splitter1.Size = new System.Drawing.Size(3, 478); *************** *** 223,230 **** this.splitter1.TabStop = false; // // TickerViewer // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(400, 478); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.splitter1, --- 229,242 ---- this.splitter1.TabStop = false; // + // menuItemCopySelectedTickersToClipboard + // + this.menuItemCopySelectedTickersToClipboard.Index = 2; + this.menuItemCopySelectedTickersToClipboard.Text = "Copy selected tickers to clipboard"; + this.menuItemCopySelectedTickersToClipboard.Click += new System.EventHandler(this.menuItemCopySelectedTickersToClipboard_Click); + // // TickerViewer // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(472, 478); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.splitter1, *************** *** 248,251 **** --- 260,264 ---- { DataGridTableStyle dataGrid1TableStyle = new DataGridTableStyle(); + //this.dataGrid1.Width = 300; dataGrid1TableStyle.MappingName = "tickers"; dataGrid1TableStyle.ColumnHeadersVisible = true; *************** *** 257,260 **** --- 270,274 ---- columnStyle_tiTicker.TextBox.Enabled = false; columnStyle_tiTicker.NullText = ""; + columnStyle_tiTicker.Width = 60; DataGridTextBoxColumn columnStyle_tiCompanyName = new DataGridTextBoxColumn(); columnStyle_tiCompanyName.MappingName = "tiCompanyName"; *************** *** 262,265 **** --- 276,280 ---- columnStyle_tiCompanyName.TextBox.Enabled = false; columnStyle_tiCompanyName.NullText = ""; + columnStyle_tiCompanyName.Width = 150; dataGrid1TableStyle.GridColumnStyles.Add(columnStyle_tiTicker); dataGrid1TableStyle.GridColumnStyles.Add(columnStyle_tiCompanyName); *************** *** 281,285 **** { Cursor.Current = Cursors.WaitCursor; ! this.oleDbConnection.Open(); string criteria = "SELECT * FROM tickers WHERE tiTicker LIKE '" + this.textBoxStringToFind.Text + "'" + --- 296,301 ---- { Cursor.Current = Cursors.WaitCursor; ! if(this.oleDbConnection.State != ConnectionState.Open) ! this.oleDbConnection.Open(); string criteria = "SELECT * FROM tickers WHERE tiTicker LIKE '" + this.textBoxStringToFind.Text + "'" + *************** *** 316,320 **** ! private DataTable getTableOfSelectedTickers() { DataTable dataTableOfDataGrid1 = (DataTable)this.dataGrid1.DataSource; --- 332,336 ---- ! internal DataTable GetTableOfSelectedTickers() { DataTable dataTableOfDataGrid1 = (DataTable)this.dataGrid1.DataSource; *************** *** 329,332 **** --- 345,349 ---- DataRow dataRow = tableOfSelectedTickers.NewRow(); dataRow[0] = (string)dataTableOfDataGrid1.Rows[indexOfRow][0]; + dataRow[1] = (string)dataTableOfDataGrid1.Rows[indexOfRow][1]; tableOfSelectedTickers.Rows.Add(dataRow); } *************** *** 338,342 **** private void menuItemValidateCurrentRows_Click(object sender, System.EventArgs e) { ! DataTable tableOfSelectedTickers = this.getTableOfSelectedTickers(); if(tableOfSelectedTickers.Rows.Count == 0) { --- 355,359 ---- private void menuItemValidateCurrentRows_Click(object sender, System.EventArgs e) { ! DataTable tableOfSelectedTickers = this.GetTableOfSelectedTickers(); if(tableOfSelectedTickers.Rows.Count == 0) { *************** *** 348,352 **** } QuantProject.Applications.Downloader.Validate.ValidateForm validateForm = ! new Validate.ValidateForm(this.getTableOfSelectedTickers()); validateForm.Show(); } --- 365,369 ---- } QuantProject.Applications.Downloader.Validate.ValidateForm validateForm = ! new Validate.ValidateForm(this.GetTableOfSelectedTickers()); validateForm.Show(); } *************** *** 354,361 **** private void menuItemDownloadCurrentRows_Click(object sender, System.EventArgs e) { ! WebDownloader webDownloader = new WebDownloader(this.getTableOfSelectedTickers()); webDownloader.Show(); } --- 371,397 ---- private void menuItemDownloadCurrentRows_Click(object sender, System.EventArgs e) { ! DataTable tableOfSelectedTickers = this.GetTableOfSelectedTickers(); ! if(tableOfSelectedTickers.Rows.Count == 0) ! { ! MessageBox.Show("No ticker has been selected!\n\n" + ! "Click on the grey area on the left to " + ! "select a ticker", "QuantDownloader error message", ! MessageBoxButtons.OK, MessageBoxIcon.Error); ! return; ! } ! WebDownloader webDownloader = new WebDownloader(this.GetTableOfSelectedTickers()); webDownloader.Show(); } + private void dataGrid1_DragLeave(object sender, System.EventArgs e) + { + MessageBox.Show("Calcolo object data!"); + } + + private void menuItemCopySelectedTickersToClipboard_Click(object sender, System.EventArgs e) + { + Clipboard.SetDataObject(this.GetTableOfSelectedTickers()); + } + |
|
From: <mi...@us...> - 2004-02-09 17:24:21
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22862/Downloader Modified Files: GroupEditor.cs TickerGroupsViewer.cs Log Message: TickerGroupsViewer is now usable (it will be completed soon). It is now possible to do these operations: - adding, renaming, removing groups from the treeView (the structure); - selecting tickers from the listView (the content of the selected node in the structure view) and performing, on those tickers, validation or download from the web. Index: GroupEditor.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/GroupEditor.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GroupEditor.cs 4 Feb 2004 19:27:10 -0000 1.1 --- GroupEditor.cs 9 Feb 2004 17:21:06 -0000 1.2 *************** *** 1,2 **** --- 1,24 ---- + /* + QuantDownloader - Quantitative Finance Library + + TickerGroupsViewer.cs + Copyright (C) 2003 + Marco Milletti + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + using System; using System.Drawing; *************** *** 33,37 **** // this.tickerGroupsViewer = tickerGroupsViewer; ! this.Text = "Add new group"; this.buttonModify.Visible = false; // --- 55,60 ---- // this.tickerGroupsViewer = tickerGroupsViewer; ! this.Text = "Add new group inside: " + ! this.tickerGroupsViewer.SelectedGroupDescription; this.buttonModify.Visible = false; // *************** *** 98,102 **** this.textBoxGroupID.Size = new System.Drawing.Size(112, 20); this.textBoxGroupID.TabIndex = 1; ! this.textBoxGroupID.Text = "textBoxGroupID"; // // labelGroupID --- 121,125 ---- this.textBoxGroupID.Size = new System.Drawing.Size(112, 20); this.textBoxGroupID.TabIndex = 1; ! this.textBoxGroupID.Text = "GroupID"; // // labelGroupID *************** *** 121,125 **** this.textBoxGroupDescription.Size = new System.Drawing.Size(252, 20); this.textBoxGroupDescription.TabIndex = 3; ! this.textBoxGroupDescription.Text = "textBoxGroupID"; // // buttonModify --- 144,148 ---- this.textBoxGroupDescription.Size = new System.Drawing.Size(252, 20); this.textBoxGroupDescription.TabIndex = 3; ! this.textBoxGroupDescription.Text = "Group Description"; // // buttonModify *************** *** 151,162 **** #endregion ! private void buttonOK_Click(object sender, System.EventArgs e) { ! if(this.textBoxGroupID == null || ! this.textBoxGroupDescription == null) { ! MessageBox.Show("Type Group ID and Group Description!"); ! return; } if(this.tickerGroupsViewer.SelectedGroupID == "") // it is a group to be added under the root node --- 174,198 ---- #endregion ! private bool FormIsNotComplete() { ! if(this.textBoxGroupID.Text == "" || ! this.textBoxGroupDescription.Text == "") { ! MessageBox.Show("Type both Group ID and Group Description!", ! "Updating or Adding group not possible", ! MessageBoxButtons.OK, ! MessageBoxIcon.Error); ! return true; } + else + { + return false; + } + } + private void buttonOK_Click(object sender, System.EventArgs e) + { + if(this.FormIsNotComplete()) + return; + if(this.tickerGroupsViewer.SelectedGroupID == "") // it is a group to be added under the root node *************** *** 178,187 **** private void buttonModify_Click(object sender, System.EventArgs e) { ! if(this.textBoxGroupID == null || ! this.textBoxGroupDescription == null) ! { ! MessageBox.Show("Type Group ID and Group Description!"); return; - } this.tickerGroupsViewer.ModifyGroup((string)this.selectedNodeInTickerGroupsViewer.Tag, --- 214,219 ---- private void buttonModify_Click(object sender, System.EventArgs e) { ! if(this.FormIsNotComplete()) return; this.tickerGroupsViewer.ModifyGroup((string)this.selectedNodeInTickerGroupsViewer.Tag, Index: TickerGroupsViewer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerGroupsViewer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TickerGroupsViewer.cs 4 Feb 2004 19:27:10 -0000 1.1 --- TickerGroupsViewer.cs 9 Feb 2004 17:21:06 -0000 1.2 *************** *** 52,61 **** private System.Windows.Forms.MenuItem menuItemOpenTickerSelector; private string selectedGroupID; ! ! /// <summary> ! /// Components ! /// </summary> ! private System.ComponentModel.Container components = null; ! public TickerGroupsViewer() { --- 52,66 ---- private System.Windows.Forms.MenuItem menuItemOpenTickerSelector; private string selectedGroupID; ! private string selectedGroupDescription; ! private System.Windows.Forms.ImageList imageListGroupsAndTickers; ! private System.ComponentModel.IContainer components; ! private const int GROUP_IMAGE = 0; ! private System.Windows.Forms.MenuItem menuItemPasteSelectedTickers; ! private System.Windows.Forms.MenuItem menuItem1; ! private const int TICKER_IMAGE = 1; ! private const string FIRST_COLUMN_NAME = "Element Name"; ! private const string SECOND_COLUMN_NAME = "Element Type"; ! private const string THIRD_COLUMN_NAME = "Element Description"; ! public TickerGroupsViewer() { *************** *** 64,68 **** // ! // TODO: // } --- 69,81 ---- // ! this.listViewGroupsAndTickers.Columns.Add(FIRST_COLUMN_NAME, ! this.listViewGroupsAndTickers.Width - 30, ! HorizontalAlignment.Left); ! this.listViewGroupsAndTickers.Columns.Add(SECOND_COLUMN_NAME, ! this.listViewGroupsAndTickers.Width - 60, ! HorizontalAlignment.Left); ! this.listViewGroupsAndTickers.Columns.Add(THIRD_COLUMN_NAME, ! this.listViewGroupsAndTickers.Width - 90, ! HorizontalAlignment.Left); // } *************** *** 83,87 **** } /// <summary> ! /// It gets the groupID of the selected node in the treeView control of the class /// </summary> public string SelectedGroupID --- 96,100 ---- } /// <summary> ! /// It gets the groupID of the selected node in the treeView control of the object /// </summary> public string SelectedGroupID *************** *** 92,96 **** --- 105,174 ---- } } + /// <summary> + /// It gets the group Description of the selected node in the treeView control of the object + /// </summary> + public string SelectedGroupDescription + { + get + { + return this.selectedGroupDescription; + } + } + + private void addTickersToTable(DataTable tableToFill) + { + try + { + ; + } + catch(Exception ex) + { + string notUsed = ex.ToString(); + } + } + private void addTickerToTable(DataTable tableToFill, string tickerID, + string tickerDescription) + { + try + { + DataRow newRow = tableToFill.NewRow(); + newRow[0] = tickerID; + newRow[1] = tickerDescription; + tableToFill.Rows.Add(newRow); + } + catch(Exception ex) + { + string notUsed = ex.ToString(); + } + } + + + internal DataTable GetTableOfSelectedTickers() + { + DataTable tableOfSelectedTickers = new DataTable(); + tableOfSelectedTickers.Columns.Add("tickerID"); + tableOfSelectedTickers.Columns["tickerID"].Unique = true; + tableOfSelectedTickers.Columns.Add("tickerCompanyName"); + foreach(ListViewItem item in this.listViewGroupsAndTickers.SelectedItems) + { + if(item.Tag is System.String) + // the item contains in Tag property the ticker ID + { + this.addTickerToTable(tableOfSelectedTickers, + (string)item.Tag, + item.SubItems[2].Text); + + } + else + // the item references to a node in the treeView : + // so it represents a group of tickers + { + MessageBox.Show("NOT IMPLEMENTED YET"); + } + + } + return tableOfSelectedTickers; + } #region Windows Form Designer generated code *************** *** 100,103 **** --- 178,183 ---- private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); + System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TickerGroupsViewer)); this.treeViewGroups = new System.Windows.Forms.TreeView(); this.contextMenuTickerGroupsTreeView = new System.Windows.Forms.ContextMenu(); *************** *** 105,108 **** --- 185,189 ---- this.menuItemRemoveGroup = new System.Windows.Forms.MenuItem(); this.menuItemRenameGroup = new System.Windows.Forms.MenuItem(); + this.imageListGroupsAndTickers = new System.Windows.Forms.ImageList(this.components); this.splitter1 = new System.Windows.Forms.Splitter(); this.listViewGroupsAndTickers = new System.Windows.Forms.ListView(); *************** *** 111,114 **** --- 192,197 ---- this.menuItemDownloadQuotesOfCurrentGroup = new System.Windows.Forms.MenuItem(); this.menuItemOpenTickerSelector = new System.Windows.Forms.MenuItem(); + this.menuItemPasteSelectedTickers = new System.Windows.Forms.MenuItem(); + this.menuItem1 = new System.Windows.Forms.MenuItem(); this.SuspendLayout(); // *************** *** 117,125 **** this.treeViewGroups.ContextMenu = this.contextMenuTickerGroupsTreeView; this.treeViewGroups.Dock = System.Windows.Forms.DockStyle.Left; ! this.treeViewGroups.ImageIndex = -1; this.treeViewGroups.Name = "treeViewGroups"; - this.treeViewGroups.SelectedImageIndex = -1; this.treeViewGroups.Size = new System.Drawing.Size(120, 326); this.treeViewGroups.TabIndex = 0; this.treeViewGroups.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViewGroups_AfterSelect); // --- 200,208 ---- this.treeViewGroups.ContextMenu = this.contextMenuTickerGroupsTreeView; this.treeViewGroups.Dock = System.Windows.Forms.DockStyle.Left; ! this.treeViewGroups.ImageList = this.imageListGroupsAndTickers; this.treeViewGroups.Name = "treeViewGroups"; this.treeViewGroups.Size = new System.Drawing.Size(120, 326); this.treeViewGroups.TabIndex = 0; + this.treeViewGroups.AfterExpand += new System.Windows.Forms.TreeViewEventHandler(this.treeViewGroups_AfterExpand); this.treeViewGroups.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViewGroups_AfterSelect); // *************** *** 149,152 **** --- 232,242 ---- this.menuItemRenameGroup.Click += new System.EventHandler(this.menuItemRenameGroup_Click); // + // imageListGroupsAndTickers + // + this.imageListGroupsAndTickers.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; + this.imageListGroupsAndTickers.ImageSize = new System.Drawing.Size(16, 16); + this.imageListGroupsAndTickers.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListGroupsAndTickers.ImageStream"))); + this.imageListGroupsAndTickers.TransparentColor = System.Drawing.Color.Transparent; + // // splitter1 // *************** *** 160,168 **** // listViewGroupsAndTickers // this.listViewGroupsAndTickers.Dock = System.Windows.Forms.DockStyle.Fill; this.listViewGroupsAndTickers.Location = new System.Drawing.Point(123, 0); this.listViewGroupsAndTickers.Name = "listViewGroupsAndTickers"; ! this.listViewGroupsAndTickers.Size = new System.Drawing.Size(301, 326); this.listViewGroupsAndTickers.TabIndex = 2; // // contextMenuTickerGroupsListView --- 250,263 ---- // listViewGroupsAndTickers // + this.listViewGroupsAndTickers.Activation = System.Windows.Forms.ItemActivation.TwoClick; + this.listViewGroupsAndTickers.ContextMenu = this.contextMenuTickerGroupsListView; this.listViewGroupsAndTickers.Dock = System.Windows.Forms.DockStyle.Fill; this.listViewGroupsAndTickers.Location = new System.Drawing.Point(123, 0); this.listViewGroupsAndTickers.Name = "listViewGroupsAndTickers"; ! this.listViewGroupsAndTickers.Size = new System.Drawing.Size(397, 326); ! this.listViewGroupsAndTickers.SmallImageList = this.imageListGroupsAndTickers; this.listViewGroupsAndTickers.TabIndex = 2; + this.listViewGroupsAndTickers.View = System.Windows.Forms.View.Details; + this.listViewGroupsAndTickers.ItemActivate += new System.EventHandler(this.listViewGroupsAndTickers_ItemActivate); // // contextMenuTickerGroupsListView *************** *** 171,175 **** this.menuItemValidateGroup, this.menuItemDownloadQuotesOfCurrentGroup, ! this.menuItemOpenTickerSelector}); // // menuItemValidateGroup --- 266,272 ---- this.menuItemValidateGroup, this.menuItemDownloadQuotesOfCurrentGroup, ! this.menuItemOpenTickerSelector, ! this.menuItemPasteSelectedTickers, ! this.menuItem1}); // // menuItemValidateGroup *************** *** 177,180 **** --- 274,278 ---- this.menuItemValidateGroup.Index = 0; this.menuItemValidateGroup.Text = "&Validate"; + this.menuItemValidateGroup.Click += new System.EventHandler(this.menuItemValidateGroup_Click); // // menuItemDownloadQuotesOfCurrentGroup *************** *** 182,185 **** --- 280,284 ---- this.menuItemDownloadQuotesOfCurrentGroup.Index = 1; this.menuItemDownloadQuotesOfCurrentGroup.Text = "&Download quotes"; + this.menuItemDownloadQuotesOfCurrentGroup.Click += new System.EventHandler(this.menuItemDownloadQuotesOfCurrentGroup_Click); // // menuItemOpenTickerSelector *************** *** 188,195 **** this.menuItemOpenTickerSelector.Text = "&Open Ticker Selector"; // // TickerGroupsViewer // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(424, 326); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.listViewGroupsAndTickers, --- 287,305 ---- this.menuItemOpenTickerSelector.Text = "&Open Ticker Selector"; // + // menuItemPasteSelectedTickers + // + this.menuItemPasteSelectedTickers.Index = 3; + this.menuItemPasteSelectedTickers.Text = "&Paste Tickers"; + this.menuItemPasteSelectedTickers.Click += new System.EventHandler(this.menuItemPasteSelectedTickers_Click); + // + // menuItem1 + // + this.menuItem1.Index = 4; + this.menuItem1.Text = "&Remove selected Items"; + // // TickerGroupsViewer // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(520, 326); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.listViewGroupsAndTickers, *************** *** 253,257 **** { Cursor.Current = Cursors.WaitCursor; ! this.oleDbConnection.Open(); fillTreeViewAtRootLevel(); foreach(TreeNode node in this.treeViewGroups.Nodes[0].Nodes) --- 363,368 ---- { Cursor.Current = Cursors.WaitCursor; ! if(this.oleDbConnection.State != ConnectionState.Open) ! this.oleDbConnection.Open(); fillTreeViewAtRootLevel(); foreach(TreeNode node in this.treeViewGroups.Nodes[0].Nodes) *************** *** 275,310 **** #region Paint Child Nodes During selection ! private void treeViewGroups_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e) { ! this.selectedGroupID = (string)this.treeViewGroups.SelectedNode.Tag; ! // It updates the member used by the property SelectedGroupID ! if((string)this.treeViewGroups.SelectedNode.Tag != "" && ! this.treeViewGroups.SelectedNode.Nodes.Count == 0) ! // if the selected node is not the root node and it hasn't got child nodes ! // it has to be filled with its child nodes (if any) { ! try ! { ! Cursor.Current = Cursors.WaitCursor; this.oleDbConnection.Open(); ! foreach(TreeNode node in this.treeViewGroups.SelectedNode.Nodes) { ! addNodeChildsToCurrentNode(node); } } - catch(Exception ex) - { - MessageBox.Show(ex.ToString()); - } - finally - { - Cursor.Current = Cursors.Default; - this.oleDbConnection.Close(); - } } } #endregion #region Add group private void addNodeGroupToCurrentNode(string groupID, --- 386,491 ---- #region Paint Child Nodes During selection ! private void treeViewGroups_AfterExpand(object sender, System.Windows.Forms.TreeViewEventArgs e) { ! ! if((string)this.treeViewGroups.SelectedNode.Tag != "") ! return; ! ! try { ! Cursor.Current = Cursors.WaitCursor; ! if(this.oleDbConnection.State != ConnectionState.Open) this.oleDbConnection.Open(); ! foreach(TreeNode node in this.treeViewGroups.SelectedNode.Nodes) ! { ! foreach(TreeNode childNode in node.Nodes) { ! if(childNode.Nodes.Count == 0) ! addNodeChildsToCurrentNode(childNode); } } } + catch(Exception ex) + { + MessageBox.Show(ex.ToString()); + } + finally + { + Cursor.Current = Cursors.Default; + this.oleDbConnection.Close(); + } + } + #endregion + + + + private void treeViewGroups_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e) + { + this.selectedGroupID = (string)this.treeViewGroups.SelectedNode.Tag; + this.selectedGroupDescription = this.treeViewGroups.SelectedNode.Text; + this.updateListView(this.treeViewGroups.SelectedNode); + + } + + #region Update List View + private void updateGroupsInListView(TreeNode selectedNode) + { + foreach(TreeNode node in selectedNode.Nodes) + { + ListViewItem listViewItem = new ListViewItem(node.Text, GROUP_IMAGE); + listViewItem.Tag = node; + this.listViewGroupsAndTickers.Items.Add(listViewItem); + listViewItem.SubItems.Add("Group"); + } + + } + private void updateTickersInListView(TreeNode selectedNode) + { + try + { + Cursor.Current = Cursors.WaitCursor; + if(this.oleDbConnection.State != ConnectionState.Open) + this.oleDbConnection.Open(); + this.oleDbDataAdapter.SelectCommand.CommandText = + "SELECT ttTiId, tiCompanyName, ttTgId FROM tickers INNER JOIN " + + "tickers_tickerGroups ON tickers.tiTicker = tickers_tickerGroups.ttTiId WHERE ttTgId ='" + + (string)selectedNode.Tag + "'"; + DataTable tickers = new DataTable(); + this.oleDbDataAdapter.Fill(tickers); + foreach (DataRow row in tickers.Rows) + { + ListViewItem listViewItem = new ListViewItem((string)row[0], + TICKER_IMAGE); + listViewItem.Tag = (string)row[0]; + this.listViewGroupsAndTickers.Items.Add(listViewItem); + listViewItem.SubItems.Add("Ticker"); + listViewItem.SubItems.Add((string)row[1]); + } + + } + catch(Exception ex) + { + MessageBox.Show(ex.ToString()); + } + finally + { + Cursor.Current = Cursors.Default; + this.oleDbConnection.Close(); + } + } + + private void updateListView(TreeNode selectedNode) + { + this.listViewGroupsAndTickers.Items.Clear(); + this.updateGroupsInListView(selectedNode); + this.updateTickersInListView(selectedNode); + } + + #endregion + #region Add group private void addNodeGroupToCurrentNode(string groupID, *************** *** 315,318 **** --- 496,500 ---- node.Tag = groupID; this.treeViewGroups.SelectedNode.Nodes.Add(node); + this.updateListView(this.treeViewGroups.SelectedNode); } *************** *** 326,330 **** { Cursor.Current = Cursors.WaitCursor; ! this.oleDbConnection.Open(); this.oleDbDataAdapter.InsertCommand = new OleDbCommand("INSERT INTO tickerGroups(tgId, tgDescription, tgTgId) " + --- 508,513 ---- { Cursor.Current = Cursors.WaitCursor; ! if(this.oleDbConnection.State != ConnectionState.Open) ! this.oleDbConnection.Open(); this.oleDbDataAdapter.InsertCommand = new OleDbCommand("INSERT INTO tickerGroups(tgId, tgDescription, tgTgId) " + *************** *** 333,338 **** groupDescription + "','" + parentGroupID + "')", this.oleDbConnection); ! this.oleDbDataAdapter.InsertCommand.ExecuteNonQuery(); ! this.addNodeGroupToCurrentNode(groupID, groupDescription); } catch(Exception ex) --- 516,523 ---- groupDescription + "','" + parentGroupID + "')", this.oleDbConnection); ! int numRowInserted = ! this.oleDbDataAdapter.InsertCommand.ExecuteNonQuery(); ! if(numRowInserted > 0) ! this.addNodeGroupToCurrentNode(groupID, groupDescription); } catch(Exception ex) *************** *** 354,358 **** { Cursor.Current = Cursors.WaitCursor; ! this.oleDbConnection.Open(); this.oleDbDataAdapter.InsertCommand = new OleDbCommand("INSERT INTO tickerGroups(tgId, tgDescription) " + --- 539,544 ---- { Cursor.Current = Cursors.WaitCursor; ! if(this.oleDbConnection.State != ConnectionState.Open) ! this.oleDbConnection.Open(); this.oleDbDataAdapter.InsertCommand = new OleDbCommand("INSERT INTO tickerGroups(tgId, tgDescription) " + *************** *** 393,402 **** this.oleDbConnection.Open(); this.oleDbDataAdapter.UpdateCommand = ! new OleDbCommand("UPDATE tickerGroups SET tgId =' " + ! newGroupID + "', tgDescription =' " + ! groupDescription + "' WHERE tgId =' " + oldGroupID + "'", this.oleDbConnection); ! this.oleDbDataAdapter.UpdateCommand.ExecuteNonQuery(); ! this.modifyCurrentNode(newGroupID, groupDescription); } catch(Exception ex) --- 579,590 ---- this.oleDbConnection.Open(); this.oleDbDataAdapter.UpdateCommand = ! new OleDbCommand("UPDATE tickerGroups SET tgId ='" + ! newGroupID + "', tgDescription ='" + ! groupDescription + "' WHERE tgId ='" + oldGroupID + "'", this.oleDbConnection); ! int numUpdatedRows = ! this.oleDbDataAdapter.UpdateCommand.ExecuteNonQuery(); ! if(numUpdatedRows >0) ! this.modifyCurrentNode(newGroupID, groupDescription); } catch(Exception ex) *************** *** 430,434 **** } deleteCurrentGroup(this.treeViewGroups.SelectedNode); - this.treeViewGroups.SelectedNode.Remove(); } --- 618,621 ---- *************** *** 444,448 **** nodeCorrespondingToGroup.Tag + "'", this.oleDbConnection); ! this.oleDbDataAdapter.DeleteCommand.ExecuteNonQuery(); } catch(Exception ex) --- 631,638 ---- nodeCorrespondingToGroup.Tag + "'", this.oleDbConnection); ! int numDeletedRows = ! this.oleDbDataAdapter.DeleteCommand.ExecuteNonQuery(); ! if (numDeletedRows > 0) ! this.treeViewGroups.SelectedNode.Remove(); } catch(Exception ex) *************** *** 483,486 **** --- 673,804 ---- } + private bool isRowInsertedInDataBase(DataRow row) + { + try + { + this.oleDbDataAdapter.InsertCommand = + new OleDbCommand("INSERT INTO tickers_tickerGroups(ttTiId, ttTgId) " + + "VALUES('" + (string)row[0] + "','" + + (string)this.treeViewGroups.SelectedNode.Tag + "')", this.oleDbConnection); + if(this.oleDbDataAdapter.InsertCommand.ExecuteNonQuery()>0) + { + return true; + } + else + { + return false; + } + } + catch(Exception ex) + { + string neverUsed = ex.ToString(); + return false; + } + + } + + private void menuItemPasteSelectedTickers_Click(object sender, System.EventArgs e) + { + try + { + //initialize table of tickers to be copied + IDataObject iDataObject = Clipboard.GetDataObject(); + DataTable tickers = (DataTable)iDataObject.GetData(DataFormats.Serializable); + // some checks are performed + if(tickers == null) + { + MessageBox.Show("No ticker has been copied to ClipBoard!\n\n" + + "Select some tickers before trying again!", + "Paste operation fail", MessageBoxButtons.OK, + MessageBoxIcon.Error); + return; + } + if((string)this.treeViewGroups.SelectedNode.Tag == "") + { + MessageBox.Show("Selected tickers can't be copied inside " + + "the root node: change group and try again!", + "Paste operation fail", MessageBoxButtons.OK, + MessageBoxIcon.Error); + return; + } + // end of checks + Cursor.Current = Cursors.WaitCursor; + if(this.oleDbConnection.State != ConnectionState.Open) + this.oleDbConnection.Open(); + int numRowsInserted = 0; + foreach (DataRow row in tickers.Rows) + { + if(this.isRowInsertedInDataBase(row)) + numRowsInserted ++; + } + if(numRowsInserted != tickers.Rows.Count) + MessageBox.Show("Some selected tickers have not been added", + "Warning after paste operation", MessageBoxButtons.OK, + MessageBoxIcon.Exclamation); + this.updateListView(this.treeViewGroups.SelectedNode); + + } + catch(Exception ex) + { + MessageBox.Show(ex.ToString()); + } + finally + { + Cursor.Current = Cursors.Default; + this.oleDbConnection.Close(); + } + } + + private void listViewGroupsAndTickers_ItemActivate(object sender, System.EventArgs e) + { + if(this.listViewGroupsAndTickers.SelectedItems[0].Tag is TreeNode) + { + this.treeViewGroups.SelectedNode.Expand(); + foreach (TreeNode node in this.treeViewGroups.SelectedNode.Nodes) + { + if(node.Equals(this.listViewGroupsAndTickers.SelectedItems[0].Tag)) + { + node.Expand(); + this.treeViewGroups.SelectedNode = node; + this.updateListView(this.treeViewGroups.SelectedNode); + break; + } + } + + } + } + + private void menuItemDownloadQuotesOfCurrentGroup_Click(object sender, System.EventArgs e) + { + DataTable tableOfSelectedTickers = this.GetTableOfSelectedTickers(); + if(tableOfSelectedTickers.Rows.Count == 0) + { + MessageBox.Show("No ticker has been selected!\n\n" + + "Select some tickers or groups containing tickers!", "QuantDownloader error message", + MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + WebDownloader webDownloader = new WebDownloader(tableOfSelectedTickers); + webDownloader.Show(); + } + + private void menuItemValidateGroup_Click(object sender, System.EventArgs e) + { + DataTable tableOfSelectedTickers = this.GetTableOfSelectedTickers(); + if(tableOfSelectedTickers.Rows.Count == 0) + { + MessageBox.Show("No ticker has been selected!\n\n" + + "Click on the grey area on the left to " + + "select a ticker", "QuantDownloader error message", + MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + QuantProject.Applications.Downloader.Validate.ValidateForm validateForm = + new Validate.ValidateForm(this.GetTableOfSelectedTickers()); + validateForm.Show(); + } + + + |
|
From: <mi...@us...> - 2004-02-09 17:18:19
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/TickerGroupsViewerImages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21421/Downloader/TickerGroupsViewerImages Added Files: Group.BMP Ticker.BMP Log Message: Images used in TickerGroupsViewer form --- NEW FILE: Group.BMP --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Ticker.BMP --- (This appears to be a binary file; contents omitted.) |
|
From: <mi...@us...> - 2004-02-09 17:15:06
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/TickerGroupsViewerImages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20706/TickerGroupsViewerImages Log Message: Directory /cvsroot/quantproject/QuantDownloader/Downloader/TickerGroupsViewerImages added to the repository |
|
From: <mi...@us...> - 2004-02-04 19:41:50
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25125/b2_DataAccess Modified Files: DataBaseVersionManager.cs Log Message: Modified tables in QuantProject.mdb Index: DataBaseVersionManager.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DataBaseVersionManager.cs 17 Jan 2004 19:10:14 -0000 1.6 --- DataBaseVersionManager.cs 4 Feb 2004 19:39:19 -0000 1.7 *************** *** 159,163 **** this.executeCommand("ALTER TABLE quotes ADD CONSTRAINT PKquTicker_quDate " + "PRIMARY KEY (quTicker, quDate)"); ! this.executeCommand("ALTER TABLE validatedTickers ADD CONSTRAINT myKey PRIMARY KEY ( vtTicker )"); this.executeCommand("ALTER TABLE tickers_tickerGroups " + --- 159,163 ---- this.executeCommand("ALTER TABLE quotes ADD CONSTRAINT PKquTicker_quDate " + "PRIMARY KEY (quTicker, quDate)"); ! this.executeCommand("ALTER TABLE tickerGroups ADD CONSTRAINT PKtgId PRIMARY KEY (tgId)"); this.executeCommand("ALTER TABLE validatedTickers ADD CONSTRAINT myKey PRIMARY KEY ( vtTicker )"); this.executeCommand("ALTER TABLE tickers_tickerGroups " + *************** *** 170,174 **** private void alterTablesAddColumns() { ! //add code here for adding columns to existing tables; } private void alterTablesAddIndexes() --- 170,175 ---- private void alterTablesAddColumns() { ! this.executeCommand("ALTER TABLE tickers " + ! "ADD COLUMN tiCompanyName TEXT(100)"); } private void alterTablesAddIndexes() |
|
From: <mi...@us...> - 2004-02-04 19:36:08
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/Validate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23359/Downloader/Validate Modified Files: ValidateForm.cs Log Message: Riorganised code for the data grid Index: ValidateForm.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Validate/ValidateForm.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ValidateForm.cs 27 Jan 2004 15:39:55 -0000 1.7 --- ValidateForm.cs 4 Feb 2004 19:33:40 -0000 1.8 *************** *** 39,47 **** // InitializeComponent(); ! ! this.validateDataGrid.Location = new System.Drawing.Point(16, 56); ! this.validateDataGrid.Width = this.Width - 32; ! this.validateDataGrid.Height = this.Height - 130; ! this.Controls.Add( this.validateDataGrid ); this.buttonGoValidateCurrentSelection.Visible = false; this.tableOfTickersToBeValidated = null; --- 39,43 ---- // InitializeComponent(); ! initializeValidateDataGrid(); this.buttonGoValidateCurrentSelection.Visible = false; this.tableOfTickersToBeValidated = null; *************** *** 52,55 **** --- 48,52 ---- { InitializeComponent(); + initializeValidateDataGrid(); this.labelTickerIsLike.Visible = false; this.textBoxTickerIsLike.Visible = false; *************** *** 61,64 **** --- 58,69 ---- this.tableOfTickersToBeValidated = dataTable; } + + private void initializeValidateDataGrid() + { + this.validateDataGrid.Location = new System.Drawing.Point(16, 56); + this.validateDataGrid.Width = this.Width - 32; + this.validateDataGrid.Height = this.Height - 130; + this.Controls.Add( this.validateDataGrid ); + } /// <summary> /// Clean up any resources being used. |
|
From: <mi...@us...> - 2004-02-04 19:31:38
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22200/Downloader Modified Files: TickerViewer.cs Log Message: The viewer has been improved Index: TickerViewer.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/TickerViewer.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TickerViewer.cs 26 Jan 2004 15:57:15 -0000 1.3 --- TickerViewer.cs 4 Feb 2004 19:29:12 -0000 1.4 *************** *** 48,51 **** --- 48,57 ---- private System.Windows.Forms.MenuItem menuItemValidateCurrentRows; private System.Windows.Forms.MenuItem menuItemDownloadCurrentRows; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.TextBox textBoxStringToFindInName; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Splitter splitter1; private DataTable tableTickers; *************** *** 86,124 **** this.label1 = new System.Windows.Forms.Label(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.dataGrid1 = new System.Windows.Forms.DataGrid(); this.contextMenuTickerViewer = new System.Windows.Forms.ContextMenu(); this.menuItemValidateCurrentRows = new System.Windows.Forms.MenuItem(); - this.buttonFindTickers = new System.Windows.Forms.Button(); this.menuItemDownloadCurrentRows = new System.Windows.Forms.MenuItem(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); this.SuspendLayout(); // // textBoxStringToFind // ! this.textBoxStringToFind.Location = new System.Drawing.Point(48, 8); this.textBoxStringToFind.Name = "textBoxStringToFind"; ! this.textBoxStringToFind.Size = new System.Drawing.Size(160, 20); this.textBoxStringToFind.TabIndex = 0; ! this.textBoxStringToFind.Text = ""; this.toolTip1.SetToolTip(this.textBoxStringToFind, "Type chars to filter tickers (you can use % and _ ) "); // // label1 // ! this.label1.Location = new System.Drawing.Point(8, 8); this.label1.Name = "label1"; ! this.label1.Size = new System.Drawing.Size(40, 24); this.label1.TabIndex = 1; ! this.label1.Text = "Find ..."; // // dataGrid1 // this.dataGrid1.ContextMenu = this.contextMenuTickerViewer; this.dataGrid1.DataMember = ""; ! this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Bottom; this.dataGrid1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; - this.dataGrid1.Location = new System.Drawing.Point(0, 46); this.dataGrid1.Name = "dataGrid1"; ! this.dataGrid1.Size = new System.Drawing.Size(288, 432); this.dataGrid1.TabIndex = 2; // --- 92,147 ---- this.label1 = new System.Windows.Forms.Label(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.textBoxStringToFindInName = new System.Windows.Forms.TextBox(); this.dataGrid1 = new System.Windows.Forms.DataGrid(); this.contextMenuTickerViewer = new System.Windows.Forms.ContextMenu(); this.menuItemValidateCurrentRows = new System.Windows.Forms.MenuItem(); this.menuItemDownloadCurrentRows = new System.Windows.Forms.MenuItem(); + this.buttonFindTickers = new System.Windows.Forms.Button(); + this.panel1 = new System.Windows.Forms.Panel(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.splitter1 = new System.Windows.Forms.Splitter(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); this.SuspendLayout(); // // textBoxStringToFind // ! this.textBoxStringToFind.Location = new System.Drawing.Point(16, 32); this.textBoxStringToFind.Name = "textBoxStringToFind"; ! this.textBoxStringToFind.Size = new System.Drawing.Size(176, 20); this.textBoxStringToFind.TabIndex = 0; ! this.textBoxStringToFind.Text = "%"; this.toolTip1.SetToolTip(this.textBoxStringToFind, "Type chars to filter tickers (you can use % and _ ) "); // // label1 // ! this.label1.Location = new System.Drawing.Point(16, 8); this.label1.Name = "label1"; ! this.label1.Size = new System.Drawing.Size(112, 16); this.label1.TabIndex = 1; ! this.label1.Text = "Find Ticker is like"; ! // ! // textBoxStringToFindInName ! // ! this.textBoxStringToFindInName.Location = new System.Drawing.Point(16, 112); ! this.textBoxStringToFindInName.Name = "textBoxStringToFindInName"; ! this.textBoxStringToFindInName.Size = new System.Drawing.Size(176, 20); ! this.textBoxStringToFindInName.TabIndex = 4; ! this.textBoxStringToFindInName.Text = "%"; ! this.toolTip1.SetToolTip(this.textBoxStringToFindInName, "Type chars to filter companies (you can use % and _ ) "); // // dataGrid1 // + this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.None; this.dataGrid1.ContextMenu = this.contextMenuTickerViewer; this.dataGrid1.DataMember = ""; ! this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGrid1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.dataGrid1.Name = "dataGrid1"; ! this.dataGrid1.Size = new System.Drawing.Size(200, 478); this.dataGrid1.TabIndex = 2; // *************** *** 135,141 **** this.menuItemValidateCurrentRows.Click += new System.EventHandler(this.menuItemValidateCurrentRows_Click); // // buttonFindTickers // ! this.buttonFindTickers.Location = new System.Drawing.Point(216, 8); this.buttonFindTickers.Name = "buttonFindTickers"; this.buttonFindTickers.Size = new System.Drawing.Size(64, 24); --- 158,170 ---- this.menuItemValidateCurrentRows.Click += new System.EventHandler(this.menuItemValidateCurrentRows_Click); // + // menuItemDownloadCurrentRows + // + this.menuItemDownloadCurrentRows.Index = 1; + this.menuItemDownloadCurrentRows.Text = "Download quotes of selected tickers"; + this.menuItemDownloadCurrentRows.Click += new System.EventHandler(this.menuItemDownloadCurrentRows_Click); + // // buttonFindTickers // ! this.buttonFindTickers.Location = new System.Drawing.Point(56, 200); this.buttonFindTickers.Name = "buttonFindTickers"; this.buttonFindTickers.Size = new System.Drawing.Size(64, 24); *************** *** 144,166 **** this.buttonFindTickers.Click += new System.EventHandler(this.buttonFindTickers_Click); // ! // menuItemDownloadCurrentRows // ! this.menuItemDownloadCurrentRows.Index = 1; ! this.menuItemDownloadCurrentRows.Text = "Download quotes of selected tickers"; ! this.menuItemDownloadCurrentRows.Click += new System.EventHandler(this.menuItemDownloadCurrentRows_Click); // // TickerViewer // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(288, 478); this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.buttonFindTickers, ! this.dataGrid1, ! this.label1, ! this.textBoxStringToFind}); this.Name = "TickerViewer"; ! this.Text = "TickerViewer"; this.Closed += new System.EventHandler(this.TickerViewer_Closed); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); this.ResumeLayout(false); --- 173,240 ---- this.buttonFindTickers.Click += new System.EventHandler(this.buttonFindTickers_Click); // ! // panel1 // ! this.panel1.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.dataGrid1}); ! this.panel1.Dock = System.Windows.Forms.DockStyle.Left; ! this.panel1.Name = "panel1"; ! this.panel1.Size = new System.Drawing.Size(200, 478); ! this.panel1.TabIndex = 4; ! // ! // label3 ! // ! this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); ! this.label3.Location = new System.Drawing.Point(72, 64); ! this.label3.Name = "label3"; ! this.label3.Size = new System.Drawing.Size(48, 16); ! this.label3.TabIndex = 6; ! this.label3.Text = "AND"; ! // ! // label2 ! // ! this.label2.Location = new System.Drawing.Point(16, 88); ! this.label2.Name = "label2"; ! this.label2.Size = new System.Drawing.Size(168, 16); ! this.label2.TabIndex = 5; ! this.label2.Text = "Company Name is like"; ! // ! // panel2 ! // ! this.panel2.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.textBoxStringToFind, ! this.buttonFindTickers, ! this.textBoxStringToFindInName, ! this.label2, ! this.label3, ! this.label1}); ! this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; ! this.panel2.Location = new System.Drawing.Point(200, 0); ! this.panel2.Name = "panel2"; ! this.panel2.Size = new System.Drawing.Size(200, 478); ! this.panel2.TabIndex = 7; ! // ! // splitter1 ! // ! this.splitter1.BackColor = System.Drawing.SystemColors.Highlight; ! this.splitter1.Location = new System.Drawing.Point(200, 0); ! this.splitter1.Name = "splitter1"; ! this.splitter1.Size = new System.Drawing.Size(3, 478); ! this.splitter1.TabIndex = 8; ! this.splitter1.TabStop = false; // // TickerViewer // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); ! this.ClientSize = new System.Drawing.Size(400, 478); this.Controls.AddRange(new System.Windows.Forms.Control[] { ! this.splitter1, ! this.panel2, ! this.panel1}); this.Name = "TickerViewer"; ! this.Text = "Ticker Viewer"; this.Closed += new System.EventHandler(this.TickerViewer_Closed); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); + this.panel1.ResumeLayout(false); + this.panel2.ResumeLayout(false); this.ResumeLayout(false); *************** *** 178,188 **** dataGrid1TableStyle.ReadOnly = true; dataGrid1TableStyle.SelectionBackColor = Color.DimGray ; ! DataGridTextBoxColumn columnStyle = new DataGridTextBoxColumn(); ! columnStyle.MappingName = "tiTicker"; ! columnStyle.HeaderText = "Ticker"; ! columnStyle.TextBox.Enabled = false; ! dataGrid1TableStyle.GridColumnStyles.Add(columnStyle); this.dataGrid1.TableStyles.Add(dataGrid1TableStyle); ! columnStyle.NullText = ""; } #endregion --- 252,269 ---- dataGrid1TableStyle.ReadOnly = true; dataGrid1TableStyle.SelectionBackColor = Color.DimGray ; ! DataGridTextBoxColumn columnStyle_tiTicker = new DataGridTextBoxColumn(); ! columnStyle_tiTicker.MappingName = "tiTicker"; ! columnStyle_tiTicker.HeaderText = "Ticker"; ! columnStyle_tiTicker.TextBox.Enabled = false; ! columnStyle_tiTicker.NullText = ""; ! DataGridTextBoxColumn columnStyle_tiCompanyName = new DataGridTextBoxColumn(); ! columnStyle_tiCompanyName.MappingName = "tiCompanyName"; ! columnStyle_tiCompanyName.HeaderText = "Company Name"; ! columnStyle_tiCompanyName.TextBox.Enabled = false; ! columnStyle_tiCompanyName.NullText = ""; ! dataGrid1TableStyle.GridColumnStyles.Add(columnStyle_tiTicker); ! dataGrid1TableStyle.GridColumnStyles.Add(columnStyle_tiCompanyName); this.dataGrid1.TableStyles.Add(dataGrid1TableStyle); ! } #endregion *************** *** 202,206 **** this.oleDbConnection.Open(); string criteria = "SELECT * FROM tickers WHERE tiTicker LIKE '" + ! this.textBoxStringToFind.Text + "'"; oleDbDataAdapter = new OleDbDataAdapter(criteria, this.oleDbConnection); this.tableTickers.Clear(); --- 283,289 ---- this.oleDbConnection.Open(); string criteria = "SELECT * FROM tickers WHERE tiTicker LIKE '" + ! this.textBoxStringToFind.Text + "'" + ! " AND tiCompanyName LIKE '" + ! this.textBoxStringToFindInName.Text + "'"; oleDbDataAdapter = new OleDbDataAdapter(criteria, this.oleDbConnection); this.tableTickers.Clear(); *************** *** 274,277 **** --- 357,361 ---- webDownloader.Show(); } + |
|
From: <mi...@us...> - 2004-02-04 19:29:37
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21525/Downloader Modified Files: Downloader.csproj Main.cs Added Files: GroupEditor.cs TickerGroupsViewer.cs Log Message: Added GUI tools for organising groups of tickers TickerGroupsViewer is not complete yet (the list view item has not been implemented yet) --- NEW FILE: GroupEditor.cs --- using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; namespace QuantProject.Applications.Downloader { /// <summary> /// It has to be used for editing group names and ID in the /// TickerGroupsViewer passed as the actual parameter in the constructor /// </summary> public class GroupEditor : System.Windows.Forms.Form { private System.Windows.Forms.Label labelGroupID; private System.Windows.Forms.Label labelGroupDescription; private System.Windows.Forms.TextBox textBoxGroupDescription; private System.Windows.Forms.TextBox textBoxGroupID; private TickerGroupsViewer tickerGroupsViewer; private TreeNode selectedNodeInTickerGroupsViewer; private System.Windows.Forms.Button buttonAdd; private System.Windows.Forms.Button buttonModify; /// <summary> /// components /// </summary> private System.ComponentModel.Container components = null; public GroupEditor(TickerGroupsViewer tickerGroupsViewer) { InitializeComponent(); // this.tickerGroupsViewer = tickerGroupsViewer; this.Text = "Add new group"; this.buttonModify.Visible = false; // } public GroupEditor(TickerGroupsViewer tickerGroupsViewer, TreeNode nodeToBeModified) { InitializeComponent(); // this.tickerGroupsViewer = tickerGroupsViewer; this.selectedNodeInTickerGroupsViewer = nodeToBeModified; this.Text = "Modify group"; this.textBoxGroupDescription.Text = nodeToBeModified.Text; this.textBoxGroupID.Text = (string)nodeToBeModified.Tag; this.buttonAdd.Visible = false; this.buttonModify.Location = new System.Drawing.Point(144,112); // } /// <summary> /// Clean up resources being used /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if(components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// <summary> /// Metodo necessario per il supporto della finestra di progettazione. Non modificare /// il contenuto del metodo con l'editor di codice. /// </summary> private void InitializeComponent() { this.buttonAdd = new System.Windows.Forms.Button(); this.textBoxGroupID = new System.Windows.Forms.TextBox(); this.labelGroupID = new System.Windows.Forms.Label(); this.labelGroupDescription = new System.Windows.Forms.Label(); this.textBoxGroupDescription = new System.Windows.Forms.TextBox(); this.buttonModify = new System.Windows.Forms.Button(); this.SuspendLayout(); // // buttonAdd // this.buttonAdd.Location = new System.Drawing.Point(144, 112); this.buttonAdd.Name = "buttonAdd"; this.buttonAdd.TabIndex = 0; this.buttonAdd.Text = "&ADD"; this.buttonAdd.Click += new System.EventHandler(this.buttonOK_Click); // // textBoxGroupID // this.textBoxGroupID.Location = new System.Drawing.Point(144, 24); this.textBoxGroupID.Name = "textBoxGroupID"; this.textBoxGroupID.Size = new System.Drawing.Size(112, 20); this.textBoxGroupID.TabIndex = 1; this.textBoxGroupID.Text = "textBoxGroupID"; // // labelGroupID // this.labelGroupID.Location = new System.Drawing.Point(8, 24); this.labelGroupID.Name = "labelGroupID"; this.labelGroupID.Size = new System.Drawing.Size(128, 23); this.labelGroupID.TabIndex = 2; this.labelGroupID.Text = "Group ID (max 8 chr)"; // // labelGroupDescription // this.labelGroupDescription.Location = new System.Drawing.Point(8, 64); this.labelGroupDescription.Name = "labelGroupDescription"; this.labelGroupDescription.TabIndex = 4; this.labelGroupDescription.Text = "Group Description"; // // textBoxGroupDescription // this.textBoxGroupDescription.Location = new System.Drawing.Point(144, 64); this.textBoxGroupDescription.Name = "textBoxGroupDescription"; this.textBoxGroupDescription.Size = new System.Drawing.Size(252, 20); this.textBoxGroupDescription.TabIndex = 3; this.textBoxGroupDescription.Text = "textBoxGroupID"; // // buttonModify // this.buttonModify.Location = new System.Drawing.Point(232, 112); this.buttonModify.Name = "buttonModify"; this.buttonModify.TabIndex = 5; this.buttonModify.Text = "&MODIFY"; this.buttonModify.Click += new System.EventHandler(this.buttonModify_Click); // // GroupEditor // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(418, 152); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.buttonModify, this.labelGroupDescription, this.textBoxGroupDescription, this.labelGroupID, this.textBoxGroupID, this.buttonAdd}); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Name = "GroupEditor"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Group Editor"; this.ResumeLayout(false); } #endregion private void buttonOK_Click(object sender, System.EventArgs e) { if(this.textBoxGroupID == null || this.textBoxGroupDescription == null) { MessageBox.Show("Type Group ID and Group Description!"); return; } if(this.tickerGroupsViewer.SelectedGroupID == "") // it is a group to be added under the root node { this.tickerGroupsViewer.AddNewGroupToDataBase(this.textBoxGroupID.Text, this.textBoxGroupDescription.Text); } else //// it is a group to be added under the selected group { this.tickerGroupsViewer.AddNewGroupToDataBase(this.textBoxGroupID.Text, this.textBoxGroupDescription.Text, this.tickerGroupsViewer.SelectedGroupID); } this.Close(); } private void buttonModify_Click(object sender, System.EventArgs e) { if(this.textBoxGroupID == null || this.textBoxGroupDescription == null) { MessageBox.Show("Type Group ID and Group Description!"); return; } this.tickerGroupsViewer.ModifyGroup((string)this.selectedNodeInTickerGroupsViewer.Tag, this.textBoxGroupDescription.Text, this.textBoxGroupID.Text); this.Close(); } } } --- NEW FILE: TickerGroupsViewer.cs --- /* QuantDownloader - Quantitative Finance Library TickerGroupsViewer.cs Copyright (C) 2003 Marco Milletti This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data.OleDb; using System.Data; using QuantProject.DataAccess; namespace QuantProject.Applications.Downloader { /// <summary> /// TickerGroupsViewer. /// </summary> public class TickerGroupsViewer : System.Windows.Forms.Form { private OleDbConnection oleDbConnection = ConnectionProvider.OleDbConnection; private OleDbDataAdapter oleDbDataAdapter; private DataTable table; private System.Windows.Forms.TreeView treeViewGroups; private System.Windows.Forms.Splitter splitter1; private System.Windows.Forms.ListView listViewGroupsAndTickers; private System.Windows.Forms.ContextMenu contextMenuTickerGroupsTreeView; private System.Windows.Forms.MenuItem menuItemAddNewGroup; private System.Windows.Forms.MenuItem menuItemRemoveGroup; private System.Windows.Forms.MenuItem menuItemRenameGroup; private System.Windows.Forms.ContextMenu contextMenuTickerGroupsListView; private System.Windows.Forms.MenuItem menuItemValidateGroup; private System.Windows.Forms.MenuItem menuItemDownloadQuotesOfCurrentGroup; private System.Windows.Forms.MenuItem menuItemOpenTickerSelector; private string selectedGroupID; /// <summary> /// Components /// </summary> private System.ComponentModel.Container components = null; public TickerGroupsViewer() { InitializeComponent(); // // TODO: // } /// <summary> /// Clean all resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if(components != null) { components.Dispose(); } } base.Dispose( disposing ); } /// <summary> /// It gets the groupID of the selected node in the treeView control of the class /// </summary> public string SelectedGroupID { get { return this.selectedGroupID; } } #region Windows Form Designer generated code /// <summary> /// Don't modify content with the code editor /// </summary> private void InitializeComponent() { this.treeViewGroups = new System.Windows.Forms.TreeView(); this.contextMenuTickerGroupsTreeView = new System.Windows.Forms.ContextMenu(); this.menuItemAddNewGroup = new System.Windows.Forms.MenuItem(); this.menuItemRemoveGroup = new System.Windows.Forms.MenuItem(); this.menuItemRenameGroup = new System.Windows.Forms.MenuItem(); this.splitter1 = new System.Windows.Forms.Splitter(); this.listViewGroupsAndTickers = new System.Windows.Forms.ListView(); this.contextMenuTickerGroupsListView = new System.Windows.Forms.ContextMenu(); this.menuItemValidateGroup = new System.Windows.Forms.MenuItem(); this.menuItemDownloadQuotesOfCurrentGroup = new System.Windows.Forms.MenuItem(); this.menuItemOpenTickerSelector = new System.Windows.Forms.MenuItem(); this.SuspendLayout(); // // treeViewGroups // this.treeViewGroups.ContextMenu = this.contextMenuTickerGroupsTreeView; this.treeViewGroups.Dock = System.Windows.Forms.DockStyle.Left; this.treeViewGroups.ImageIndex = -1; this.treeViewGroups.Name = "treeViewGroups"; this.treeViewGroups.SelectedImageIndex = -1; this.treeViewGroups.Size = new System.Drawing.Size(120, 326); this.treeViewGroups.TabIndex = 0; this.treeViewGroups.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViewGroups_AfterSelect); // // contextMenuTickerGroupsTreeView // this.contextMenuTickerGroupsTreeView.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItemAddNewGroup, this.menuItemRemoveGroup, this.menuItemRenameGroup}); // // menuItemAddNewGroup // this.menuItemAddNewGroup.Index = 0; this.menuItemAddNewGroup.Text = "&Add New Group"; this.menuItemAddNewGroup.Click += new System.EventHandler(this.menuItemAddNewGroup_Click); // // menuItemRemoveGroup // this.menuItemRemoveGroup.Index = 1; this.menuItemRemoveGroup.Text = "&Remove"; this.menuItemRemoveGroup.Click += new System.EventHandler(this.menuItemRemoveGroup_Click); // // menuItemRenameGroup // this.menuItemRenameGroup.Index = 2; this.menuItemRenameGroup.Text = "&Modify"; this.menuItemRenameGroup.Click += new System.EventHandler(this.menuItemRenameGroup_Click); // // splitter1 // this.splitter1.BackColor = System.Drawing.SystemColors.Highlight; this.splitter1.Location = new System.Drawing.Point(120, 0); this.splitter1.Name = "splitter1"; this.splitter1.Size = new System.Drawing.Size(3, 326); this.splitter1.TabIndex = 1; this.splitter1.TabStop = false; // // listViewGroupsAndTickers // this.listViewGroupsAndTickers.Dock = System.Windows.Forms.DockStyle.Fill; this.listViewGroupsAndTickers.Location = new System.Drawing.Point(123, 0); this.listViewGroupsAndTickers.Name = "listViewGroupsAndTickers"; this.listViewGroupsAndTickers.Size = new System.Drawing.Size(301, 326); this.listViewGroupsAndTickers.TabIndex = 2; // // contextMenuTickerGroupsListView // this.contextMenuTickerGroupsListView.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItemValidateGroup, this.menuItemDownloadQuotesOfCurrentGroup, this.menuItemOpenTickerSelector}); // // menuItemValidateGroup // this.menuItemValidateGroup.Index = 0; this.menuItemValidateGroup.Text = "&Validate"; // // menuItemDownloadQuotesOfCurrentGroup // this.menuItemDownloadQuotesOfCurrentGroup.Index = 1; this.menuItemDownloadQuotesOfCurrentGroup.Text = "&Download quotes"; // // menuItemOpenTickerSelector // this.menuItemOpenTickerSelector.Index = 2; this.menuItemOpenTickerSelector.Text = "&Open Ticker Selector"; // // TickerGroupsViewer // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(424, 326); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.listViewGroupsAndTickers, this.splitter1, this.treeViewGroups}); this.Name = "TickerGroupsViewer"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Ticker-Groups Viewer"; this.Load += new System.EventHandler(this.TickerGroupsViewer_Load); this.ResumeLayout(false); } #endregion #region Tree View Paintig on Load /// <summary> /// fill Tree View with existing groups (at root level) /// </summary> private void fillTreeViewAtRootLevel() { this.oleDbDataAdapter = new OleDbDataAdapter("SELECT * FROM tickerGroups WHERE tgTgId IS NULL" , this.oleDbConnection); this.table = new DataTable(); this.oleDbDataAdapter.Fill(this.table); TreeNode rootNode = new TreeNode("GROUPS"); rootNode.Tag = ""; this.treeViewGroups.Nodes.Add(rootNode); foreach (DataRow row in this.table.Rows) { TreeNode node = new TreeNode((string)row["tgDescription"]); node.Tag = (string)row["tgId"]; rootNode.Nodes.Add(node); } } /// <summary> /// fill the current node with existing groups from the DB /// </summary> private void addNodeChildsToCurrentNode(TreeNode currentNode) { this.oleDbDataAdapter.SelectCommand.CommandText = "SELECT * FROM tickerGroups WHERE tgTgId = '" + (string)currentNode.Tag + "'"; DataTable groupsChild = new DataTable(); this.oleDbDataAdapter.Fill(groupsChild); foreach (DataRow row in groupsChild.Rows) { TreeNode node = new TreeNode((string)row["tgDescription"]); node.Tag = (string)row["tgId"]; currentNode.Nodes.Add(node); } } private void TickerGroupsViewer_Load(object sender, System.EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; this.oleDbConnection.Open(); fillTreeViewAtRootLevel(); foreach(TreeNode node in this.treeViewGroups.Nodes[0].Nodes) { addNodeChildsToCurrentNode(node); } } catch(Exception ex) { MessageBox.Show(ex.ToString()); } finally { Cursor.Current = Cursors.Default; this.oleDbConnection.Close(); } } #endregion #region Paint Child Nodes During selection private void treeViewGroups_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e) { this.selectedGroupID = (string)this.treeViewGroups.SelectedNode.Tag; // It updates the member used by the property SelectedGroupID if((string)this.treeViewGroups.SelectedNode.Tag != "" && this.treeViewGroups.SelectedNode.Nodes.Count == 0) // if the selected node is not the root node and it hasn't got child nodes // it has to be filled with its child nodes (if any) { try { Cursor.Current = Cursors.WaitCursor; this.oleDbConnection.Open(); foreach(TreeNode node in this.treeViewGroups.SelectedNode.Nodes) { addNodeChildsToCurrentNode(node); } } catch(Exception ex) { MessageBox.Show(ex.ToString()); } finally { Cursor.Current = Cursors.Default; this.oleDbConnection.Close(); } } } #endregion #region Add group private void addNodeGroupToCurrentNode(string groupID, string groupDescription) { TreeNode node = new TreeNode(groupDescription); node.Tag = groupID; this.treeViewGroups.SelectedNode.Nodes.Add(node); } internal void AddNewGroupToDataBase(string groupID, string groupDescription, string parentGroupID) { try { Cursor.Current = Cursors.WaitCursor; this.oleDbConnection.Open(); this.oleDbDataAdapter.InsertCommand = new OleDbCommand("INSERT INTO tickerGroups(tgId, tgDescription, tgTgId) " + "VALUES('" + groupID + "','" + groupDescription + "','" + parentGroupID + "')", this.oleDbConnection); this.oleDbDataAdapter.InsertCommand.ExecuteNonQuery(); this.addNodeGroupToCurrentNode(groupID, groupDescription); } catch(Exception ex) { MessageBox.Show(ex.ToString()); } finally { Cursor.Current = Cursors.Default; this.oleDbConnection.Close(); } } internal void AddNewGroupToDataBase(string groupID, string groupDescription) { try { Cursor.Current = Cursors.WaitCursor; this.oleDbConnection.Open(); this.oleDbDataAdapter.InsertCommand = new OleDbCommand("INSERT INTO tickerGroups(tgId, tgDescription) " + "VALUES('" + groupID + "','" + groupDescription + "')", this.oleDbConnection); this.oleDbDataAdapter.InsertCommand.ExecuteNonQuery(); this.addNodeGroupToCurrentNode(groupID, groupDescription); } catch(Exception ex) { MessageBox.Show(ex.ToString()); } finally { Cursor.Current = Cursors.Default; this.oleDbConnection.Close(); } } #endregion #region Modify current Node private void modifyCurrentNode(string newTag, string newText) { this.treeViewGroups.SelectedNode.Text = newText; this.treeViewGroups.SelectedNode.Tag = newTag; } internal void ModifyGroup(string oldGroupID, string groupDescription, string newGroupID) { try { Cursor.Current = Cursors.WaitCursor; this.oleDbConnection.Open(); this.oleDbDataAdapter.UpdateCommand = new OleDbCommand("UPDATE tickerGroups SET tgId =' " + newGroupID + "', tgDescription =' " + groupDescription + "' WHERE tgId =' " + oldGroupID + "'", this.oleDbConnection); this.oleDbDataAdapter.UpdateCommand.ExecuteNonQuery(); this.modifyCurrentNode(newGroupID, groupDescription); } catch(Exception ex) { MessageBox.Show(ex.ToString()); } finally { Cursor.Current = Cursors.Default; this.oleDbConnection.Close(); } } #endregion #region Remove current Node private void removeCurrentNodeAndGroup() { if((string)this.treeViewGroups.SelectedNode.Tag == "") { MessageBox.Show("You can not delete the root node!", "Error message", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if(MessageBox.Show("Do you really want to delete the current group and " + "all its groups and tickers?", "Confirm deletion", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.No) { return; } deleteCurrentGroup(this.treeViewGroups.SelectedNode); this.treeViewGroups.SelectedNode.Remove(); } private void deleteCurrentGroup(TreeNode nodeCorrespondingToGroup) { try { Cursor.Current = Cursors.WaitCursor; this.oleDbConnection.Open(); this.oleDbDataAdapter.DeleteCommand = new OleDbCommand("DELETE * FROM tickerGroups WHERE tgId = '" + nodeCorrespondingToGroup.Tag + "'", this.oleDbConnection); this.oleDbDataAdapter.DeleteCommand.ExecuteNonQuery(); } catch(Exception ex) { MessageBox.Show(ex.ToString()); } finally { Cursor.Current = Cursors.Default; this.oleDbConnection.Close(); } } #endregion private void menuItemAddNewGroup_Click(object sender, System.EventArgs e) { GroupEditor groupEditor = new GroupEditor(this); groupEditor.Show(); } private void menuItemRemoveGroup_Click(object sender, System.EventArgs e) { this.removeCurrentNodeAndGroup(); } private void menuItemRenameGroup_Click(object sender, System.EventArgs e) { if((string)this.treeViewGroups.SelectedNode.Tag == "") // it is the root node { MessageBox.Show("The root node can't be modified!"); return; } GroupEditor groupEditor = new GroupEditor(this, this.treeViewGroups.SelectedNode); groupEditor.Show(); } } } Index: Downloader.csproj =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Downloader.csproj,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Downloader.csproj 25 Jan 2004 15:50:27 -0000 1.11 --- Downloader.csproj 4 Feb 2004 19:27:10 -0000 1.12 *************** *** 166,169 **** --- 166,179 ---- /> <File + RelPath = "GroupEditor.cs" + SubType = "Form" + BuildAction = "Compile" + /> + <File + RelPath = "GroupEditor.resx" + DependentUpon = "GroupEditor.cs" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "Main.cs" SubType = "Form" *************** *** 196,199 **** --- 206,219 ---- /> <File + RelPath = "TickerGroupsViewer.cs" + SubType = "Form" + BuildAction = "Compile" + /> + <File + RelPath = "TickerGroupsViewer.resx" + DependentUpon = "TickerGroupsViewer.cs" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "TickerViewer.cs" SubType = "Form" *************** *** 217,221 **** <File RelPath = "QuotesEditor\QuotesChart.cs" ! SubType = "UserControl" BuildAction = "Compile" /> --- 237,241 ---- <File RelPath = "QuotesEditor\QuotesChart.cs" ! SubType = "Code" BuildAction = "Compile" /> *************** *** 227,231 **** <File RelPath = "QuotesEditor\CloseToClose\CloseToCloseChart.cs" ! SubType = "UserControl" BuildAction = "Compile" /> --- 247,251 ---- <File RelPath = "QuotesEditor\CloseToClose\CloseToCloseChart.cs" ! SubType = "Code" BuildAction = "Compile" /> Index: Main.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/Main.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Main.cs 22 Jan 2004 23:51:49 -0000 1.5 --- Main.cs 4 Feb 2004 19:27:10 -0000 1.6 *************** *** 107,110 **** --- 107,111 ---- this.menuItemTickerGroupsViewer.Index = 1; this.menuItemTickerGroupsViewer.Text = "Ticker-Groups Viewer"; + this.menuItemTickerGroupsViewer.Click += new System.EventHandler(this.menuItemTickerGroupsViewer_Click); // // menuImport *************** *** 232,235 **** --- 233,242 ---- } + private void menuItemTickerGroupsViewer_Click(object sender, System.EventArgs e) + { + TickerGroupsViewer tickerGroupsViewer = new TickerGroupsViewer(); + tickerGroupsViewer.Show(); + } + } } |