forked from KolibriOS/kolibrios
update current date in the midnight
git-svn-id: svn://kolibrios.org@7717 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
751e3e3d06
commit
6fa329e5b4
@ -84,7 +84,7 @@ macro DrawRect color1,color2,color3,color4 ; pizdec... but optimized well
|
||||
add ebx,1 shl 16
|
||||
add ecx,1 shl 16
|
||||
mov bx,DATE_BUTTON_WIDTH-4
|
||||
mov cx,DATE_BUTTON_HEIGHT-4
|
||||
mov cx,DATE_BUTTON_HEIGHT-3
|
||||
mcall
|
||||
; bottom border-inner
|
||||
mov edx,color4
|
||||
@ -140,31 +140,43 @@ str2int:
|
||||
add al,bl
|
||||
ret
|
||||
|
||||
START:
|
||||
get_current_date:
|
||||
mcall 29
|
||||
mov [datestr],eax
|
||||
mov esi,datestr
|
||||
call str2int
|
||||
add eax,1900
|
||||
mov [Year],eax
|
||||
mov [curYear],eax
|
||||
call str2int
|
||||
dec eax
|
||||
mov [Month],eax
|
||||
mov [curMonth],eax
|
||||
call str2int
|
||||
mov [day_sel],eax
|
||||
mov [curDay],eax
|
||||
test byte[esi],0
|
||||
jnz .no2000
|
||||
add [Year],100
|
||||
mov eax,[Year]
|
||||
mov [curYear], eax
|
||||
mov eax,[Month]
|
||||
mov [curMonth], eax
|
||||
mov eax,[day_sel]
|
||||
mov [curDay], eax
|
||||
add [curYear],100
|
||||
.no2000:
|
||||
jmp upd
|
||||
red:
|
||||
call calculate
|
||||
ret
|
||||
|
||||
check_midnight:
|
||||
mov ebx,[datestr]
|
||||
mcall 29
|
||||
cmp eax,ebx
|
||||
je end_check_midnight
|
||||
call get_current_date
|
||||
call draw_days
|
||||
end_check_midnight:
|
||||
ret
|
||||
|
||||
;===============================================================
|
||||
|
||||
START:
|
||||
call get_current_date
|
||||
m2m [Year], [curYear]
|
||||
m2m [Month], [curMonth]
|
||||
m2m [day_sel], [curDay]
|
||||
red:
|
||||
call define_window
|
||||
|
||||
still:
|
||||
@ -179,6 +191,7 @@ still:
|
||||
cmp eax,3
|
||||
je button
|
||||
|
||||
call check_midnight
|
||||
call draw_clock
|
||||
|
||||
jmp still
|
||||
|
Loading…
Reference in New Issue
Block a user