[Quantproject-developers] QuantDownloader/Downloader TickerViewer.cs,1.4,1.5
Brought to you by:
glauco_1
|
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()); + } + |