Beispiel #1
0
        private void btnInsert__Click(object sender, EventArgs e)
        {
            //EnableHipParamButtons(false);
            if (this.dataGridParams_.SelectedRows.Count == 1)
            {
                int       iIndex   = this.dataGridParams_.SelectedRows[0].Index;
                CHHipData hhipdata = new CHHipData();
                if (iIndex == 0 || iIndex == (this.dtParams.Rows.Count - 1))
                {
                    hhipdata.radius = 0;
                }
                else
                {
                    hhipdata.radius = (double)this.dtParams.Rows[iIndex][ColNameRadius];
                }
                FormHipEdit formhipedit = new FormHipEdit(hhipdata, Resources.ST_HIP_INSERT);
                formhipedit.Owner = this;
                if (formhipedit.ShowDialog() == DialogResult.OK)
                {
                    DataRow row = dtParams.NewRow();
                    row[ColNameIndex]      = 0;
                    row[ColNameXValue]     = formhipedit.HipData.xvalue;
                    row[ColNameYValue]     = formhipedit.HipData.yvalue;
                    row[ColNameDeviation]  = formhipedit.HipData.delta;
                    row[ColNameRadius]     = formhipedit.HipData.radius;
                    row[ColNameLeadTrans]  = formhipedit.HipData.leadtrans;
                    row[ColNameTrailTrans] = formhipedit.HipData.trailtrans;

                    this.dtParams.Rows.InsertAt(row, iIndex);

                    this.UpdateIndexValue();
                    this.UpdateDeltaValue();
                }
            }
        }
Beispiel #2
0
        private void btnEdit__Click(object sender, EventArgs e)
        {
            //EnableHipParamButtons(false);
            if (this.dataGridParams_.SelectedRows.Count == 1)
            {
                int         iIndex      = this.dataGridParams_.SelectedRows[0].Index;
                CHHipData   hhipdata    = this.GetRow(iIndex);
                FormHipEdit formhipedit = new FormHipEdit(hhipdata, Resources.ST_HIP_EDIT);
                formhipedit.Owner = this;
                if (formhipedit.ShowDialog() == DialogResult.OK)
                {
                    DataRow row = this.dtParams.Rows[iIndex];

                    row[ColNameXValue]     = formhipedit.HipData.xvalue;
                    row[ColNameYValue]     = formhipedit.HipData.yvalue;
                    row[ColNameDeviation]  = formhipedit.HipData.delta;
                    row[ColNameRadius]     = formhipedit.HipData.radius;
                    row[ColNameLeadTrans]  = formhipedit.HipData.leadtrans;
                    row[ColNameTrailTrans] = formhipedit.HipData.trailtrans;
                    this.UpdateDeltaValue();
                }
            }
        }