From 959cf5ba7559c001f066a1417212577bb0a62c6a Mon Sep 17 00:00:00 2001 From: Tom Sutcliffe Date: Fri, 13 Aug 2021 13:10:21 +0100 Subject: [PATCH] Fix MmToString calls that should have editable=true set --- src/confscreen.cpp | 12 ++++++------ src/style.cpp | 2 +- src/textscreens.cpp | 4 ++-- src/view.cpp | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/confscreen.cpp b/src/confscreen.cpp index 4a4b7b23..9c4610b3 100644 --- a/src/confscreen.cpp +++ b/src/confscreen.cpp @@ -64,7 +64,7 @@ void TextWindow::ScreenChangeCameraTangent(int link, uint32_t v) { } void TextWindow::ScreenChangeGridSpacing(int link, uint32_t v) { - SS.TW.ShowEditControl(3, SS.MmToString(SS.gridSpacing)); + SS.TW.ShowEditControl(3, SS.MmToString(SS.gridSpacing, true)); SS.TW.edit.meaning = Edit::GRID_SPACING; } @@ -89,7 +89,7 @@ void TextWindow::ScreenChangeExportScale(int link, uint32_t v) { } void TextWindow::ScreenChangeExportOffset(int link, uint32_t v) { - SS.TW.ShowEditControl(3, SS.MmToString(SS.exportOffset)); + SS.TW.ShowEditControl(3, SS.MmToString(SS.exportOffset, true)); SS.TW.edit.meaning = Edit::EXPORT_OFFSET; } @@ -171,7 +171,7 @@ void TextWindow::ScreenChangeCanvasSize(int link, uint32_t v) { } int col = 13; if(v < 10) col = 11; - SS.TW.ShowEditControl(col, SS.MmToString(d)); + SS.TW.ShowEditControl(col, SS.MmToString(d, true)); SS.TW.edit.meaning = Edit::CANVAS_SIZE; SS.TW.edit.i = v; } @@ -181,7 +181,7 @@ void TextWindow::ScreenChangeGCodeParameter(int link, uint32_t v) { switch(link) { case 'd': SS.TW.edit.meaning = Edit::G_CODE_DEPTH; - buf += SS.MmToString(SS.gCode.depth); + buf += SS.MmToString(SS.gCode.depth, true); break; case 's': @@ -191,12 +191,12 @@ void TextWindow::ScreenChangeGCodeParameter(int link, uint32_t v) { case 'F': SS.TW.edit.meaning = Edit::G_CODE_FEED; - buf += SS.MmToString(SS.gCode.feed); + buf += SS.MmToString(SS.gCode.feed, true); break; case 'P': SS.TW.edit.meaning = Edit::G_CODE_PLUNGE_FEED; - buf += SS.MmToString(SS.gCode.plungeFeed); + buf += SS.MmToString(SS.gCode.plungeFeed, true); break; } SS.TW.ShowEditControl(14, buf); diff --git a/src/style.cpp b/src/style.cpp index 6ca61e56..4349eb36 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -563,7 +563,7 @@ void TextWindow::ScreenChangeStyleMetric(int link, uint32_t v) { if(units == Style::UnitsAs::PIXELS) { edit_value = ssprintf("%.2f", val); } else { - edit_value = SS.MmToString(val); + edit_value = SS.MmToString(val, true); } SS.TW.ShowEditControl(col, edit_value); SS.TW.edit.style = hs; diff --git a/src/textscreens.cpp b/src/textscreens.cpp index ee6d90ea..3474b519 100644 --- a/src/textscreens.cpp +++ b/src/textscreens.cpp @@ -640,7 +640,7 @@ void TextWindow::ScreenStepDimFinish(int link, uint32_t v) { SS.TW.edit.meaning = Edit::STEP_DIM_FINISH; std::string edit_value; if(SS.TW.stepDim.isDistance) { - edit_value = SS.MmToString(SS.TW.stepDim.finish); + edit_value = SS.MmToString(SS.TW.stepDim.finish, true); } else { edit_value = ssprintf("%.3f", SS.TW.stepDim.finish); } @@ -727,7 +727,7 @@ void TextWindow::ScreenChangeTangentArc(int link, uint32_t v) { switch(link) { case 'r': { SS.TW.edit.meaning = Edit::TANGENT_ARC_RADIUS; - SS.TW.ShowEditControl(3, SS.MmToString(SS.tangentArcRadius)); + SS.TW.ShowEditControl(3, SS.MmToString(SS.tangentArcRadius, true)); break; } diff --git a/src/view.cpp b/src/view.cpp index 14d09ba3..9c85ce6b 100644 --- a/src/view.cpp +++ b/src/view.cpp @@ -51,9 +51,9 @@ void TextWindow::ScreenChangeViewToFullScale(int link, uint32_t v) { void TextWindow::ScreenChangeViewOrigin(int link, uint32_t v) { std::string edit_value = ssprintf("%s, %s, %s", - SS.MmToString(-SS.GW.offset.x).c_str(), - SS.MmToString(-SS.GW.offset.y).c_str(), - SS.MmToString(-SS.GW.offset.z).c_str()); + SS.MmToString(-SS.GW.offset.x, true).c_str(), + SS.MmToString(-SS.GW.offset.y, true).c_str(), + SS.MmToString(-SS.GW.offset.z, true).c_str()); SS.TW.edit.meaning = Edit::VIEW_ORIGIN; SS.TW.ShowEditControl(3, edit_value);