Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
style: "toggle",
icon: logo_icon,
label: "Spades",
onlabel: "Numbers",
offlabel: "Alphabets",
weight: { x: -1.0, y: -1.0 },
align: { x: -1.0, y: 0.5 },
on_change: function(arg) {
print("Numbers or Alphabets\n" + elm.datadir);
}
}),
icon_check: elm.Check({
icon: logo_icon_unscaled,
label: "Icon no scale",
}),
label_check: elm.Check({
label: "Label Only"
}),
disabled_check: elm.Check({
icon: logo_icon,
label: "Disabled check",
weight: { x: -1.0, y: -1.0 },
align: { x: -1.0, y: 0.5 },
state: true,
enabled: false
}),
disabled_icon_only: elm.Check({
enabled: false,
icon: logo_icon_unscaled
}),
}
})
resizable_up: false,
resizable_down: false
});
var w = elm.Window({
title: "Check box demo",
elements: {
the_background: elm.Background({
weight: EXPAND_BOTH,
resize: true
}),
the_box: elm.Box({
weight: EXPAND_BOTH,
resize: true,
elements: {
icon_sized_check: elm.Check({
icon: logo_icon,
label: "Icon sized to check",
weight: { x: -1.0, y: -1.0 },
align: { x: -1.0, y: 0.5 },
state: true
}),
toggle1: elm.Check({
style: "toggle",
icon: logo_icon,
label: "Spades",
onlabel: "Numbers",
offlabel: "Alphabets",
weight: { x: -1.0, y: -1.0 },
align: { x: -1.0, y: 0.5 },
on_change: function(arg) {
print("Numbers or Alphabets\n" + elm.datadir);
icon_check: elm.Check({
icon: logo_icon_unscaled,
label: "Icon no scale",
}),
label_check: elm.Check({
label: "Label Only"
}),
disabled_check: elm.Check({
icon: logo_icon,
label: "Disabled check",
weight: { x: -1.0, y: -1.0 },
align: { x: -1.0, y: 0.5 },
state: true,
enabled: false
}),
disabled_icon_only: elm.Check({
enabled: false,
icon: logo_icon_unscaled
}),
}
})
}
});
var e = elm.realise(w);
push_orange: elm.Button({
label: "Orange",
weight: EXPAND_BOTH,
on_click: button_push,
}),
push_violet: elm.Button({
label: "Yellow",
weight: EXPAND_BOTH,
on_click: button_push,
}),
push_green: elm.Button({
label: "Green",
weight: EXPAND_BOTH,
on_click: button_push,
}),
check: elm.Check({
label: "Show title",
weight: EXPAND_BOTH,
state: true,
on_change: function() {
win.elements.box.elements.naviframe.title_visible = this.state;
}
})
}
})
}
})
}
}));
the_background: elm.Background({
weight: EXPAND_BOTH,
resize: true
}),
the_box: elm.Box({
weight: EXPAND_BOTH,
resize: true,
elements: {
icon_sized_check: elm.Check({
icon: logo_icon,
label: "Icon sized to check",
weight: { x: -1.0, y: -1.0 },
align: { x: -1.0, y: 0.5 },
state: true
}),
toggle1: elm.Check({
style: "toggle",
icon: logo_icon,
label: "Spades",
onlabel: "Numbers",
offlabel: "Alphabets",
weight: { x: -1.0, y: -1.0 },
align: { x: -1.0, y: 0.5 },
on_change: function(arg) {
print("Numbers or Alphabets\n" + elm.datadir);
}
}),
icon_check: elm.Check({
icon: logo_icon_unscaled,
label: "Icon no scale",
}),
label_check: elm.Check({
align: { x: -1.0, y: 0.5 },
state: true
}),
toggle1: elm.Check({
style: "toggle",
icon: logo_icon,
label: "Spades",
onlabel: "Numbers",
offlabel: "Alphabets",
weight: { x: -1.0, y: -1.0 },
align: { x: -1.0, y: 0.5 },
on_change: function(arg) {
print("Numbers or Alphabets\n" + elm.datadir);
}
}),
icon_check: elm.Check({
icon: logo_icon_unscaled,
label: "Icon no scale",
}),
label_check: elm.Check({
label: "Label Only"
}),
disabled_check: elm.Check({
icon: logo_icon,
label: "Disabled check",
weight: { x: -1.0, y: -1.0 },
align: { x: -1.0, y: 0.5 },
state: true,
enabled: false
}),
disabled_icon_only: elm.Check({
enabled: false,
onlabel: "Numbers",
offlabel: "Alphabets",
weight: { x: -1.0, y: -1.0 },
align: { x: -1.0, y: 0.5 },
on_change: function(arg) {
print("Numbers or Alphabets\n" + elm.datadir);
}
}),
icon_check: elm.Check({
icon: logo_icon_unscaled,
label: "Icon no scale",
}),
label_check: elm.Check({
label: "Label Only"
}),
disabled_check: elm.Check({
icon: logo_icon,
label: "Disabled check",
weight: { x: -1.0, y: -1.0 },
align: { x: -1.0, y: 0.5 },
state: true,
enabled: false
}),
disabled_icon_only: elm.Check({
enabled: false,
icon: logo_icon_unscaled
}),
}
})
}
});