dood wrote: ↑Sun Mar 14, 2021 7:37 am
REG_TRACKER is a 32 bits int but the value is only on 16 higher bits isn't it ? (and tag can be read on the lower 16 bits).
You are right and I even check for the tag.
Sometimes it is a good idea to review code like this, even when it is working alright. :-)
Looks like I need to check the math on that if that really is the fastest way to scale that value down. :-)
I have to use the "PST_Cmd_n_SpeedMechCmd" var to get the slider position updated on screen, that's right ?
I give a try without, that's working (value is updated) but the slider doesn't move anymore on the screen.
Exactly, that is just one global variable.
Did you have or post somewhere small examples of toggle buttons and checkbox ?
Nope, but toggle is just like this:
EVE_cmd_toggle_burst(100, LAYOUT_Y1+50, 80, 27, 0, (somevar == true) ? 65535 : 0, "on" "\xff" "off");
case 0:
toggle_lock = 0;
break;
case 100:
if(toggle_lock == 0)
{
toggle_lock = 42;
if(somevar == true)
{
somevar = false;
}
else
{
somevar = true;
}
}
break;
As there is no checkbox widget you could either change an image based on a variable.
Or with a plainer interface that is using rectangles for buttons the color of that rectangle can be changed based on state.
In one of my interfaces I have a "save" button that is just a rectangle with the text "save" on it.
When the parameters are changed it turns orange. When the parameters do match the stored parameters by either using the save
button or changing the settings back it turns green.
Then I have a "radio-button" with "ID 0", "ID 1", "ID 2"... which allows to edit a serial number.
Also just plain rectangles and the active one is displayed in a brighter shade of blue.