Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Jul 6, 2024
1 parent 75a40ea commit 763f912
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
21 changes: 10 additions & 11 deletions LoxStatFileForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ private void DataGridView_MouseClick(object sender, DataGridViewCellMouseEventAr
if (e.Button == MouseButtons.Right)
{
ContextMenu m = new ContextMenu();
m.MenuItems.Add(new MenuItem("delete selected entries", mnuDeleteSelected_Click));
m.MenuItems.Add(new MenuItem("insert entry", mnuInsertEntry_Click));
m.MenuItems.Add(new MenuItem("fill entries", mnuFillEntries_Click));
m.MenuItems.Add(new MenuItem("Calc from row", mnuCalcfrom_Click));
m.MenuItems.Add(new MenuItem("Calc selected", mnuCalcSelected_Click));
m.MenuItems.Add(new MenuItem("Delete selected entries", mnuDeleteSelected_Click));
m.MenuItems.Add(new MenuItem("Insert entry", mnuInsertEntry_Click));
m.MenuItems.Add(new MenuItem("Fill entries", mnuFillEntries_Click));
m.MenuItems.Add(new MenuItem("Calculate from row", mnuCalcfrom_Click));
m.MenuItems.Add(new MenuItem("Calculate selected", mnuCalcSelected_Click));
//m.MenuItems[0].Enabled = false;
//m.MenuItems[1].Enabled = false;

Expand Down Expand Up @@ -186,8 +186,8 @@ private void mnuCalcfrom_Click(object sender, EventArgs e)
{
string chrDec = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
string chrGrp = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator;
string input = "V - 100";
string pattern = "V";
string input = "v - 100";
string pattern = "v";
string replacement = "1";
double myValue;
string formula = "";
Expand Down Expand Up @@ -316,7 +316,7 @@ private void mnuInsertEntry_Click(object sender, EventArgs e)
_loxStatFile.DataPoints.Insert(atInsert.Index - 1, newDP);
} else
{
MessageBox.Show("There is not place to insert an entry! You should delete an entry first?!", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("There is not place to insert an entry! Please check again, if there is a missing entry.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}

}
Expand Down Expand Up @@ -370,8 +370,8 @@ private static DialogResult ShowInputDialog(ref string input)
Label lblInfo = new Label();
lblInfo.Size = new Size(size.Width - 30, 60);
lblInfo.Location = new Point(15, 37);
lblInfo.Text = "type in a math formula including +,-,*,/. " +
"Use V for the original value." +
lblInfo.Text = "Insert a formula for calculating the values. Allowed operators: + - / * ( )\n" +
"Use v for the original value.\n" +
"Like: v - 100";
inputBox.Controls.Add(lblInfo);

Expand Down Expand Up @@ -459,7 +459,6 @@ private void _dataGridView_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.V)
{

string CopiedContent = Clipboard.GetText();
string[] Lines = CopiedContent.Split('\n');
int StartingRow = _dataGridView.CurrentCell.RowIndex;
Expand Down
6 changes: 6 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Open tasks

- Check, that for a calculation only one row can be selected, e.g. if there are two rows with values (battery)
- Check, that if you cancel the calculation, that it is really canceled
- Calc from row: Only works if you select at least two cells. Then it calculates all values including the last cell. This should only work if you have selected one cell?
- Calc selected: Calculates all selected cells using the formula entered. Whereby the formula differs from the formula in the other calculation. If you enter V - 100 here, it will not work. If you only enter - 100 it works

0 comments on commit 763f912

Please sign in to comment.