work on text widget
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@227 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
parent
7450b17bcf
commit
b230521a1a
7 changed files with 97 additions and 4 deletions
36
src/widget/text.c
Normal file
36
src/widget/text.c
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/* $Id$ */
|
||||
#include <Mw/Milsko.h>
|
||||
|
||||
static int create(MwWidget handle) {
|
||||
MwSetDefault(handle);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void draw(MwWidget handle) {
|
||||
MwRect r;
|
||||
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
|
||||
|
||||
r.x = 0;
|
||||
r.y = 0;
|
||||
r.width = MwGetInteger(handle, MwNwidth);
|
||||
r.height = MwGetInteger(handle, MwNheight);
|
||||
|
||||
MwDrawFrame(handle, &r, base, (handle->pressed || MwGetInteger(handle, MwNchecked)) ? 1 : 0);
|
||||
MwDrawRect(handle, &r, base);
|
||||
|
||||
MwLLFreeColor(base);
|
||||
}
|
||||
|
||||
MwClassRec MwTextClassRec = {
|
||||
create, /* create */
|
||||
NULL, /* destroy */
|
||||
draw, /* draw */
|
||||
NULL, /* click */
|
||||
NULL, /* parent_resize */
|
||||
NULL, /* prop_change */
|
||||
NULL, /* mouse_move */
|
||||
NULL, /* mouse_up */
|
||||
NULL /* mouse_down */
|
||||
};
|
||||
MwClass MwTextClass = &MwTextClassRec;
|
||||
Loading…
Add table
Add a link
Reference in a new issue