milsko-node/lib/widgets/button.ts

69 lines
1.5 KiB
TypeScript
Raw Normal View History

2026-05-04 11:38:58 -07:00
import { NativeClasses } from "../milsko";
import { Widget } from "../widget";
import { WidgetOptions, Pixmap } from "../types";
export class Button extends Widget {
constructor(options: WidgetOptions) {
super(NativeClasses.Button, options);
}
public setPixmap(value: Pixmap): this {
return this.setVoid("Vpixmap", value);
}
get pixmap(): Pixmap {
return this.getVoid("Vpixmap") as Pixmap;
}
set pixmap(value: Pixmap) {
this.setVoid("Vpixmap", value);
}
public setText(value: string): this {
return this.setString("Stext", value);
}
get text(): string {
return this.getString("Stext");
}
set text(value: string) {
this.setString("Stext", value);
}
public setFlat(value: boolean): this {
return this.setInteger("Iflat", +value);
}
get flat(): boolean {
return this.getInteger("Iflat") != 0;
}
set flat(value: boolean) {
this.setInteger("Iflat", +value);
}
public setPadding(value: number): this {
return this.setInteger("Ipadding", value);
}
get padding(): number {
return this.getInteger("Ipadding");
}
set padding(value: number) {
this.setInteger("Ipadding", value);
}
public setFillArea(value: number): this {
return this.setInteger("IfillArea", value);
}
get fillArea(): number {
return this.getInteger("IfillArea");
}
set fillArea(value: number) {
this.setInteger("IfillArea", value);
}
}