Calendar 1.55: final fixes

git-svn-id: svn://kolibrios.org@3895 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2013-09-08 14:17:38 +00:00
parent 00d4cb2df8
commit 24139d702c
2 changed files with 62 additions and 60 deletions

View File

@ -1,6 +1,7 @@
; Calendar for KolibriOS ; Calendar for KolibriOS
; ;
; v1.2 - v1.45 - new desighn and functionality by Leency ; v1.5 - time redesign by Heavyiron
; v1.2 - v1.55 - new desighn and functionality by Leency
; v1.1 - add change time support by DedOK ; v1.1 - add change time support by DedOK
; v1.0 - written in pure assembler by Ivushkin Andrey aka Willow ; v1.0 - written in pure assembler by Ivushkin Andrey aka Willow
; also - diamond, spraid, fedesco ; also - diamond, spraid, fedesco
@ -451,7 +452,7 @@ set_date:
call additem call additem
mov ecx,eax mov ecx,eax
mcall 22,1 mcall 22,1
jmp still jmp START
additem: additem:
add eax,1 add eax,1
@ -463,14 +464,14 @@ additem:
; ********************************************* ; *********************************************
; ******* DRAW WINDOW ******* ; ******* DRAW WINDOW *******
; ********************************************* ; *********************************************
draw_clock: draw_clock:
mcall 3 mcall 3
mov ecx,eax mov ecx,eax
mcall 47,0x00020100, ,198*65536+287,0x50000000,COL_WINDOW_BG mcall 47,0x00020100, ,195*65536+287,0x50000000,COL_WINDOW_BG
shr ecx,8 shr ecx,8
add edx,22*65536 add edx,22*65536
@ -484,54 +485,54 @@ draw_clock:
draw_window: draw_window:
mcall 12,1 mcall 12,1
mcall 0,WIN_X,WIN_Y-15,COL_WINDOW_BG, ,title ; define window mcall 48,5 ;get screen size
mov ecx, ebx
sub ecx, WIN_H
shl ecx, 16
add ecx, WIN_H
mov ebx, eax
sub eax, WIN_W
shl ebx, 16
add ebx, WIN_W
mcall 0,,,COL_WINDOW_BG, ,title ; define window
mcall 63,1,'Y'
GetSkinHeight GetSkinHeight
mov ecx, eax mov ecx, eax
shl ecx, 16 shl ecx, 16
add ecx, 43 add ecx, 43
mcall 13,B_WBAR_X, ,COL_TOOLBAR_BG ; draw toolbar background mcall 13,B_WBAR_X, ,COL_TOOLBAR_BG ; draw toolbar background
call draw_week call draw_week
mcall 8,193*65536+8,272*65536+10,72,COL_DATE_BUTTONS
mcall 8,196*65536+8,272*65536+10,72,COL_DATE_BUTTONS mov ebx,202*65536+8
inc edx ;73
mov ebx,205*65536+8
inc edx
mcall mcall
mov ebx,193*65536+8
mov ebx,196*65536+8
mov ecx,298*65536+10 mov ecx,298*65536+10
inc edx inc edx ;74
mcall mcall
mov ebx,202*65536+8
mov ebx,205*65536+8 inc edx ;75
inc edx
mcall mcall
mov ebx,215*65536+8
mov ebx,218*65536+8
mov ecx,272*65536+10 mov ecx,272*65536+10
inc edx inc edx ;76
mcall mcall
mov ebx,224*65536+8
mov ebx,227*65536+8 inc edx ;77
inc edx
mcall mcall
mov ebx,215*65536+8
mov ebx,218*65536+8
mov ecx,298*65536+10 mov ecx,298*65536+10
inc edx inc edx ;78
mcall mcall
mov ebx,224*65536+8
mov ebx,227*65536+8 inc edx ;79
inc edx
mcall mcall
mov ebx,237*65536+21
mov ebx,240*65536+21
mov ecx,273*65536+35 mov ecx,273*65536+35
inc edx inc edx ;80
or edx,0x40000000 or edx,0x40000000
mcall mcall
mov ebx,25*65536+110
mov ebx,14*65536+110
mov ecx,285*65536+22 mov ecx,285*65536+22
mov esi,COL_DATE_BUTTONS mov esi,COL_DATE_BUTTONS
mov edx,81 mov edx,81
@ -560,13 +561,12 @@ draw_window:
call draw_days call draw_days
; draw text in window ; draw text in window
mcall 4,153*65536+287,0x80000000,sys_text mcall 4,157*65536+287,0x80000000,sys_text
mcall 4,183*65536+287, ,separator mcall ,211*65536+287,,separator
mcall ,214*65536+287 mcall ,233*65536+287
mcall ,236*65536+287 mcall ,185*65536+274, ,plus
mcall ,188*65536+274, ,plus mcall ,185*65536+300, ,minus
mcall ,188*65536+300, ,minus mcall , 35*65536+292,0x00000000,set_date_t,15 ;set date text
mcall , 24*65536+292,0x00000000,set_date_t,15 ;set date text
mov ecx,0x10ddeeff mov ecx,0x10ddeeff
@ -856,12 +856,3 @@ calculate:
ret ret
I_END: I_END:
firstday dd ?
Year dd ?
Month dd ?
day_sel dd ?
datestr dd ?
leap_year dd ?
number dd ?

View File

@ -1,11 +1,21 @@
; program data: colors, text, vars ; program data
DATE_BUTTON_WIDTH equ 32
DATE_BUTTON_HEIGHT equ 30
curMonth dd ? curMonth dd ?
curYear dd ? curYear dd ?
curDay dd ? curDay dd ?
remainder dd ?
quotient dd ?
firstday dd ?
Year dd ?
Month dd ?
day_sel dd ?
datestr dd ?
leap_year dd ?
number dd ?
; colors ; colors
COL_WINDOW_BG equ 0x14E7E7E7 COL_WINDOW_BG equ 0x14E7E7E7
COL_TOOLBAR_BG equ 0x555555 COL_TOOLBAR_BG equ 0x555555
@ -28,20 +38,20 @@ COL_DATE_ACTIVE_2 equ 0xEDA700
COL_DATE_ACTIVE_3 equ 0xFFCC00 COL_DATE_ACTIVE_3 equ 0xFFCC00
COL_DATE_ACTIVE_4 equ 0xFFE56B COL_DATE_ACTIVE_4 equ 0xFFE56B
remainder dd 1
quotient dd 1
; definitions ; definitions
WIN_CW equ 266 WIN_W equ 275
WIN_X equ (5000 shl 16+WIN_CW+9) WIN_H equ 325
WIN_Y equ (100 shl 16+335)
DATE_BUTTON_WIDTH equ 32
DATE_BUTTON_HEIGHT equ 30
LINE1 equ 27 shl 16+16 LINE1 equ 27 shl 16+16
B_MONTH_X equ 15 shl 16+158 B_MONTH_X equ 15 shl 16+158
B_Y equ LINE1 B_Y equ LINE1
B_MONTH equ 63 shl 16+32 B_MONTH equ 63 shl 16+32
B_WBAR_X equ 5 shl 16+WIN_CW B_WBAR_X equ 5 shl 16+WIN_W-9
B_WBAR_Y equ 64 shl 16+20 B_WBAR_Y equ 64 shl 16+20
B_WEEK equ 34 shl 16+70 B_WEEK equ 34 shl 16+70
B_WX_SHIFT equ 32 shl 16 B_WX_SHIFT equ 32 shl 16
@ -313,3 +323,4 @@ else if lang eq it
else else
db ' Set date ',0 db ' Set date ',0
end if end if