2025-09-28 13:46:18 +00:00
|
|
|
/* $Id$ */
|
2025-09-29 00:10:20 +00:00
|
|
|
#include <Mw/Milsko.h>
|
2025-09-28 13:46:18 +00:00
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
static void create(MwWidget handle) {
|
|
|
|
|
MwSetDefault(handle);
|
2025-09-28 13:46:18 +00:00
|
|
|
}
|
|
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
static void draw(MwWidget handle) {
|
|
|
|
|
MwRect r;
|
2025-09-28 14:36:24 +00:00
|
|
|
|
|
|
|
|
r.x = 0;
|
|
|
|
|
r.y = 0;
|
2025-09-29 00:04:04 +00:00
|
|
|
r.width = MwGetInteger(handle, MwNwidth);
|
|
|
|
|
r.height = MwGetInteger(handle, MwNheight);
|
2025-09-28 14:36:24 +00:00
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
MwDrawFrame(handle, &r, MwParseColor(handle, MwGetText(handle, MwNbackground)), handle->pressed);
|
2025-09-28 21:15:34 +00:00
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
MwDrawRect(handle, &r, MwParseColor(handle, MwGetText(handle, MwNbackground)));
|
2025-09-28 13:46:18 +00:00
|
|
|
}
|
|
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
static void click(MwWidget handle) {
|
|
|
|
|
MwDispatchUserHandler(handle, MwNactivateHandler, NULL);
|
2025-09-28 22:21:51 +00:00
|
|
|
}
|
|
|
|
|
|
2025-09-29 00:04:04 +00:00
|
|
|
MwClassRec MwButtonClassRec = {
|
2025-09-28 13:46:18 +00:00
|
|
|
NULL, /* opaque */
|
|
|
|
|
create, /* create */
|
|
|
|
|
NULL, /* destroy */
|
|
|
|
|
draw, /* draw */
|
2025-09-28 22:21:51 +00:00
|
|
|
click /* click */
|
2025-09-28 13:46:18 +00:00
|
|
|
};
|
2025-09-29 00:04:04 +00:00
|
|
|
MwClass MwButtonClass = &MwButtonClassRec;
|