Let’s say I did it in percentage in range 0% to 100% value.
In 0% i would put OFF and in 100% put FULL, in the middle steps 10%.
Would show on top of thumb: OFF, 10%, 20%, 30%, … , 90%, FULL
Here you can create a custom widget, similar to the dark_slider in the video. Set the range to 0…10 and in the event callback you can do something like:
value = value * 10; /*0..10 -> 0..100*/
if(value == 0) text = "OFF";
else if(value == 100) text = "FULL";
else text = to_string(value); /*to_string is just an example function*/
draw_text(text);
I have watched several videos on that GUI… Is fantastic if you wish to hand code items and have an advanced degree in XML. A lot of us coders wish to have a drop and drag and customize the flow / actions…
@kbrussow In my first experience with the Editor I indeed had a learning curve with XML and the overall Editor user experience. But as I tried making more progress with it, trying to make different UI components, the relation between XML and LVGL C properties of widgets started to make more sense to me.
I find the componentization part of it really useful. Imagine there is a company that has many different embedded UI projects and the styling of the UI needs to keep a standard. The XML components come to solve it. Just exchange/handle the same button.xml between projects for example.
I was using EEZ studio to create my screens. worked ok for layout but in that it had to interact with my code, I had to use several work arounds
Example:
in the screens.c file I had to add
lv_obj_set_name(obj, “scan_button_label”);
objects.lblbut_scan = obj;
lv_obj_set_pos(obj, -1, 0);
lv_obj_set_name(obj, “scan_button_label”); << added
by doing that I was able to
lv_label_set_text(objbuttontxt, “scanning…”);
more code was required but there are 2 steps needed