This pull request allows for a more-or-less full support for macro-prompt.
Features dynamic updating depending on what is pushed, button grouping and dynamic resizing (up to a point). The last part is a bit hacked as it would not cooperate with buildin dynamic scaling.
Should be fully c++ (some pointer magic but c++ it's still 1/3 c after all).
Might want to wait a bit with merging while it's being tested but so far it looks good.
Known issue not yet fixed: if a prompt is displayed and a bigger one is slowly arriving (without dismissing) you can see the renderer doing it's magic and shuffeling stuff around. I'm not yet sure what to do with this "feature" (it's not something the web portals take into account anyway). My best guess would be to always hide on prompt_start when a new prompt is being pushed.
Add this macro to test to your printer.cfg:
[gcode_macro TEST_PROMPT]
gcode:
RESPOND TYPE=command MSG="action:prompt_begin Test Prompt"
RESPOND TYPE=command MSG="action:prompt_text This is a test prompt."
RESPOND TYPE=command MSG="action:prompt_footer_button Abort|RESPOND TYPE=command MSG=action:prompt_end|primary"
RESPOND TYPE=command MSG="action:prompt_footer_button OK|RESPOND TYPE=command MSG=action:prompt_end|secondary"
RESPOND TYPE=command MSG="action:prompt_footer_button OK2|RESPOND TYPE=command MSG=action:prompt_end|warning"
RESPOND TYPE=command MSG="action:prompt_footer_button OK?|RESPOND TYPE=command MSG=action:prompt_end|error"
RESPOND TYPE=command MSG="action:prompt_text This is a test prompt with a button group"
RESPOND TYPE=command MSG="action:prompt_button_group_start"
RESPOND TYPE=command MSG="action:prompt_button Abort|RESPOND TYPE=command MSG=action:prompt_end|primary"
RESPOND TYPE=command MSG="action:prompt_button OK|RESPOND TYPE=command MSG=action:prompt_end|secondary"
RESPOND TYPE=command MSG="action:prompt_button OK2|RESPOND TYPE=command MSG=action:prompt_end|warning"
RESPOND TYPE=command MSG="action:prompt_button OK?|RESPOND TYPE=command MSG=action:prompt_end|error"
RESPOND TYPE=command MSG="action:prompt_button_group_end"
RESPOND TYPE=command MSG="action:prompt_button Signel button|RESPOND TYPE=command MSG=action:prompt_end"
RESPOND TYPE=command MSG="action:prompt_text This is a test prompt with another text part deux"
RESPOND TYPE=command MSG="action:prompt_show"
This pull request allows for a more-or-less full support for macro-prompt.
Features dynamic updating depending on what is pushed, button grouping and dynamic resizing (up to a point). The last part is a bit hacked as it would not cooperate with buildin dynamic scaling.
Should be fully c++ (some pointer magic but c++ it's still 1/3 c after all).
Might want to wait a bit with merging while it's being tested but so far it looks good.
Known issue not yet fixed: if a prompt is displayed and a bigger one is slowly arriving (without dismissing) you can see the renderer doing it's magic and shuffeling stuff around. I'm not yet sure what to do with this "feature" (it's not something the web portals take into account anyway). My best guess would be to always hide on prompt_start when a new prompt is being pushed.
Add this macro to test to your printer.cfg:
Should look like this: