Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2022-09-27 19:48:38 +0300
committerDavid Crocker <dcrocker@eschertech.com>2022-09-27 19:48:38 +0300
commit6c202c81d24149e601a2d7a5be49056e0645e0ba (patch)
tree46b49933e07ce595efc8503458a65792ebd14807
parent7673fe330cc2cbaf15273d4af16c5c2dacf9637f (diff)
Added field cancelButton to MessageBox object model
-rw-r--r--src/GCodes/GCodes7.cpp5
-rw-r--r--src/Platform/MessageBox.cpp3
-rw-r--r--src/Platform/MessageBox.h1
3 files changed, 5 insertions, 4 deletions
diff --git a/src/GCodes/GCodes7.cpp b/src/GCodes/GCodes7.cpp
index dc0f81e3..f8c7db2b 100644
--- a/src/GCodes/GCodes7.cpp
+++ b/src/GCodes/GCodes7.cpp
@@ -31,11 +31,10 @@ GCodeResult GCodes::DoMessageBox(GCodeBuffer&gb, const StringRef& reply) THROWS(
float tParam = (sParam <= 1) ? DefaultMessageTimeout : 0.0;
gb.TryGetNonNegativeFValue('T', tParam, dummy);
- bool displayCancelButton = false;
- gb.TryGetBValue('J', displayCancelButton, dummy);
+ MessageBoxLimits limits;
+ gb.TryGetBValue('J', limits.canCancel, dummy);
AxesBitmap axisControls;
- MessageBoxLimits limits;
switch (sParam)
{
diff --git a/src/Platform/MessageBox.cpp b/src/Platform/MessageBox.cpp
index 10c4f7fe..1bbdecc0 100644
--- a/src/Platform/MessageBox.cpp
+++ b/src/Platform/MessageBox.cpp
@@ -16,6 +16,7 @@
constexpr ObjectModelTableEntry MessageBox::objectModelTable[] =
{
{ "axisControls", OBJECT_MODEL_FUNC_IF(self->mode == 2 || self->mode == 3, (int32_t)self->controls.GetRaw()), ObjectModelEntryFlags::important },
+ { "cancelButton", OBJECT_MODEL_FUNC_IF(self->mode >= 4, self->limits.canCancel), ObjectModelEntryFlags::important },
{ "choices", OBJECT_MODEL_FUNC_IF(self->mode == 4, self->limits.choices), ObjectModelEntryFlags::important },
{ "default", OBJECT_MODEL_FUNC_IF(self->mode >= 4, self->limits.defaultVal), ObjectModelEntryFlags::important },
{ "max", OBJECT_MODEL_FUNC_IF(self->mode >= 5, self->limits.maxVal), ObjectModelEntryFlags::important },
@@ -30,7 +31,7 @@ constexpr ObjectModelTableEntry MessageBox::objectModelTable[] =
constexpr uint8_t MessageBox::objectModelTableDescriptor[] =
{
1,
- 10
+ 11
};
DEFINE_GET_OBJECT_MODEL_TABLE(MessageBox)
diff --git a/src/Platform/MessageBox.h b/src/Platform/MessageBox.h
index 328904f7..610639f2 100644
--- a/src/Platform/MessageBox.h
+++ b/src/Platform/MessageBox.h
@@ -20,6 +20,7 @@ struct MessageBoxLimits
void GetFloatLimits(GCodeBuffer& gb) THROWS(GCodeException);
ExpressionValue minVal, maxVal, defaultVal, choices;
+ bool canCancel = false;
};
// Message box data