/// <summary> /// グリッド上でマウスがクリックされたとき /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override void OnMouseUp(SourceGrid.CellContext sender, MouseEventArgs e) { base.OnMouseUp(sender, e); //フォーカスを当てないとActicvePositionで落ちるので MainProgram.frmMain.griList.Focus(); if (e.Button == MouseButtons.Left) { // 左クリック ColorDialog cd = new ColorDialog(); cd.Color = MainProgram.frmMain.Grid[MainProgram.frmMain.Grid.Selection.ActivePosition.Row, (int)MainProgram.enuGrid.COLOR].View.BackColor; // カラーダイアログ表示 if (cd.ShowDialog() == DialogResult.OK) { // グリッドに壁紙色をセット MainProgram.frmMain.MainFunc.WallpaperColorSetting(true, cd.Color); } } else if (e.Button == MouseButtons.Right) { // グリッドの壁紙色をクリア MainProgram.frmMain.MainFunc.WallpaperColorSetting(false, new Color()); } }
public override void OnMouseUp(SourceGrid.CellContext sender, MouseEventArgs e) { base.OnMouseUp(sender, e); // クリックされたボタンを記憶 MainProgram.frmMain.FlgMouseButton = e.Button; }
public override void OnClick(SourceGrid.CellContext sender, EventArgs e) { base.OnClick(sender, e); ++ix; System.Diagnostics.Debug.WriteLine(sender.Position.Row.ToString()); int iRow = sender.Position.Row - 1; TFrmSetupDailyExchangeRate frmExchangeRate = new TFrmSetupDailyExchangeRate(mainForm); decimal selectedExchangeRate; DateTime selectedEffectiveDate; int selectedEffectiveTime; if (frmExchangeRate.ShowDialog( mainForm.FLedgerNumber, dteStart, dteEnd, currencyExchangeList[iRow].Currency, currencyExchangeList[iRow].ExchangeRate, out selectedExchangeRate, out selectedEffectiveDate, out selectedEffectiveTime) == DialogResult.Cancel) { return; } currencyExchangeList[iRow].updateExchangeRate(selectedExchangeRate); }
private void RowSelector_4(SourceGrid.CellContext context) { SourceGrid.Range r1_1 = new SourceGrid.Range(new SourceGrid.Position(context.Position.Row, 4), new SourceGrid.Position(context.Position.Row, context.Grid.Columns.Count)); SourceGrid.Range r2_2 = new SourceGrid.Range(new SourceGrid.Position(0, 0), new SourceGrid.Position(context.Grid.Rows.Count, context.Grid.Columns.Count)); context.Grid.Selection.SelectRange(r2_2, false); context.Grid.Selection.SelectRange(r1_1, true); }
private void OnEditItem(object sender, EventArgs e) { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; int iSel = context.Position.Row - 1; QualityData q = CardboardQualityAccessor.Instance.CardboardQualities[iSel]; var form = new FormEditCardboardQualityData() { Mode = FormEditCardboardQualityData.EMode.MODE_MODIFY, QualityName = q.Name, Profile = q.Profile, Thickness = q.Thickness, ECT = q.ECT, StiffnessX = q.RigidityDX, StiffnessY = q.RigidityDY }; if (DialogResult.OK == form.ShowDialog()) { CardboardQualityAccessor.Instance.RemoveQuality(iSel); CardboardQualityAccessor.Instance.AddQuality( form.QualityName, form.Profile, form.Thickness, form.ECT, form.StiffnessX, form.StiffnessY); FillGrid(); } }
public override void OnClick(SourceGrid.CellContext sender, EventArgs e) { base.OnClick(sender, e); SourceGrid.DataGrid grid = (SourceGrid.DataGrid)sender.Grid; grid.DeleteSelectedRows(); }
void channelsGrid_MouseDoubleClick(object sender, MouseEventArgs e) { if (!Env.Current.CommunicationPlugins.IsConnected) { return; } int[] rows = channelsGrid.Selection.GetSelectionRegion().GetRowsIndex(); if (rows.Length > 0) { IChannel chan = (IChannel)channelsGrid.Rows[rows[0]].Tag; if (chan != null) { if (!chan.IsReadOnly) { channelsGrid[rows[0], 1] = new SourceGrid.Cells.Cell(chan.Value == null ? "{null}" : chan.Value, chan.Value.GetType()); SourceGrid.CellContext context = new SourceGrid.CellContext(channelsGrid, new SourceGrid.Position(rows[0], 1)); context.StartEdit(); if (channelsGrid[rows[0], 1].FindController(typeof(myController)) == null) { channelsGrid[rows[0], 1].AddController(new myController(this)); } lockedForEditRow = rows[0]; } } } }
private void RaiseActivateOnEvent() { var tmpActivePosition = this.dataGridAccount.Selection.ActivePosition; if (tmpActivePosition.Row > 0 && tmpActivePosition.Column >= 0) { var tmpCurrentColumn = this.dataGridAccount.Columns[tmpActivePosition.Column]; switch (tmpCurrentColumn.PropertyName) { case Account_Column_Name: case Account_Column_Mobile: case Account_Column_Email: case Account_Column_AccountId: case Account_Column_LoginName: this.OpenAccountViewer(); break; case Account_Column_URL: var tempCellContext = new SourceGrid.CellContext(this.dataGridAccount, tmpActivePosition); if (tempCellContext.Value != null) { string url = string.Format("{0}", tempCellContext.Value); if (!string.IsNullOrEmpty(url)) { var tmpBrowserProcess = System.Diagnostics.Process.Start(url); } } break; } } }
public override void OnMouseUp(SourceGrid.CellContext sender, MouseEventArgs e) { base.OnMouseUp(sender, e); int iRow = sender.Position.Row - 1; if (iRow < 0) { return; } TFrmSetupDailyExchangeRate frmExchangeRate = new TFrmSetupDailyExchangeRate(mainForm); decimal selectedExchangeRate; DateTime selectedEffectiveDate; int selectedEffectiveTime; if (frmExchangeRate.ShowDialog( mainForm.FLedgerNumber, dteStart, dteEnd, currencyExchangeList[iRow].Currency, currencyExchangeList[iRow].mExchangeRate, out selectedExchangeRate, out selectedEffectiveDate, out selectedEffectiveTime) != DialogResult.Cancel) { currencyExchangeList[iRow].updateExchangeRate(selectedExchangeRate, selectedEffectiveDate); sender.Grid.InvalidateRange(new SourceGrid.Range(sender.Position.Row, 1, sender.Position.Row, 4)); } }
public override void OnValueChanged(SourceGrid.CellContext sender, EventArgs e) { base.OnValueChanged(sender, e); SHQuest quest = (SHQuest)sender.Grid.Tag; if (quest == null) { return; } int selectedRow = sender.Position.Row; SourceGrid.Grid grid = (sender.Grid as SourceGrid.Grid); SHQuestReward reward = (SHQuestReward)(grid.Rows[selectedRow].Tag); if (sender.Position.Column == 0) { reward.type = (SHQuestRewardType)sender.Value; } else if (sender.Position.Column == 1) { reward.param1 = (string)sender.Value; } else if (sender.Position.Column == 2) { reward.param2 = (string)sender.Value; } m_GridController.RefreshPropertyGrid(selectedRow); Global._VelixianForms.FindForm("QUEST").Touch(); }
private void OnDeleteItem(object sender, EventArgs e) { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; int iSel = context.Position.Row - 1; CardboardQualityAccessor.Instance.RemoveQuality(iSel); FillGrid(); }
public override void OnValueChanged(SourceGrid.CellContext sender, EventArgs e) { base.OnValueChanged(sender, e); string val = "Value of cell {0} is '{1}'"; MessageBox.Show(sender.Grid, string.Format(val, sender.Position, sender.Value)); }
public override void OnValueChanged(SourceGrid.CellContext sender, EventArgs e) { base.OnValueChanged(sender, e); sender.Cell.View.BackColor = GetAdvanceColor((byte)Math.Abs(Convert.ToSByte(sender.Value))); sender.Cell.View.ForeColor = Color.Black; EndEditCallback.Invoke((byte)(sender.Position.Row - 1), (byte)(sender.Position.Column - 1), Convert.ToSByte(sender.Value)); }
public override void OnDoubleClick(SourceGrid.CellContext sender, EventArgs e) { base.OnDoubleClick(sender, e); // 壁紙に設定 if (MainProgram.frmMain.FlgMouseButton == MouseButtons.Left) { MainProgram.frmMain.btnApply_Click(sender, e); } }
public override void OnClick(SourceGrid.CellContext sender, EventArgs e) { base.OnClick(sender, e); sender.Value = !Convert.ToBoolean(sender.Value); if (getCheckBoxValue != null) { getCheckBoxValue(sender.Position, Convert.ToBoolean(sender.Value)); } }
protected override void PrepareView(SourceGrid.CellContext context) { base.PrepareView(context); //if (Math.IEEERemainder(context.Position.Row, 2) == 0) // Background = FirstBackground; //else Background = SecondBackground; }
public override void OnMouseDown(SourceGrid.CellContext sender, MouseEventArgs e) { base.OnMouseDown(sender, e); if (e.Button == MouseButtons.Right) { sender.StartEdit(); } }
private void linkEvents_Executed(object sender, EventArgs e) { SourceGrid.CellContext cellContext = (SourceGrid.CellContext)sender; Type formType = (Type)((SourceGrid.Cells.Cell)cellContext.Cell).Tag; Form form = (Form)Activator.CreateInstance(formType); form.Owner = this; form.Show(); }
// checkbox event handler void clickEvent_Click(object sender, EventArgs e) { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; int iSel = context.Position.Row - 1; _truckAnalysis.SelectedSolutionIndex = iSel; UpdateGridCheckBoxes(); UpdateSelectButtonText(); }
void OnRemoveClicked(object sender, EventArgs e) { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; int curRow = context.CellRange.Start.Row; IChannel ch = channelsGrid.Rows[curRow].Tag as IChannel; channels.Remove(ch); FillChannelsGrid(); }
public override void OnMouseUp(SourceGrid.CellContext sender, MouseEventArgs e) { base.OnMouseUp(sender, e); if (e.Button == MouseButtons.Right) { menu.Show(sender.Grid, new Point(e.X, e.Y)); } }
public override void OnMouseDown(SourceGrid.CellContext sender, MouseEventArgs e) { //sender.Grid.Selection.ResetSelection(false); sender.Grid.Selection.SelectCell(sender.Grid.PositionAtPoint(e.Location), true); sender.Grid.Selection.Focus(sender.Grid.PositionAtPoint(e.Location), true); //sender.Grid.MouseCellPosition) base.OnMouseDown(sender, e); }
public override void OnKeyDown(SourceGrid.CellContext sender, KeyEventArgs e) { base.OnKeyDown(sender, e); if (e.KeyCode == Keys.Delete) { SourceGrid.Grid grid = (SourceGrid.Grid)sender.Grid; grid.Rows.Remove(sender.Position.Row); } }
public override void OnClick(SourceGrid.CellContext sender, EventArgs e) { base.OnClick(sender, e); SourceGrid.Grid grid = (SourceGrid.Grid)sender.Grid; int row = sender.Position.Row; int col = sender.Position.Column; m_Form.lblBraille.Text = grid[row, col].Value.ToString(); }
public override void OnValueChanged(SourceGrid.CellContext sender, EventArgs e) { base.OnValueChanged(sender, e); sender.Cell.View.ForeColor = Color.DarkOrange;//字体变颜色 if (getEditValue != null) { getEditValue(sender.Position);//委托 } }
public override void OnMouseUp(SourceGrid.CellContext sender, MouseEventArgs e) { base.OnMouseUp(sender, e); if (e.Button == MouseButtons.Right) { sender.Grid.Selection.ResetSelection(true); sender.Grid.Selection.SelectRow(sender.CellRange.Start.Row, true); } }
public void ScreenshotsClick(object sender, EventArgs e) { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; int column = context.Position.Column; var screenshotGrid = (SourceGrid.Grid)context.Grid; string file = screenshotGrid[0, column].ToolTipText; var sInfo = new System.Diagnostics.ProcessStartInfo(file); System.Diagnostics.Process.Start(sInfo); }
public override void OnClick(SourceGrid.CellContext sender, EventArgs e) { if (Show == null) { G.DoSort(); } else { G.ShowToTop(Show); } }
public override void OnClick(SourceGrid.CellContext sender, EventArgs e) { if (show is null) { g.DoSort(); } else { g.ShowToTop(show); } }
private void mController_Link_Click(object sender, EventArgs e) { try { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; DevAge.Shell.Utilities.OpenFile(((SourceGrid.Cells.Link)context.Cell).Value.ToString()); } catch (Exception) { } }
public override void OnValueChanged(SourceGrid.CellContext sender, EventArgs e) { base.OnValueChanged(sender, e); //I use the OnValueChanged to link the value of 2 cells // changing the value of the other cell SourceGrid.Position otherCell = new SourceGrid.Position(sender.Position.Row, mDependencyColumn); SourceGrid.CellContext otherContext = new SourceGrid.CellContext(sender.Grid, otherCell); object newVal = sender.Value; if (ConvertFunction != null) newVal = ConvertFunction(newVal); if (!object.Equals(otherContext.Value, newVal)) otherContext.Value = newVal; }
/// <summary> /// Helper function to discover if any control in a specified container wants to handle the Escape key. /// For example, a combo box that is dropped down would want to handle escape so as to close the list. /// </summary> /// <param name="AContainerControl">The container control to recursively search</param> /// <returns>True if any control in the container wants to handle escape</returns> public bool AContainerControlWantsEscape(object AContainerControl) { // Assume that no controls want to handle ESCape bool WantsEscape = false; foreach (Control control in ((Control)AContainerControl).Controls) { // The various ComboBox derivatives want ESCape if the list is Dropped Down if (control is ComboBox) { WantsEscape = ((ComboBox)control).DroppedDown; } else if (control is TUC_CountryComboBox) { WantsEscape = ((TUC_CountryComboBox)control).DroppedDown; } else if (control is TUC_CountryLabelledComboBox) { WantsEscape = ((TUC_CountryLabelledComboBox)control).DroppedDown; } else if (control is TCmbAutoPopulated) { WantsEscape = ((TCmbAutoPopulated)control).cmbCombobox.DroppedDown; } else if (control is TSgrdDataGrid) { // The grid wants ESCape if a cell is being edited TSgrdDataGrid grid = (TSgrdDataGrid)control; SourceGrid.CellContext focusCellContext = new SourceGrid.CellContext(grid, grid.Selection.ActivePosition); SourceGrid.Cells.ICellVirtual contextCell = focusCellContext.Cell; WantsEscape = ((contextCell != null) && (contextCell.Editor != null) && (contextCell.Editor.IsEditing)); } else if (control.Controls.Count > 0) { // Recursive call to ourself for the controls in this container WantsEscape = AContainerControlWantsEscape(control); } if (WantsEscape) { break; } } return WantsEscape; }
public override void OnMouseUp(SourceGrid.CellContext sender, MouseEventArgs e) { base.OnMouseUp(sender, e); if (e.Button == MouseButtons.Right) { this.celContext = sender; menu.Show(sender.Grid, new Point(e.X, e.Y)); } }