milsko-node/lib/widgets/checkbox.ts

21 lines
535 B
TypeScript
Raw Normal View History

2026-05-04 11:38:58 -07:00
import { NativeClasses } from "../milsko";
import { Widget } from "../widget";
import { WidgetOptions } from "../types";
export class CheckBox extends Widget {
constructor(options: WidgetOptions) {
super(NativeClasses.CheckBox, options);
}
public setChecked(value: boolean): this {
return this.setInteger("Ichecked", +value);
}
get checked(): boolean {
return this.getInteger("Ichecked") != 0;
}
set checked(value: boolean) {
this.setInteger("Ichecked", +value);
}
}