- Timestamp:
- 09/05/11 14:02:51 (13 years ago)
- Location:
- branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Data/View
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Data/View/ColumnGroupView.Designer.cs
r6134 r6707 65 65 /// </summary> 66 66 private void InitializeComponent() { 67 this.components = new System.ComponentModel.Container(); 67 68 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); 68 69 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); … … 85 86 this.lblStdDev = new System.Windows.Forms.Label(); 86 87 this.lblMedian = new System.Windows.Forms.Label(); 88 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 87 89 ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); 90 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 88 91 this.splitContainer1.Panel1.SuspendLayout(); 89 92 this.splitContainer1.Panel2.SuspendLayout(); … … 132 135 this.txtColumnGroupName.Size = new System.Drawing.Size(397, 20); 133 136 this.txtColumnGroupName.TabIndex = 1; 137 this.txtColumnGroupName.Click += new System.EventHandler(this.txtColumnGroupName_Click); 134 138 this.txtColumnGroupName.DoubleClick += new System.EventHandler(this.txtColumnGroupName_DoubleClick); 135 this.txtColumnGroupName.Click += new System.EventHandler(this.txtColumnGroupName_Click);136 139 this.txtColumnGroupName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtColumnGroupName_KeyDown); 137 140 this.txtColumnGroupName.Leave += new System.EventHandler(this.txtColumnGroupName_Leave); … … 321 324 this.splitContainer1.Panel1.PerformLayout(); 322 325 this.splitContainer1.Panel2.ResumeLayout(false); 326 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); 323 327 this.splitContainer1.ResumeLayout(false); 324 328 this.tableLayoutPanel1.ResumeLayout(false); … … 348 352 private System.Windows.Forms.Label label7; 349 353 private System.Windows.Forms.Label lblStdDev; 354 private System.Windows.Forms.ToolTip toolTip; 350 355 } 351 356 } -
branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Data/View/ColumnGroupView.cs
r6134 r6707 49 49 this.dataGridView.Dock = DockStyle.Top | DockStyle.Bottom; 50 50 this.dataGridView.VirtualMode = true; 51 this.dataGridView.ShowCellToolTips = false; 51 52 52 53 this.dataGridView.ColumnHeaderMouseClick += new DataGridViewCellMouseEventHandler(dataGridView_ColumnHeaderMouseClick); … … 60 61 this.dataGridView.Resize += new EventHandler(dataGridView_Resize); 61 62 this.dataGridView.RowHeadersWidthChanged += new EventHandler(dataGridView_RowHeadersWidthChanged); 63 this.dataGridView.CellMouseEnter += new DataGridViewCellEventHandler(dataGridView_CellMouseEnter); 62 64 63 65 //delegates for virtual mode … … 480 482 } 481 483 484 private void dataGridView_CellMouseEnter(object sender, DataGridViewCellEventArgs e) { 485 if (e.RowIndex == -1 && e.ColumnIndex != -1) { 486 toolTip.SetToolTip(this.dataGridView, ToExcelColumnIndex(e.ColumnIndex)); 487 } else { 488 toolTip.Hide(this.dataGridView); 489 } 490 } 491 492 493 494 private string ToExcelColumnIndex(int index) { 495 //if (symb.Length == 1) { // 'A' .. 'Z' 496 // return TryTranslateColumnIndexDigit(symb[0], out columnIndex); 497 //} else if (symb.Length == 2) { // 'AA' ... 'ZZ' 498 // bool ok; 499 // int d0, d1; 500 // ok = TryTranslateColumnIndexDigit(symb[0], out d1) & TryTranslateColumnIndexDigit(symb[1], out d0); 501 // columnIndex = (d1 + 1) * 26 + d0; 502 // return ok; 503 //} else { 504 // columnIndex = 0; 505 // return false; 506 //} 507 #region digits 508 var digits = new char[] { 509 '#', 510 'A', 511 'B', 512 'C', 513 'D', 514 'E', 515 'F', 516 'G', 517 'H', 518 'I', 519 'J', 520 'K', 521 'L', 522 'M', 523 'N', 524 'O', 525 'P', 526 'Q', 527 'R', 528 'S', 529 'T', 530 'U', 531 'V', 532 'W', 533 'X', 534 'Y', 535 'Z'}; 536 int b = digits.Length - 1; 537 #endregion 538 string excelIndex = string.Empty; 539 index = index + 1; 540 while (index > 0) { 541 int d = index / b; 542 int rem = index % b; 543 index = d; 544 excelIndex = digits[rem] + excelIndex; 545 } 546 return excelIndex; 547 } 548 482 549 #region DataGridView virtual mode event handler 483 550
Note: See TracChangeset
for help on using the changeset viewer.