private void Params_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == Value.Index) { var check = Params[e.ColumnIndex, e.RowIndex].EditedFormattedValue; var name = Params[Command.Index, e.RowIndex].Value.ToString(); var availableBitMask = ParameterMetaDataRepository.GetParameterBitMaskInt(name, MainV2.comPort.MAV.cs.firmware.ToString()); if (availableBitMask.Count > 0) { var mcb = new MavlinkCheckBoxBitMask(); var list = new MAVLink.MAVLinkParamList(); list.Add(new MAVLink.MAVLinkParam(name, double.Parse(check.ToString(), CultureInfo.InvariantCulture), MAVLink.MAV_PARAM_TYPE.INT32)); mcb.setup(name, list); mcb.ValueChanged += (o, s, value) => { Params[e.ColumnIndex, e.RowIndex].Value = value; Params.Invalidate(); mcb.Focus(); }; var frm = mcb.ShowUserControl(); frm.TopMost = true; } } }
private void Params_CellClick(object sender, CellClickEventArgs e) { // Only process the Description column if (e.RowIndex == -1 || startup) { return; } if (e.ColumnIndex == olvColumn2.Index) { var it = ((data)e.Model); var check = it.Value; var name = it.paramname; var availableBitMask = ParameterMetaDataRepository.GetParameterBitMaskInt(name, MainV2.comPort.MAV.cs.firmware.ToString()); if (availableBitMask.Count > 0) { var mcb = new MavlinkCheckBoxBitMask(); var list = new MAVLink.MAVLinkParamList(); list.Add(new MAVLink.MAVLinkParam(name, double.Parse(check.ToString(), CultureInfo.InvariantCulture), MAVLink.MAV_PARAM_TYPE.INT32)); mcb.setup(name, list); mcb.ValueChanged += (o, s, value) => { paramCompareForm_dtlvcallback(s, int.Parse(value)); ((data)e.HitTest.RowObject).Value = value; Params.RefreshItem(e.HitTest.Item); e.HitTest.SubItem.Text = value; Params.CancelCellEdit(); e.Handled = true; mcb.Focus(); }; var frm = mcb.ShowUserControl(); frm.TopMost = true; } } try { string descStr = e.SubItem.ModelValue.ToString(); ConfigRawParams.CheckForUrlAndLaunchInBrowser(descStr); } catch { } }
private void Params_CellContentClick(object sender, DataGridViewCellEventArgs e) { // Only process the Description column if (e.RowIndex == -1 || startup) { return; } if (e.ColumnIndex == 4) { try { string descStr = Params[e.ColumnIndex, e.RowIndex].Value.ToString(); CheckForUrlAndLaunchInBrowser(descStr); } catch { } } if (e.ColumnIndex == Value.Index) { var check = Params[e.ColumnIndex, e.RowIndex].EditedFormattedValue; var name = Params[Command.Index, e.RowIndex].Value.ToString(); var availableBitMask = ParameterMetaDataRepository.GetParameterBitMaskInt(name, MainV2.comPort.MAV.cs.firmware.ToString()); if (availableBitMask.Count > 0) { var mcb = new MavlinkCheckBoxBitMask(); var list = new MAVLink.MAVLinkParamList(); list.Add(new MAVLink.MAVLinkParam(name, double.Parse(check.ToString(), CultureInfo.InvariantCulture), MAVLink.MAV_PARAM_TYPE.INT32)); mcb.setup(name, list); mcb.ValueChanged += (o, s, value) => { Params[e.ColumnIndex, e.RowIndex].Value = value; Params.Invalidate(); mcb.Focus(); }; var frm = mcb.ShowUserControl(); frm.TopMost = true; } } if (e.ColumnIndex == 5) { var check = Params[e.ColumnIndex, e.RowIndex].EditedFormattedValue; var name = Params[Command.Index, e.RowIndex].Value.ToString(); if (check != null && (bool)check) { // add entry Settings.Instance.AppendList("fav_params", name); } else { // remove entry var list = Settings.Instance.GetList("fav_params"); Settings.Instance.SetList("fav_params", list.Where(s => s != name)); } Params.Sort(Command, ListSortDirection.Ascending); } }