1,4 → 1,4 |
#include<menuet/os.h> |
#include <kos32sys.h> |
|
#define B_SZ 10 |
|
6,7 → 6,7 |
|
static void draw_small_box(int x,int y,int is_on) |
{ |
__menuet__bar(x,y,B_SZ,B_SZ,is_on ? 0xFF0000 : 0x103000); |
draw_bar(x,y,B_SZ,B_SZ,is_on ? 0xFF0000 : 0x103000); |
} |
|
static void draw_box_group(int x,int y,int num) |
20,8 → 20,8 |
j=(B_SZ+2)*i; |
draw_small_box(x,y+((B_SZ+2)*i),num & (1<<(3-i)) ? 1 : 0); |
} |
__menuet__bar(x,y+((B_SZ+2)*4),B_SZ,B_SZ,0x800000); |
__menuet__write_text(x+2,y+((B_SZ+2)*4)+3,0xFFFFFF,buf,1); |
draw_bar(x,y+((B_SZ+2)*4),B_SZ,B_SZ,0x800000); |
draw_text_sys(buf,x+2,y+((B_SZ+2)*4)+3,1,0xFFFFFF); |
} |
|
static void draw_bcd_num(int x,int y,int num) |
35,9 → 35,9 |
|
static void draw_hms(int x,int y) |
{ |
__u32 t; |
unsigned t; |
int h,m,s; |
t=__menuet__getsystemclock(); |
__asm__ __volatile__("int $0x40" : "=a"(t) : "a"(3)); |
s=(t & 0x00FF0000)>>16; |
m=(t & 0x0000FF00)>>8; |
h=(t & 0x000000FF); |
55,22 → 55,20 |
|
static void paint(void) |
{ |
__menuet__window_redraw(1); |
__menuet__define_window(100,100,40+((B_SZ+2)*6)+4,30+((B_SZ+2)*4)+16,0x03000080,0x800000FF,0x000080); |
__menuet__write_text(3,3,0xFFFFFF,Title,strlen(Title)); |
__menuet__bar(20,26,((B_SZ+2)*6)+4+2,4+((B_SZ+1)*4)+2,0); |
BeginDraw(); |
DrawWindow(100,100,40+((B_SZ+2)*6)+4,30+((B_SZ+2)*4)+16,Title,0x80,0x13); |
draw_bar(20,26,((B_SZ+2)*6)+4+2,4+((B_SZ+1)*4)+2,0); |
draw_h(); |
__menuet__window_redraw(2); |
EndDraw(); |
} |
|
void main(void) |
int main(void) |
{ |
int i; |
paint(); |
for(;;) |
{ |
__menuet__delay100(20); |
i=__menuet__check_for_event(); |
i=wait_for_event(20); |
draw_h(); |
switch(i) |
{ |
78,10 → 76,10 |
paint(); |
continue; |
case 2: |
__menuet__getkey(); |
get_key(); |
continue; |
case 3: |
if(__menuet__get_button_id()==1) __menuet__sys_exit(); |
if(get_os_button()==1) return 0; |
continue; |
} |
} |