Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 3889 → Rev 3888

/programs/system/calendar/trunk/calendar.asm
1,6 → 1,6
; Calendar for KolibriOS
;
; v1.3 - code update, redesign by Leency
; v1.2 - code update by Leency, small design fixes
; v1.1 - add change time support by DedOK
; v1.0 - written in pure assembler by Ivushkin Andrey aka Willow
; also - diamond, spraid, fedesco
7,7 → 7,46
;
; Created: November 1, 2004
 
WIN_CW equ 266
WIN_X equ (5000 shl 16+WIN_CW+9)
WIN_Y equ (100 shl 16+335)
 
LINE1 equ 27 shl 16+16
B_MONTH_X equ 5 shl 16+158+11
B_Y equ LINE1
B_MONTH equ 63 shl 16+32
 
B_WBAR_X equ 5 shl 16+WIN_CW
B_WBAR_Y equ 64 shl 16+20
B_WEEK equ 30 shl 16+70
B_WX_SHIFT equ 32 shl 16
 
B_DBAR_X equ B_WBAR_X
B_DBAR_Y equ 85 shl 16+190
 
B_DROP equ B_MONTH+16
B_DAYS_Y equ 100
B_DAYS_SHIFT equ 30
 
B_YEAR_X equ 173 shl 16+58
B_YEAR equ 188 shl 16+32
 
B_TODAY_X equ 25 shl 16
B_TODAY_Y equ 48 shl 16+10
B_TODAY equ 30 shl 16+50
 
B_SPIN_WIDTH equ 13
B_SPIN_X equ 234 shl 16+B_SPIN_WIDTH
B_SPIN equ 238 shl 16+32
 
B_NS_X equ 185 shl 16+75
B_NS_Y equ 48 shl 16+10
B_NS equ 190 shl 16+50
 
FOCUSABLE equ 5
 
 
 
use32 ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à 
 
org 0x0 ;  ¤à¥á æ¨ï á ­ã«ï
39,19 → 78,13
jmp .exit
.nofocus:
if reg eq
mov ecx,COL_DROPDOWN_T
mov ecx,0x10000000
else
mov reg,COL_DROPDOWN_T
mov reg,0x10000000
end if
.exit:
}
 
macro GetSkinHeight
{
mov eax,48
mov ebx,4
int 0x40
}
 
 
str2int:
87,7 → 120,9
 
still: ; ƒ‹€‚›‰ –ˆŠ‹ Žƒ€ŒŒ›
 
mcall 23,50 ; wait here for event
mov eax,23 ; wait here for event
mov ebx,50
mcall
.evt:
mov ebp,[focus]
cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª­® ?
101,8 → 136,9
 
jmp still ; ¥á«¨ ¤à㣮¥ ᮡë⨥ - ¢ ­ ç «® 横« 
 
key:
mcall 2 ; get pressed key
key: ; ­ ¦ â  ª« ¢¨è  ­  ª« ¢¨ âãà¥
mov eax,2 ; äã­ªæ¨ï 2 - áç¨â âì ª®¤ ᨬ¢®« 
mcall ; ¢ë§®¢ á¨á⥬ë
cmp ah,9
jne no_tab
.tab:
169,8 → 205,9
 
day_bounds db -1,0,7,0,-7,0,1,0 ; left,down,up,right
 
button:
mcall 17 ; 17 - ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
button: ; ­ ¦ â  ª­®¯ª  ¢ ®ª­¥ ¯à®£à ¬¬ë
mov eax,17 ; 17 - ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
mcall ; ¢ë§®¢ á¨á⥬ë
movzx ebx,ah
cmp ah,200
jbe nodayselect
323,22 → 360,33
jmp still
 
plus_hd:
mcall 3
 
mov eax,3
mcall
mov ecx,eax
add ecx,1
mov eax,22
mcall 22,0x00000000
mov ebx,0x00000000
mcall
 
jmp still
 
plus_he:
mcall 3
 
mov eax,3
mcall
mov ecx,eax
add ecx,16
mcall 22,0x00000000
mov eax,22
mov ebx,0x00000000
mcall
 
jmp still
 
minus_hd:
mcall 3
 
mov eax,3
mcall
mov ecx,eax
sub ecx,1
mov eax,22
446,13 → 494,13
 
draw_window:
 
mcall 12,1
mcall 0,WIN_X,WIN_Y-15,COL_WINDOW_BG, ,title ; define window
GetSkinHeight
mov ecx, eax
shl ecx, 16
add ecx, 43
mcall 13,B_WBAR_X, ,COL_TOOLBAR_BG ; draw toolbar background
mcall 12,1 ; äã­ªæ¨ï 12: á®®¡é¨âì Ž‘ ®¡ ®âà¨á®¢ª¥ ®ª­ 
xor eax,eax ; äã­ªæ¨ï 0 : ®¯à¥¤¥«¨âì ¨ ®âà¨á®¢ âì ®ª­®
mov ebx,WIN_X
mov ecx,WIN_Y-15
mov edx,COL_WINDOW_BG ; 梥â à ¡®ç¥© ®¡« á⨠RRGGBB,8->color gl
mov edi,title ; § £®«®¢®ª
mcall
call draw_week
 
mcall 8,205*65536+7,290*65536+10,72,COL_TIME_BUTTONS
470,25 → 518,25
inc edx
mcall
 
mov ebx,225*65536+7
mov ebx,224*65536+7
mov ecx,290*65536+10
inc edx
mcall
 
mov ebx,232*65536+7
mov ebx,231*65536+7
inc edx
mcall
 
mov ebx,225*65536+7
mov ebx,224*65536+7
mov ecx,300*65536+10
inc edx
mcall
 
mov ebx,232*65536+7
mov ebx,231*65536+7
inc edx
mcall
 
mov ebx,244*65536+14
mov ebx,243*65536+14
mov ecx,290*65536+20
inc edx
mcall
495,11 → 543,11
 
mov ebx,14*65536+110
mov ecx,285*65536+22
mov esi,COL_DATE_BUTTONS
mov esi,0x00d5d5d5
inc edx
mcall
 
mov esi,COL_MONTH_YEAR_B ; new style
mov esi,COL_MONTH_YEAR_B
mov edx,10
or edx,1 shl 29+1 shl 30
mov ebx,B_NS_X
513,10 → 561,10
mov ebx,B_MONTH_X
mov edx,2
mcall
mov ebx,B_SPIN_X ; <
mov ebx,B_SPIN_X
inc edx
mcall
add ebx,61 shl 16 ; >
add ebx,B_SPIN_WIDTH shl 16
inc edx
mcall
call draw_days
549,7 → 597,7
 
mov ebx,B_SPIN
mov edx,spinner
mov esi,12
mov esi,3
ShowFocus 4
mcall
 
564,7 → 612,7
call draw_year
mov [dropped],0
mcall 12,2
ret
ret ; ¢ë室¨¬ ¨§ ¯à®æ¥¤ãàë
 
draw_year:
mcall 8,B_YEAR_X,B_Y,5,COL_MONTH_YEAR_B
585,8 → 633,11
.ddd_loop:
mov edi,edx
push ecx
mov esi,COL_DROPDOWN_BG
mcall 8,B_MONTH_X,[esp+4]
mov ebx,B_MONTH_X
mov ecx,[esp+4]
mov esi,0x6f9fef
mov eax,8
mcall
shr eax,1
mov ebx,[esp+8]
xchg edx,[esp+12]
632,6 → 683,11
ret
 
draw_days:
mov eax,13
mov ebx,B_DBAR_X
mov ecx,B_DBAR_Y
mov edx,COL_DATES_BG
mcall
call count_days
cmp ecx,[day_sel]
jae .ok
640,7 → 696,7
mov [number],0
mov eax,47
mov edx,B_DAYS_Y
mov ebx,0x10001
mov ebx,0x20001
mov edi,[firstday]
.dayloop:
push ecx
647,12 → 703,12
movzx edx,dx
mov esi,edi
shl esi,21
lea edx,[edx+esi+34 shl 16]
lea edx,[edx+esi+29 shl 16]
mov ecx,edi
add cl,[week_days+1]
cmp ecx,7
je .holiday
mov esi,0x10000000 ; COL_DATE_TEXT
mov esi,0x10000000
jmp .noholiday
.holiday:
mov esi,0x10cc1010
678,31 → 734,13
mov esi,COL_DATE_CHANGED
.draw_but:
add edx,200+1 shl 29
mcall 8
mov eax, [number]
xor edx, edx
mov ecx, 10
div ecx
mov [remainder], edx
mov [quotient], eax
mov eax,8
mcall
popa
;first number
mov ecx,quotient
mcall
add edx,1 shl 16
mcall
sub edx,1 shl 16
;second number
mov ecx,remainder
add edx,9 shl 16
mcall
add edx,1 shl 16
mcall
sub edx,10 shl 16
pop ecx
inc edi
cmp edi,7
792,8 → 830,7
mov [firstday],edx
ret
 
I_END:
 
I_END: ; ª®­¥æ ¯à®£à ¬¬ë
firstday dd ?
Year dd ?
Month dd ?
/programs/system/calendar/trunk/data.inc
1,60 → 1,18
; program data: colors, text, vars (todo)
 
; colors
COL_WINDOW_BG equ 0x14E7E7E7
COL_TOOLBAR_BG equ 0x555555
COL_WINDOW_BG equ 0x14aabbcc
COL_WEEKDAY_BG equ 0xCCCDDD
COL_DATE_BUTTONS equ 0xF3F3F3
COL_DATES_BG equ 0xE7E7E7
COL_DATE_BUTTONS equ 0xE7E7E7
COL_DATE_CURRENT equ 0x31A4D0
COL_DATE_CHANGED equ 0xef7840
COL_TIME_BUTTONS equ 0x5555dd
COL_GO_TODAY_T equ 0xd048c8
COL_MONTH_YEAR_B equ 0x0555555 ; 0 for time?
COL_DROPDOWN_BG equ 0x666666
COL_DROPDOWN_T equ 0x10CCCccc
COL_MONTH_YEAR_B equ 0x05080d0
 
COL_NEW_STYLE_T equ 0xef3333
COL_NEW_STYLE_T equ 0xac0000
 
remainder dd 1
quotient dd 1
 
; definitions
WIN_CW equ 266
WIN_X equ (5000 shl 16+WIN_CW+9)
WIN_Y equ (100 shl 16+335)
 
LINE1 equ 27 shl 16+16
B_MONTH_X equ 15 shl 16+158
B_Y equ LINE1
B_MONTH equ 63 shl 16+32
 
B_WBAR_X equ 5 shl 16+WIN_CW
B_WBAR_Y equ 64 shl 16+20
B_WEEK equ 34 shl 16+70
B_WX_SHIFT equ 32 shl 16
 
B_DROP equ B_MONTH+16
B_DAYS_Y equ 106
B_DAYS_SHIFT equ 30
 
B_YEAR_X equ 198 shl 16+46
B_YEAR equ 206 shl 16+32
 
B_SPIN_WIDTH equ 13
B_SPIN_X equ 184 shl 16+B_SPIN_WIDTH
B_SPIN equ 188 shl 16+32
spinner db '< >'
 
B_TODAY_X equ 25 shl 16
B_TODAY_Y equ 48 shl 16+10
B_TODAY equ 30 shl 16+50
 
B_NS_X equ 185 shl 16+75
B_NS_Y equ 48 shl 16+10
B_NS equ 190 shl 16+50
 
FOCUSABLE equ 5
 
; multilanguage interface - configuratable in lang.inc
day_count db 3,0,3,2,3,2,3,3,2,3,2,3
Fkeys db 210,211,212,213,214,215,216,217,208,209,228,159
159,6 → 117,7
db 'November '
db 'December '
end if
spinner db '< >'
week_days:
if lang eq ru
db 2
232,7 → 191,7
db 'Sat'
end if
 
title:
title: ; áâப  § £®«®¢ª 
if lang eq ru
db 'Š «¥­¤ àì',0
else if lang eq ge
297,5 → 256,5
else if lang eq it
db ' Impostazioni ',0
else
db ' Set date ',0
db '“áâ ­®¢¨âì ¤ âã',0
end if
/programs/system/calendar/trunk/scr
Property changes:
Added: tsvn:logminsize
+5
\ No newline at end of property