@Jul2323 - here's a quick and dirty example - I was too lazy to add text labels but the three radio buttons switch the background to be red, green or blue.
// ==PREPROCESSOR==
// @name "Radio Buttons"
// @author "marc2003"
// @import "%fb2k_component_path%helpers.txt"
// @import "%fb2k_component_path%samples\js\lodash.min.js"
// @import "%fb2k_component_path%samples\js\common.js"
// ==/PREPROCESSOR==
var property_name = "RADIO.BUTTON.COLOUR.INDEX";
var colours = [RGB(255, 0, 0), RGB(0, 255, 0), RGB(0, 0, 255)];
var colour_index = window.GetProperty(property_name, 0);
var white = RGB(255, 255, 255);
var black = RGB(0, 0, 0);
var buttons = new _buttons();
var bs = _scale(24);
var radio_off = '\uF10C';
var radio_on = '\uF111';
buttons.update = function () {
this.buttons.r = new _button(bs, bs, bs, bs, { char : colour_index == 0 ? radio_on : radio_off, colour: white }, null, function () { set(0); }, 'Red');
this.buttons.g = new _button(bs, bs * 2, bs, bs, { char : colour_index == 1 ? radio_on : radio_off, colour: white }, null, function () { set(1); }, 'Green');
this.buttons.b = new _button(bs, bs * 3, bs, bs, { char : colour_index == 2 ? radio_on : radio_off, colour: white }, null, function () { set(2); }, "Blue");
}
function set(index) {
colour_index = index;
window.SetProperty(property_name, colour_index);
buttons.update();
window.Repaint();
}
function on_mouse_lbtn_up(x, y) {
buttons.lbtn_up(x, y);
}
function on_mouse_leave() {
buttons.leave();
}
function on_mouse_move(x, y) {
buttons.move(x, y);
}
function on_paint(gr) {
gr.Clear(colours[colour_index]);
gr.FillRectangle(bs, bs, bs, bs * 3, black);
buttons.paint(gr);
}
function on_size() {
buttons.update();
}