[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomesDeb
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2006-07-22 20:37:24
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomesDebugger In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2229/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomesDebugger Modified Files: WFLagDebugChosenPositionsCollection.cs Log Message: - the WFLagDebugChosenPositionsCollection constructor now requires also the number of in sample days, the benchmark and a list of chosen positions debug info - the right click on a single chosen positions debug info data grid row is handled now (the DebugGenome form is invoked, for that exact genome) Index: WFLagDebugChosenPositionsCollection.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/WFLagGenomesDebugger/WFLagDebugChosenPositionsCollection.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WFLagDebugChosenPositionsCollection.cs 22 Jun 2006 20:53:06 -0000 1.1 --- WFLagDebugChosenPositionsCollection.cs 22 Jul 2006 20:37:20 -0000 1.2 *************** *** 40,46 **** private System.ComponentModel.Container components = null; ! private ICollection chosenPositionsCollection; ! public WFLagDebugChosenPositionsCollection( ICollection chosenPositionsCollection ) { // --- 40,49 ---- private System.ComponentModel.Container components = null; ! private ArrayList chosenPositionsDebugInfoList; ! private int inSampleDays; ! string benchmark; ! public WFLagDebugChosenPositionsCollection( int inSampleDays , string benchmark , ! ArrayList chosenPositionsDebugInfoList ) { // *************** *** 52,56 **** // TODO: Add any constructor code after InitializeComponent call // ! this.chosenPositionsCollection = chosenPositionsCollection; this.updateGrid(); } --- 55,62 ---- // TODO: Add any constructor code after InitializeComponent call // ! this.inSampleDays = inSampleDays; ! this.benchmark = benchmark; ! this.chosenPositionsDebugInfoList = chosenPositionsDebugInfoList; ! this.setDataGridTableStyle(); this.updateGrid(); } *************** *** 90,93 **** --- 96,100 ---- this.dataGridChosenPositionsWithAttributes.Size = new System.Drawing.Size(576, 240); this.dataGridChosenPositionsWithAttributes.TabIndex = 0; + this.dataGridChosenPositionsWithAttributes.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dataGridChosenPositionsWithAttributes_MouseUp); // // WFLagDebugChosenPositionsCollection *************** *** 106,115 **** private void updateGrid() { this.dataGridChosenPositionsWithAttributes.DataSource = ! this.chosenPositionsCollection; this.dataGridChosenPositionsWithAttributes.Refresh(); } } } --- 113,172 ---- + private void setDataGridTableStyle() + { + DataGridTableStyle dataGridTableStyle = new DataGridTableStyle( true ); + // DataGridColumnStyle dataGridColumnStyle = new DataGridColumnStyle(); + } private void updateGrid() { this.dataGridChosenPositionsWithAttributes.DataSource = ! this.chosenPositionsDebugInfoList; this.dataGridChosenPositionsWithAttributes.Refresh(); } + + #region DataGridMouseClickEventHandler + private int rightClickEventHandler_getRowNumber( object sender , + MouseEventArgs eventArgs ) + { + DataGrid dataGrid = (DataGrid)sender; + Point point = new Point( eventArgs.X , eventArgs.Y ); + DataGrid.HitTestInfo hitTestInfo = dataGrid.HitTest( point ); + // DataTable dataTable = (DataTable)dataGrid.DataSource; + return hitTestInfo.Row; + } + private WFLagChosenPositions rightClickEventHandler_getWFLagChosenPositions( + DataGrid dataGrid , int rowNumber ) + { + // DataTable dataTable = (DataTable)dataGrid.DataSource; + WFLagChosenPositionsDebugInfo wFLagChosenPositionsDebugInfo = + (WFLagChosenPositionsDebugInfo)(this.chosenPositionsDebugInfoList[ rowNumber ]); + WFLagChosenPositions wFLagChosenPositions = + wFLagChosenPositionsDebugInfo.GetChosenPositions(); + return wFLagChosenPositions; + } + + private WFLagChosenPositions rightClickEventHandler_getWFLagChosenPositions( + object sender, System.Windows.Forms.MouseEventArgs e ) + { + int rowNumber = rightClickEventHandler_getRowNumber( + sender , e ); + WFLagChosenPositions wFLagChosenPositions = + this.rightClickEventHandler_getWFLagChosenPositions( (DataGrid)sender , rowNumber ); + return wFLagChosenPositions; + } + private void rightClickEventHandler(object sender, System.Windows.Forms.MouseEventArgs e) + { + WFLagChosenPositions wFLagChosenPositions = + this.rightClickEventHandler_getWFLagChosenPositions( sender , e ); + WFLagDebugGenome wFLagDebugGenome = new WFLagDebugGenome( wFLagChosenPositions , + this.inSampleDays , this.benchmark ); + wFLagDebugGenome.Show(); + } + private void dataGridChosenPositionsWithAttributes_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) + { + if ( e.Button == MouseButtons.Right ) + this.rightClickEventHandler( sender , e ); + } + #endregion } } |