public void SelectRow_ShouldMaintain_ActivePosition() { // set up special conditions var grid = new Grid(); grid.Redim(1, 1); grid[0, 0] = new Cell(); var form = new Form(); form.Controls.Add(grid); form.Show(); grid.SelectionMode = GridSelectionMode.Row; grid.Selection.EnableMultiSelection = false; // just assert that we have correct conditions for test, // active position should not be empty grid.Selection.Focus(new Position(0, 0), true); Assert.AreEqual(new Position(0, 0), grid.Selection.ActivePosition); // this method causes first row to be selected. Should not fail // it failed once in RowSelection.SelectRow method // As call to ResetSelection asked to maintain focus, a stack overflow was raised grid.Selection.SelectRow(0, true); Assert.AreEqual(new Position(0, 0), grid.Selection.ActivePosition); // destroy form.Close(); form.Dispose(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.grid = new SourceGrid.Grid(); this.SuspendLayout(); // // grid // this.grid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom))); this.grid.EnableSort = true; this.grid.Location = new System.Drawing.Point(13, 13); this.grid.Name = "grid"; this.grid.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows; this.grid.SelectionMode = SourceGrid.GridSelectionMode.Cell; this.grid.Size = new System.Drawing.Size(259, 250); this.grid.TabIndex = 0; this.grid.TabStop = true; this.grid.ToolTipText = ""; // // frmLinkedControlSample // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 264); this.Controls.Add(this.grid); this.Name = "frmLinkedControlSample"; this.Text = "frmLinkedControlSample"; this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.grid1 = new SourceGrid.Grid(); this.SuspendLayout(); // // grid1 // this.grid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.grid1.EnableSort = true; this.grid1.Location = new System.Drawing.Point(10, 9); this.grid1.Name = "grid1"; this.grid1.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows; this.grid1.SelectionMode = SourceGrid.GridSelectionMode.Cell; this.grid1.Size = new System.Drawing.Size(608, 421); this.grid1.TabIndex = 0; this.grid1.TabStop = true; this.grid1.ToolTipText = ""; // // frmSample21 // this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.ClientSize = new System.Drawing.Size(628, 438); this.Controls.Add(this.grid1); this.Name = "frmSample21"; this.Text = "ColumnSpan and RowSpan"; this.Load += new System.EventHandler(this.frmSample14_Load); this.ResumeLayout(false); }
public void ApplyColorScheme(SourceGrid.Grid grid, TrainingPlanDay planDay) { foreach (var row in grid.Rows) { var item = (StrengthTrainingItemDTO)row.Tag; for (int i = 0; i < planDay.Entries.Count; i++) { var planEntry = planDay.Entries[i]; for (int j = 0; j < planEntry.Sets.Count; j++) { if (grid.RowsCount > i + 1) { //Cell cell = (Cell)grid.GetCell(i+1,usrStrengthTrainingSourceGridBase.StandardColumnNumber + j); //Serie serie = cell.Tag as Serie; //if(serie!=null) //{ // cell.View.BackColor = Color.LightGoldenrodYellow; //} //else //{ // cell.View.BackColor = Color.LightPink; //} ApplyColorScheme(grid.Rows[i + 1], planEntry); } } } } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.grid = new SourceGrid.Grid(); this.SuspendLayout(); // // grid // this.grid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.grid.AutoStretchColumnsToFitWidth = false; this.grid.AutoStretchRowsToFitHeight = false; this.grid.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.grid.CustomSort = false; this.grid.Location = new System.Drawing.Point(12, 12); this.grid.Name = "grid"; this.grid.Size = new System.Drawing.Size(516, 368); this.grid.SpecialKeys = SourceGrid.GridSpecialKeys.Default; this.grid.TabIndex = 0; // // frmSample3 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(540, 391); this.Controls.Add(this.grid); this.Name = "frmSample3"; this.Text = "Cell Editors, Specials Cells, Formatting and Image"; this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.grid1 = new SourceGrid.Grid(); this.SuspendLayout(); // // grid1 // this.grid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.grid1.Location = new System.Drawing.Point(8, 8); this.grid1.Name = "grid1"; this.grid1.Size = new System.Drawing.Size(612, 423); this.grid1.SpecialKeys = SourceGrid.GridSpecialKeys.Default; this.grid1.TabIndex = 0; // // frmSample21 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(628, 438); this.Controls.Add(this.grid1); this.Name = "frmSample21"; this.Text = "ColumnSpan and RowSpan"; this.Load += new System.EventHandler(this.frmSample14_Load); this.ResumeLayout(false); }
public override void GridInsertRow <T>( SourceGrid.Grid grid, T item, Func <T, Color, mySourceGridTools.GridCellController> newCellController = null, int Index = -1) { int index = Index < 0 ? grid.RowsCount : Index; grid.Rows.Insert(index); grid.Rows[index].Tag = item; Type itemType = item.GetType(); SourceGrid.Cells.Controllers.IController CellController = (newCellController == null ? new GridCellController(Color.LightBlue) : CellController = newCellController(item, Color.LightBlue) ); if (itemType == typeof(MyRow)) { MyRow row = item as MyRow; for (int i = 0; i < row.Count; i++) { grid[index, i] = newCell(row, row[Fields[i]], CellController); } return; } { grid[index, 0] = newCell(item, item, CellController); } }
public void GetCell_NonExistent() { SourceGrid.Grid grid1 = new Grid(); grid1.Redim(2, 2); Assert.AreEqual(null, grid1.GetCell(0, 0)); }
public void GetCell_OutOfBounds() { Grid grid = new Grid(); grid.Redim(5, 5); Assert.AreEqual(null, grid.GetCell(new Position(10, 10))); }
public override void OnDoubleClick(CellContext sender, EventArgs e) { base.OnDoubleClick(sender, e); //LinearAudioPlayer.PlayController.playForGridNo( // 1, false); SourceGrid.Grid grid = (SourceGrid.Grid)sender.Grid; //LinearAudioPlayer.FilteringGridController.setRowColor( // LinearAudioPlayer.FilteringGridController.LastSelectRowNo, EnuPlayType.NOPLAY); //LinearAudioPlayer.LinkGridController.setRowColor(sender.Position.Row, EnuPlayType.PLAYING); //LinearAudioPlayer.GroupGridController.setRowColor(LinearAudioPlayer.GroupGridController.LastSelectRowNo, GroupGridController.EnuPlayType.NOPLAY); //LinearGlobal.LinearConfig.PlayerConfig.SelectFilter = grid[sender.Position.Row, 0].Value.ToString(); switch (LinearAudioPlayer.LinkGridController.mode) { case EnuMode.NOWPLAYING: case EnuMode.SAMEARTIST: AnyGridItemInfo anyGridItem = (AnyGridItemInfo)grid[sender.Position.Row, 0].Tag; LinearAudioPlayer.PlayController.skipPlayingList((long)anyGridItem.Value); LinearAudioPlayer.PlayController.play((long)anyGridItem.Value, false, true); break; case EnuMode.SIMILARARTIST: LinearGlobal.MainForm.ListForm.setFilteringText(grid[sender.Position.Row, 0].Value.ToString()); break; } }
public override void GridInsertRow <T>( SourceGrid.Grid grid, T item, Func <T, Color, Base.Grid.GridCellController> newCellController = null, int Index = -1) { int index = Index < 0 ? grid.RowsCount : Index; grid.Rows.Insert(index); grid.Rows[index].Tag = item; Type itemType = item.GetType(); if (itemType == typeof(IPInfo)) { IPInfo ipInfo = item as IPInfo; SourceGrid.Cells.Controllers.IController CellController = newCellController(item, Color.LightBlue); grid[index, 0] = newCell(ipInfo, ipInfo.IPAddressStr, CellController); grid[index, 1] = newCell(ipInfo, ipInfo.RoundtripTime, CellController); grid[index, 2] = newCell(ipInfo, ipInfo.HostName, CellController); grid[index, 3] = newCell(ipInfo, ipInfo.HostMac, CellController); Console.WriteLine(ipInfo.IPAddressStr); return; } { SourceGrid.Cells.Controllers.IController CellController = newCellController(item, Color.LightBlue); grid[index, 0] = newCell(item, item, CellController); } }
public void TestTabMovement_DoesLoopCorrectly_ThroughSpannedRowCells() { using (var form = new Form()) { Grid grid1 = new Grid(); grid1.Redim(40,3); grid1.FixedColumns = 1; grid1.FixedRows = 1; Random rnd = new Random(); for (int r = 0; r < grid1.RowsCount/2; r++) { for (int c = 0; c < grid1.ColumnsCount; c++) { grid1[r * 2, c] = new SourceGrid.Cells.Cell(r*c); grid1[r * 2, c].RowSpan = 2; } } form.Controls.Add(grid1); form.Show(); Assert.AreEqual(true, grid1.Selection.Focus(new Position(0, 0), true)); Assert.AreEqual(new Position(0, 0), grid1.Selection.ActivePosition); Assert.AreEqual(true, grid1.Selection.Focus(new Position(1, 0), true)); Assert.AreEqual(new Position(1, 0), grid1.Selection.ActivePosition); form.Close(); } }
public void InsertOverlappingCell() { SourceGrid.Grid grid1 = new Grid(); grid1.Redim(2, 2); // this cell should span both to the right, and to the left grid1[0, 0] = new SourceGrid.Cells.Cell("Text Span", typeof(string));; grid1[0, 0].ColumnSpan = 2; grid1[0, 1] = new SourceGrid.Cells.Cell("This should throw OverlappingCellException"); }
public void ModifyRowSpan_ToCauseOverlapping() { SourceGrid.Grid grid1 = new Grid(); grid1.Redim(6, 2); // this cell should span both to the right, and to the left grid1[4, 0] = new SourceGrid.Cells.Cell("cell to span", typeof(string)); grid1[5, 0] = new SourceGrid.Cells.Cell("cell to overlap", typeof(string)); // this should throw exception grid1[4, 0].RowSpan = 2; }
public void ModifyColumnSpan_ToCauseOverlapping() { SourceGrid.Grid grid1 = new Grid(); grid1.Redim(2, 6); // this cell should span both to the right, and to the left grid1[0, 4] = new SourceGrid.Cells.Cell("cell to span", typeof(string)); grid1[0, 5] = new SourceGrid.Cells.Cell("cell to overlap", typeof(string)); // this should throw exception grid1[0, 4].ColumnSpan = 2; }
public void SubscriptionToEventsAreNotChanged_After_SelectionIsChanged() { int selectionChangedCount = 0; Grid grid = new Grid(); grid.Redim(5, 5); grid[1, 1] = new SourceGrid.Cells.Cell("b"); grid.Selection.SelectionChanged += delegate { selectionChangedCount++; }; grid.SelectionMode = GridSelectionMode.Row; grid.Selection.SelectCell(new Position(1, 1), true); Assert.AreEqual(1, selectionChangedCount); }
public override void OnEditEnded(CellContext sender, System.EventArgs e) { base.OnEditEnded(sender, e); SourceGrid.Grid grid = (SourceGrid.Grid)sender.Grid; if (sender.Position.Column < grid.Columns.Count - 1) { grid[sender.Position.Row, sender.Position.Column + 1].Focus(); } else if (sender.Position.Row < grid.Rows.Count - 1) { grid[sender.Position.Row + 1, grid.FixedColumns].Focus(); } }
public Grid CreateGridWithRows(int rowCount) { Grid grid1 = new Grid(); grid1.ColumnsCount = 1; grid1.SelectionMode = GridSelectionMode.Row; for (int r = 0; r < rowCount; r++) { grid1.Rows.Insert(r); grid1[r, 0] = new SourceGrid.Cells.Cell("Hello " + r.ToString(), typeof(string)); } grid1.AutoSizeCells(); grid1.SelectionMode = GridSelectionMode.Row; return grid1; }
public void GetCell() { SourceGrid.Grid grid1 = new Grid(); grid1.Redim(2, 2); Cell visibleCell = new SourceGrid.Cells.Cell("Text Span", typeof(string)); // this cell should span both to the right, and to the left grid1[0, 0] = visibleCell; grid1[0, 0].RowSpan = 2; grid1[0, 0].ColumnSpan = 2; Assert.AreEqual(visibleCell, grid1.GetCell(0, 0)); Assert.AreEqual(visibleCell, grid1.GetCell(0, 1)); Assert.AreEqual(visibleCell, grid1.GetCell(1, 0)); Assert.AreEqual(visibleCell, grid1.GetCell(1, 1)); }
public void SelectSpannedCells_SingleCell() { // just select a single cell. Should select whole spanned cell Grid grid1 = new Grid(); grid1.Redim(6, 6); grid1[0, 0] = new SourceGrid.Cells.Cell(); grid1[0, 0].ColumnSpan = 3; grid1[0, 0].RowSpan = 3; grid1[0, 3] = new SourceGrid.Cells.Cell(); grid1[0, 3].ColumnSpan = 3; grid1[0, 3].RowSpan = 3; grid1.Selection.SelectCell(new Position(0, 0), true); RangeRegion region = grid1.Selection.GetSelectionRegion(); Assert.AreEqual(1, region.Count); Assert.AreEqual(new Range(0, 0, 2, 2), region[0]); }
/// <summary> /// 右クリックで選択状態にする。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override void OnMouseDown(CellContext sender, MouseEventArgs e) { base.OnMouseDown(sender, e); if (e.Button == MouseButtons.Left) { SourceGrid.Grid grid = (SourceGrid.Grid)sender.Grid; LinearAudioPlayer.GroupGridController.setRowColor(LinearAudioPlayer.GroupGridController.LastSelectRowNo, EnuPlayType.NOPLAY); LinearAudioPlayer.GroupGridController.setRowColor(sender.Position.Row, EnuPlayType.PLAYING); LinearAudioPlayer.FilteringGridController.setRowColor(LinearAudioPlayer.FilteringGridController.LastSelectRowNo, FilteringGridController.EnuPlayType.NOPLAY); LinearGlobal.LinearConfig.PlayerConfig.SelectFilter = grid[sender.Position.Row, 0].Value.ToString(); LinearGlobal.FilteringMode = LinearAudioPlayer.GroupGridController.LastFilteringMode; LinearGlobal.MainForm.ListForm.reloadDatabase(true); LinearAudioPlayer.GroupGridController.Grid.Focus(); } }
public void SelectSpannedCells_SingleCell_DoubleSelection() { // select at two positions the same cell Grid grid1 = new Grid(); grid1.Redim(6, 6); grid1[0, 0] = new SourceGrid.Cells.Cell(); grid1[0, 0].ColumnSpan = 3; grid1[0, 0].RowSpan = 3; grid1[0, 3] = new SourceGrid.Cells.Cell(); grid1[0, 3].ColumnSpan = 3; grid1[0, 3].RowSpan = 3; grid1.Selection.SelectRange(new Range(0, 0, 0, 1), true); RangeRegion region = grid1.Selection.GetSelectionRegion(); Assert.AreEqual(1, region.Count); Assert.AreEqual(new Range(0, 0, 2, 2), region[0]); }
public override void GridUpdateRow( SourceGrid.Grid grid, object item, int Index) { grid.Rows[Index].Tag = item; Type itemType = item.GetType(); if (itemType == typeof(MyRow)) { MyRow row = item as MyRow; for (int i = 0; i < row.Count; i++) { grid[Index, 0].Value = row[Fields[i]]; grid[Index, i].Tag = row; } return; } { grid[Index, 0].Value = item; } }
public void ResetSelection_DoesNotInfiniteLoop() { // set up special conditions var grid = new Grid(); grid.Redim(1, 1); grid[0, 0] = new Cell(); var form = new Form(); form.Controls.Add(grid); form.Show(); grid.SelectionMode = GridSelectionMode.Row; grid.Selection.EnableMultiSelection = false; // this method causes first row to be selected. Should not fail // it failed once in RowSelection.SelectRow method // As call to ResetSelection asked to maintain focus, a stack overflow was raised grid.Selection.Focus(new Position(0, 0), false); // destroy form.Close(); form.Dispose(); }
public override void GridUpdateRow( SourceGrid.Grid grid, object item, int Index) { grid.Rows[Index].Tag = item; Type itemType = item.GetType(); if (itemType == typeof(IPInfo)) { IPInfo ipInfo = item as IPInfo; grid[Index, 0].Value = ipInfo.IPAddressStr; grid[Index, 0].Tag = ipInfo; grid[Index, 1].Value = ipInfo.RoundtripTime; grid[Index, 1].Tag = ipInfo; grid[Index, 2].Value = ipInfo.HostName; grid[Index, 2].Tag = ipInfo; grid[Index, 3].Value = ipInfo.HostMac; grid[Index, 2].Tag = ipInfo; return; } { grid[Index, 0].Value = item; } }
private void RegisterContractList(IList<IBSimplefiedContract> list, Grid grid) { var i = 1; foreach (var c in list) { var contract = new IBContract { Currency = c.Currency, Symbol = c.Symbol, Exchange = c.Exchange, SecurityType = c.SecurityType, Expiry = c.Expiry, Multiplier = c.Multiplier.ToString(), Strike = c.Strike, Right = c.PutOrCall }; _client.RequestMarketData(contract, null); _symbolDataMap.Add(contract, new InstrumentDataRecord() {Grid = grid, Row = i}); i++; } }
private void UpdateContractListFromGrid(IList<IBSimplefiedContract> contracts, Grid grid) { contracts.Clear(); // The last row is always empty for (var i = 1; i < grid.Rows.Count - 1; i++) { try { var contract = new IBSimplefiedContract { SecurityType = (IBSecurityType) grid[i, (int) IBGridColumn.SecType].Value, Currency = (string) grid[i, (int) IBGridColumn.Currency].Value, Exchange = (string) grid[i, (int) IBGridColumn.Exchange].Value, Symbol = (string) grid[i, (int) IBGridColumn.Symbol].Value, Rollover = (string) grid[i, (int) IBGridColumn.Rollover].Value, PutOrCall = (string) grid[i, (int) IBGridColumn.PutOrCall].Value }; // SecurityType always has to be present... // String fields are always "safe" if (contract.SecurityType == IBSecurityType.FutureOption || contract.SecurityType == IBSecurityType.Option) { contract.Expiry = (DateTime) grid[i, (int) IBGridColumn.Expiry].Value; contract.Strike = (double) grid[i, (int) IBGridColumn.Strike].Value; contract.Multiplier = (int) grid[i, (int) IBGridColumn.Multiplier].Value; } if (contract.SecurityType == IBSecurityType.FutureOption) { contract.Expiry = (DateTime) grid[i, (int) IBGridColumn.Expiry].Value; contract.Multiplier = (int) grid[i, (int) IBGridColumn.Multiplier].Value; } contracts.Add(contract); } catch (NullReferenceException) { } } }
public LinkGridController(SourceGrid.Grid grid) : base(grid) { }
private void SetColumnsAndRows(string[] columns, string[] rows, Grid grid) { if (grid.InvokeRequired) { SetNumberOfColumnsAndRows d = SetColumnsAndRows; Invoke(d, columns, rows, grid); } else { grid.Rows.Clear(); grid.Columns.Clear(); grid.Rows.Insert(0); grid.Columns.Insert(0); for (int row = 1; row <= rows.Length; row++) { grid.Rows.Insert(row); grid[row, 0] = new RowHeader(rows[row - 1]); for (int column = 1; column <= columns.Length; column++) { if (row == 1) { grid.Columns.Insert(column); grid[0, column] = new SourceGrid.Cells.ColumnHeader(columns[column - 1]); } grid[row, column] = new Cell(); grid[row, column].View = new SourceGrid.Cells.Views.Cell(); } } grid.AutoSizeCells(); } }
private void SetupMarketDataGridColumns(Grid grid) { var secType = (IBSecurityType) grid.Tag; if (secType == IBSecurityType.FutureOption || secType == IBSecurityType.Option) return; grid.Columns[(int) IBGridColumn.AskDelta].Visible = false; grid.Columns[(int) IBGridColumn.BidDelta].Visible = false; grid.Columns[(int) IBGridColumn.BidImpVol].Visible = false; grid.Columns[(int) IBGridColumn.AskImpVol].Visible = false; grid.Columns[(int) IBGridColumn.Delta].Visible = false; grid.Columns[(int) IBGridColumn.Volatility].Visible = false; grid.Columns[(int) IBGridColumn.Price].Visible = false; grid.Columns[(int) IBGridColumn.PVDividend].Visible = false; }
public GridRows(Grid grid) : base(grid) { }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ListEditor)); this.grid = new Grid(); this.btDown = new System.Windows.Forms.Button(); this.btUp = new System.Windows.Forms.Button(); this.btRemove = new System.Windows.Forms.Button(); this.btAdd = new System.Windows.Forms.Button(); this.btrRefreshList = new System.Windows.Forms.Button(); this.SuspendLayout(); // // grid // this.grid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.grid.AutoStretchColumnsToFitWidth = false; this.grid.AutoStretchRowsToFitHeight = false; this.grid.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.grid.CustomSort = false; this.grid.Location = new System.Drawing.Point(4, 32); this.grid.Name = "grid"; this.grid.Size = new System.Drawing.Size(332, 216); this.grid.SpecialKeys = GridSpecialKeys.Default; this.grid.TabIndex = 0; // // btDown // this.btDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btDown.Enabled = false; this.btDown.Image = ((System.Drawing.Image)(resources.GetObject("btDown.Image"))); this.btDown.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; this.btDown.Location = new System.Drawing.Point(312, 4); this.btDown.Name = "btDown"; this.btDown.Size = new System.Drawing.Size(24, 23); this.btDown.TabIndex = 1; this.btDown.Click += new System.EventHandler(this.btDown_Click); // // btUp // this.btUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btUp.Enabled = false; this.btUp.Image = ((System.Drawing.Image)(resources.GetObject("btUp.Image"))); this.btUp.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; this.btUp.Location = new System.Drawing.Point(284, 4); this.btUp.Name = "btUp"; this.btUp.Size = new System.Drawing.Size(24, 23); this.btUp.TabIndex = 2; this.btUp.Click += new System.EventHandler(this.btUp_Click); // // btRemove // this.btRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btRemove.Enabled = false; this.btRemove.Image = ((System.Drawing.Image)(resources.GetObject("btRemove.Image"))); this.btRemove.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; this.btRemove.Location = new System.Drawing.Point(220, 4); this.btRemove.Name = "btRemove"; this.btRemove.Size = new System.Drawing.Size(24, 23); this.btRemove.TabIndex = 3; this.btRemove.Click += new System.EventHandler(this.btRemove_Click); // // btAdd // this.btAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btAdd.Image = ((System.Drawing.Image)(resources.GetObject("btAdd.Image"))); this.btAdd.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; this.btAdd.Location = new System.Drawing.Point(192, 4); this.btAdd.Name = "btAdd"; this.btAdd.Size = new System.Drawing.Size(24, 23); this.btAdd.TabIndex = 4; this.btAdd.Click += new System.EventHandler(this.btAdd_Click); // // btrRefreshList // this.btrRefreshList.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btrRefreshList.Image = ((System.Drawing.Image)(resources.GetObject("btrRefreshList.Image"))); this.btrRefreshList.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; this.btrRefreshList.Location = new System.Drawing.Point(252, 4); this.btrRefreshList.Name = "btrRefreshList"; this.btrRefreshList.Size = new System.Drawing.Size(24, 23); this.btrRefreshList.TabIndex = 5; this.btrRefreshList.Click += new System.EventHandler(this.btrRefreshList_Click); // // ListEditor // this.Controls.Add(this.btrRefreshList); this.Controls.Add(this.btAdd); this.Controls.Add(this.btRemove); this.Controls.Add(this.btUp); this.Controls.Add(this.btDown); this.Controls.Add(this.grid); this.Name = "ListEditor"; this.Size = new System.Drawing.Size(340, 252); this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.grid1 = new SourceGrid.Grid(); this.buttonEditCell = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.buttonInsertRow = new System.Windows.Forms.Button(); this.label3 = new System.Windows.Forms.Label(); this.numericUpDownRowIndex = new System.Windows.Forms.NumericUpDown(); this.label4 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownRowIndex)).BeginInit(); this.SuspendLayout(); // // grid1 // this.grid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.grid1.EnableSort = true; this.grid1.Location = new System.Drawing.Point(8, 94); this.grid1.Name = "grid1"; this.grid1.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows; this.grid1.SelectionMode = SourceGrid.GridSelectionMode.Cell; this.grid1.Size = new System.Drawing.Size(682, 404); this.grid1.TabIndex = 0; this.grid1.TabStop = true; this.grid1.ToolTipText = ""; // // buttonEditCell // this.buttonEditCell.Location = new System.Drawing.Point(109, 19); this.buttonEditCell.Name = "buttonEditCell"; this.buttonEditCell.Size = new System.Drawing.Size(97, 20); this.buttonEditCell.TabIndex = 1; this.buttonEditCell.Text = "Edit cell"; this.buttonEditCell.UseVisualStyleBackColor = true; // // label1 // this.label1.Location = new System.Drawing.Point(10, 25); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(71, 13); this.label1.TabIndex = 3; this.label1.Text = "Click to edit"; // // groupBox1 // this.groupBox1.Controls.Add(this.buttonEditCell); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Location = new System.Drawing.Point(8, 12); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(212, 76); this.groupBox1.TabIndex = 4; this.groupBox1.TabStop = false; this.groupBox1.Text = "Edit cell"; // // groupBox2 // this.groupBox2.Controls.Add(this.buttonInsertRow); this.groupBox2.Controls.Add(this.label3); this.groupBox2.Controls.Add(this.numericUpDownRowIndex); this.groupBox2.Controls.Add(this.label4); this.groupBox2.Location = new System.Drawing.Point(226, 12); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(238, 76); this.groupBox2.TabIndex = 4; this.groupBox2.TabStop = false; this.groupBox2.Text = "Insert row"; // // buttonInsertRow // this.buttonInsertRow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonInsertRow.Location = new System.Drawing.Point(135, 19); this.buttonInsertRow.Name = "buttonInsertRow"; this.buttonInsertRow.Size = new System.Drawing.Size(97, 20); this.buttonInsertRow.TabIndex = 1; this.buttonInsertRow.Text = "Insert row"; this.buttonInsertRow.UseVisualStyleBackColor = true; this.buttonInsertRow.Click += new System.EventHandler(this.ButtonInsertRowClick); // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(10, 47); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(80, 13); this.label3.TabIndex = 3; this.label3.Text = "Insert after row:"; // // numericUpDownRowIndex // this.numericUpDownRowIndex.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.numericUpDownRowIndex.Location = new System.Drawing.Point(135, 45); this.numericUpDownRowIndex.Name = "numericUpDownRowIndex"; this.numericUpDownRowIndex.Size = new System.Drawing.Size(97, 20); this.numericUpDownRowIndex.TabIndex = 4; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(10, 25); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(70, 13); this.label4.TabIndex = 3; this.label4.Text = "Click to insert"; // // frmSample54 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(698, 505); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Controls.Add(this.grid1); this.Name = "frmSample54"; this.Text = "Programatically edit cell"; this.Load += new System.EventHandler(this.frmSample54_Load); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownRowIndex)).EndInit(); this.ResumeLayout(false); }
/// <summary> /// Creates a new GridAccessibleObject /// </summary> /// <param name="owner">Owner</param> public GridAccessibleObject(Grid owner) : base(owner) { grid = owner; }
public CustomersGridController(SourceGrid.Grid grid, FBClient client) { Client = client; Grid = grid; }
public EmployeesGridController(SourceGrid.Grid grid, FBClient client) { Client = client; Grid = grid; }
private void MakeNewTable(string name) { if (tabContainer.InvokeRequired) { MakeTab d = new MakeTab(MakeNewTable); this.Invoke(d, new object[] { name }); } else { Grid formatProvider = null; if (grids.Count == 0) { formatProvider = grid1; } else { formatProvider = (Grid)grids[0]; } var newPage = new TabPage(name); newPage.Name = name; var newGrid = new Grid(); newGrid.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; newGrid.Parent = newPage; newGrid.BackColor = formatProvider.BackColor; newGrid.BorderStyle = formatProvider.BorderStyle; newGrid.Bounds = formatProvider.Bounds; newGrid.ForeColor = formatProvider.ForeColor; newGrid.Location = formatProvider.Location; tabContainer.TabPages.Add(newPage); grids.Add(newGrid); if (grids.Count != tabContainer.TabPages.Count) { tabContainer.TabPages.RemoveAt(0); } } }
public GroupGridController(SourceGrid.Grid grid) : base(grid) { }
public FilteringGridController(SourceGrid.Grid grid) : base(grid) { }
private void UpdateGridFromContractLists(IList<IBSimplefiedContract> contracts, Grid grid) { var i = 1; foreach (var contract in contracts) { SetupMarketDataGridRow(grid, i); grid[i, (int) IBGridColumn.Symbol].Value = contract.Symbol; grid[i, (int) IBGridColumn.SecType].Value = contract.SecurityType; grid[i, (int) IBGridColumn.Expiry].Value = contract.Expiry; grid[i, (int) IBGridColumn.Rollover].Value = contract.Rollover; grid[i, (int) IBGridColumn.Strike].Value = contract.Strike; grid[i, (int) IBGridColumn.PutOrCall].Value = contract.PutOrCall; grid[i, (int) IBGridColumn.Multiplier].Value = contract.Multiplier; grid[i, (int) IBGridColumn.Exchange].Value = contract.Exchange; grid[i, (int) IBGridColumn.Currency].Value = contract.Currency; i++; } SetupMarketDataGridRow(grid, i); grid.AutoSizeCells(); }
private void SetupMarketDataGridRow(Grid grid, int r) { if (grid.Rows.Count <= r) { grid.Rows.Insert(r); } for (var i = 0; i <= (int) LAST_CONTRACT_DETAILS_COLUMN; i++) { Type t = grid[1, (int) i].Tag as Type; grid[r, i] = new SourceGrid.Cells.Cell(null, t) { Tag = t, View = _yellowView }; } for (var i = (int) LAST_CONTRACT_DETAILS_COLUMN + 1; i < (int) IBGridColumn.LAST_COLUMN; i++) { var cell = new SourceGrid.Cells.Cell(0.0); grid[r, i] = cell; var alternate = (r%2 != 0); if (i <= (int) LAST_STATUS_DETAILS_COLUMN) cell.View = alternate ? _lightGreen : _darkGreen; else cell.View = alternate ? _whiteView : _lightGray; } grid.Rows[r].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; }
/// <summary> /// Needs to be called from the instantiator of this Class once it is /// done with using this class to ensure that no memory leak occurs!!! /// </summary> public void FreeStaticObjects() { FGridRowInfo = null; FLocalDataLabelValuesGrid = null; }
public GridColumns(Grid grid) : base(grid) { }
/// <summary> /// todoComment /// </summary> /// <param name="ADataTableValuePartner"></param> /// <param name="ADataTableValueApplication"></param> /// <param name="AOfficeSpecificDataLabelUse"></param> private void InitialiseUserControlInternal(PDataLabelValuePartnerTable ADataTableValuePartner, PDataLabelValueApplicationTable ADataTableValueApplication, TOfficeSpecificDataLabelUseEnum AOfficeSpecificDataLabelUse) { // Set the delegate function in the logic System.Object (so it can call back). // This can not be done in procedure InitializeDelegateGetPartnerShortName because FLogic // does not yet exist then. // Set up Data Sets and Tables InitialiseDataStructures(ADataTableValuePartner, ADataTableValueApplication); // Set up screen logic FOfficeSpecificDataLabelUse = AOfficeSpecificDataLabelUse; FLocalDataLabelValuesGrid = grdLocalDataLabelValues; //PossiblySomethingToSave += new TTellGuiToEnableSaveButton(this.@PossiblySaveSomething); // Set up Grid SetupGridColumnsAndRows(); // Signalize that the initialisation is done FUserControlInitialised = true; }
public void InsertNullCell() { SourceGrid.Grid grid1 = new Grid(); grid1.Redim(2, 2); // this should not throw exception grid1[0, 0] = null; }
public void AreSpannedCells_CorrectlyRemoved() { SourceGrid.Grid grid1 = new Grid(); grid1.Redim(2, 2); grid1[0, 0] = new Cell(); grid1[0, 0].ColumnSpan = 2; grid1[0, 0] = null; // this should be true. But is not, at the moment of writing Assert.AreEqual(null, grid1.GetCell(0, 1)); // this should not throw exception grid1[0, 1] = new Cell("my new cell"); }