[Quantproject-developers] QuantDownloader/Downloader/QuotesEditor QuotesEditor.cs,1.4,1.5
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2004-03-28 20:41:23
|
Update of /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31058/Downloader/QuotesEditor Modified Files: QuotesEditor.cs Log Message: - added a private tickerQuotes DataTable: all validation features will work on these quotes - suspiciousRatio is provided by the ConstantProvider class now - added the Renew method to refresh the form when some visual validation is applied Index: QuotesEditor.cs =================================================================== RCS file: /cvsroot/quantproject/QuantDownloader/Downloader/QuotesEditor/QuotesEditor.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** QuotesEditor.cs 24 Mar 2004 18:25:10 -0000 1.4 --- QuotesEditor.cs 28 Mar 2004 20:30:00 -0000 1.5 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Data; using System.Drawing; using System.Collections; *************** *** 5,8 **** --- 6,10 ---- using System.Windows.Forms; using scpl; + using QuantProject.ADT; using QuantProject.ADT.Histories; using QuantProject.Data; *************** *** 16,23 **** public class QuotesEditor : System.Windows.Forms.Form { ! private double suspiciousRatio = 3; ! private ValidateDataTable validateDataTable; ! private CloseToCloseTabPage closeToCloseTabPage = new CloseToCloseTabPage(); private ValidationTabPage validationTabPage = new ValidationTabPage(); private ValidationTabControl validationTabControl = new ValidationTabControl(); --- 18,25 ---- public class QuotesEditor : System.Windows.Forms.Form { ! private DataTable tickerQuotes; private ValidateDataTable validateDataTable; ! private DataTable quotesTable; ! // private CloseToCloseTabPage closeToCloseTabPage = new CloseToCloseTabPage(); private ValidationTabPage validationTabPage = new ValidationTabPage(); private ValidationTabControl validationTabControl = new ValidationTabControl(); *************** *** 28,31 **** --- 30,40 ---- private System.Windows.Forms.TextBox textBoxTicker; private QuantProject.Applications.Downloader.QuotesChart quotesChart; + + public DataTable QuotesTable + { + get { return this.quotesTable; } + set { this.quotesTable = value; } + } + /// <summary> /// Required designer variable. *************** *** 39,46 **** this.validateDataTable = new ValidateDataTable(); } - this.validateDataTable.Clear(); this.validateDataTable.Rows.Clear(); this.validateDataTable.AddRows( this.textBoxTicker.Text , ! this.suspiciousRatio ); } --- 48,55 ---- this.validateDataTable = new ValidateDataTable(); } this.validateDataTable.Rows.Clear(); + // this.validateDataTable.Clear(); this.validateDataTable.AddRows( this.textBoxTicker.Text , ! ConstantsProvider.SuspiciousRatio ); } *************** *** 57,251 **** } ! 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 #region tabPageChart ! private void tabPageChart_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! this.quotesChart.Ticker = this.textBoxTicker.Text; this.quotesChart.Invalidate(); ! // quotesChart.PaintingHandler( this.textBoxTicker.Text ); ! } #endregion #region tabPageValidation ! 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; ! } #endregion #region tabPageOHLC ! private void tabPageOHLC_Click(object sender, System.EventArgs e) ! { ! } ! private void tabPageOHLC_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! // this.openHighLowCloseDataGrid.DataBind( this.validateDataTable ); ! } #endregion ! 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) --- 66,259 ---- } ! public string Ticker ! { ! get { return this.textBoxTicker.Text; } ! } ! public QuotesEditor( string ticker ) ! { ! // ! // Required for Windows Form Designer support ! // ! InitializeComponent(); + this.addQuotesChart(); ! 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; ! } ! ! private void addQuotesChart() ! { ! this.quotesChart = new QuotesChart(); ! this.quotesChart.Dock = DockStyle.Fill; ! this.tabPageChart.Controls.Add( this.quotesChart ); ! } ! ! /// <summary> ! /// populates the datatable for ticker quotes ! /// </summary> ! private void getTickerQuotes() ! { ! this.tickerQuotes = DataProvider.GetTickerQuotes( this.textBoxTicker.Text ); ! } ! ! /// <summary> ! /// rebuilds and redisplays the QuotesEditor ! /// </summary> ! public void Renew() ! { ! getTickerQuotes(); ! this.validationTabControl.Clear(); ! this.updateValidateDataTable(); ! // this.closeToCloseTabPage.Clear(); ! base.Invalidate(); ! } ! /// <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.tabPageQuotes = new System.Windows.Forms.TabPage(); ! this.textBoxTicker = new System.Windows.Forms.TextBox(); ! this.tabControl1.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.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); ! // ! // 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.ResumeLayout(false); ! } #endregion #region tabPageChart ! private void tabPageChart_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! this.quotesChart.Ticker = this.textBoxTicker.Text; this.quotesChart.Invalidate(); ! // quotesChart.PaintingHandler( this.textBoxTicker.Text ); ! } #endregion #region tabPageValidation ! private void tabPageValidation_Click(object sender, System.EventArgs e) ! { ! this.validateDataTable.Rows.Clear(); ! this.validateDataTable.AddRows( this.textBoxTicker.Text , ConstantsProvider.SuspiciousRatio ); ! // this.openHighLowCloseUserControl.ValidateDataTable = this.validateDataTable; ! // this.closeToCloseUserControl.Ticker = this.textBoxTicker.Text; ! } #endregion #region tabPageOHLC ! private void tabPageOHLC_Click(object sender, System.EventArgs e) ! { ! } ! private void tabPageOHLC_Paint(object sender, System.Windows.Forms.PaintEventArgs e) ! { ! // this.openHighLowCloseDataGrid.DataBind( this.validateDataTable ); ! } #endregion ! 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 , ConstantsProvider.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) |