-
Hi Oliver, Your MUICountDown example uses the mui_u8g2_u8_min_max_wm_mud_pi callback for numeric data but this is an INPUT field that enables editing. The same applies to the bar graph. The demo example suggests that the generalized MUIF macro MUIF(id,cflags,data,cb) cflag can mark the field as as editable. So perhaps this could be used to prevent cursor selection of an input field for read only purposes? But I don't understand how I would use that macro. Or perhaps there is another method? I experimented with MUI_LABEL(x,y,text) but it doesn't accept a string pointer. I feel I'm missing something very basic. Can you offer some suggestions? Thanks, John |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hmm good question... Line 217 in 34be7c8 you could create a new MUIF: #define MUIF_READ_ONLY_VARIABLE(id,var,cb) MUIF(id,0,(var),cb) Just place this macro at the beginning of your .ino file (after includes). Not tested, but I assume it should work. |
Beta Was this translation helpful? Give feedback.
-
Of course you can also make a copy of this macro: Lines 243 to 246 in 34be7c8 by using 0 instead of "MUIF_CFLAG_IS_CURSOR_SELECTABLE" It could be then used to display the value as a bar graph like demonstrated here: https://github.com/olikraus/u8g2/wiki/muiref#bar-graph-uint8 |
Beta Was this translation helpful? Give feedback.
Of course you can also make a copy of this macro:
u8g2/csrc/mui_u8g2.h
Lines 243 to 246 in 34be7c8
by using 0 instead of "MUIF_CFLAG_IS_CURSOR_SELECTABLE"
It could be then used to display the value as a bar graph like demonstrated here: https://github.com/olikraus/u8g2/wiki/muiref#bar-graph-uint8