From 829ad51ebfe55dcf10f4687721ba46279ae7059a Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Tue, 5 Jun 2012 11:34:40 +0000 Subject: [PATCH] aclock: redraw optimized, set window title using f0 git-svn-id: svn://kolibrios.org@2741 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/demos/aclock/trunk/aclock.asm | 20 ++++++++------------ programs/demos/aclock/trunk/draw.inc | 2 ++ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/programs/demos/aclock/trunk/aclock.asm b/programs/demos/aclock/trunk/aclock.asm index abaf060edb..09d8709af5 100644 --- a/programs/demos/aclock/trunk/aclock.asm +++ b/programs/demos/aclock/trunk/aclock.asm @@ -86,13 +86,18 @@ main: call drawWindow .msgpump: - call drawClock +; call drawClock ; wait up to a second for next event mov eax,MOS_SC_WAITEVENTTIMEOUT mov ebx,100 int 0x40 + test eax,eax + jne .event_occured + call drawClock + + .event_occured: cmp eax,MOS_EVT_REDRAW je .redraw cmp eax,MOS_EVT_KEY @@ -157,19 +162,10 @@ drawWindow: shl ecx,16 or ecx,[wndHeight] mov edx,[wndColors+MOS_WNDCOLORS.work] - or edx,0x03000000 - mov esi,[wndColors+MOS_WNDCOLORS.grab] - mov edi,[wndColors+MOS_WNDCOLORS.frame] + or edx,0x53000000 + mov edi,label int 0x40 - ; draw window label - mov eax,MOS_SC_WRITETEXT - mov ebx,MOS_DWORD(8,8) - mov ecx,[wndColors+MOS_WNDCOLORS.grabText] - mov edx,label - mov esi,LABEL_LEN - int 0x40 - call drawClock ; end window redraw diff --git a/programs/demos/aclock/trunk/draw.inc b/programs/demos/aclock/trunk/draw.inc index 7ca3005f02..fefd32f028 100644 --- a/programs/demos/aclock/trunk/draw.inc +++ b/programs/demos/aclock/trunk/draw.inc @@ -114,9 +114,11 @@ drawClock: pushad mov ebx,(MOS_WND_SKIN_BORDER_LEFT)*0x10000 ; x start or ebx,ecx ; width + inc ebx mov ecx,eax ; y start shl ecx,16 ; (=skin height) or ecx,edx ; height + inc ecx mov edx,[wndColors + MOS_WNDCOLORS.work] mov eax,MOS_SC_DRAWBAR int 0x40