Calendar: text fix

git-svn-id: svn://kolibrios.org@5880 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pathoswithin 2015-11-04 23:27:35 +00:00
parent 47a9023a5f
commit 4caeaae3c6
2 changed files with 54 additions and 71 deletions

View File

@ -176,7 +176,7 @@ still:
jne no_tab jne no_tab
.tab: .tab:
cmp ebp,FOCUSABLE cmp ebp,FOCUSABLE
JAE foc_cycle JAE foc_cycle
inc [focus] inc [focus]
upd: upd:
call calculate call calculate
@ -464,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, ,195*65536+301,0x50CCCCCC,COL_TOOLBAR_BG mcall 47,0x00020100, ,195*65536+298,0x50CCCCCC,COL_TOOLBAR_BG
shr ecx,8 shr ecx,8
add edx,22*65536 add edx,22*65536
@ -485,7 +485,7 @@ draw_clock:
define_window: define_window:
mcall 12,1 mcall 12,1
mcall 48, 5 ; GetClientTop, fix for case when @patel in the top mcall 48, 5 ; GetClientTop, fix for case when @patel in the top
shr ebx, 16 shr ebx, 16
mov ecx,ebx mov ecx,ebx
shl ecx,16 shl ecx,16
@ -497,7 +497,7 @@ define_window:
sub ecx, WIN_H sub ecx, WIN_H
shl ecx, 16 shl ecx, 16
panel_top: panel_top:
add ecx, WIN_H ; [y start] *65536 + [y size] add ecx, WIN_H ; [y start] *65536 + [y size]
mov ebx, eax mov ebx, eax
sub eax, WIN_W sub eax, WIN_W
shl ebx, 16 shl ebx, 16
@ -513,45 +513,40 @@ panel_top:
mcall 13,0*65536+B_WBAR_X,84*65536+199,0xE7E7E7 mcall 13,0*65536+B_WBAR_X,84*65536+199,0xE7E7E7
draw_window: draw_window:
call draw_clock
call draw_week call draw_week
mcall 8,193*65536+8,287*65536+10,72,COL_TOOLBAR_BG mcall 8,193*65536+8,285*65536+10,72,COL_TOOLBAR_BG
mov ebx,202*65536+8 mov ebx,202*65536+8
inc edx ;73 inc edx ;73
mcall mcall
mov ebx,193*65536+8 mov ebx,193*65536+8
mov ecx,311*65536+10 mov ecx,315*65536+10
inc edx ;74 inc edx ;74
mcall mcall
mov ebx,202*65536+8 mov ebx,202*65536+8
inc edx ;75 inc edx ;75
mcall mcall
mov ebx,215*65536+8 mov ebx,215*65536+8
mov ecx,287*65536+10 mov ecx,285*65536+10
inc edx ;76 inc edx ;76
mcall mcall
mov ebx,224*65536+8 mov ebx,224*65536+8
inc edx ;77 inc edx ;77
mcall mcall
mov ebx,215*65536+8 mov ebx,215*65536+8
mov ecx,311*65536+10 mov ecx,315*65536+10
inc edx ;78 inc edx ;78
mcall mcall
mov ebx,224*65536+8 mov ebx,224*65536+8
inc edx ;79 inc edx ;79
mcall mcall
;mov ebx,237*65536+21
;mov ecx,281*65536+35
;inc edx ;80
;or edx,0x40CCFF44
;mcall
mov ebx,25*65536+110 mov ebx,25*65536+110
mov ecx,293*65536+22 mov ecx,293*65536+22
mov esi,COL_TOOLBAR_BG mov esi,COL_TOOLBAR_BG
mov edx,81 mov edx,81
mcall mcall
mov esi,COL_MONTH_YEAR_B ; new style mov esi,COL_MONTH_YEAR_B ; new style
mov edx,10 mov edx,10
or edx,1 shl 29+1 shl 30 or edx,1 shl 29+1 shl 30
mov ebx,B_NS_X mov ebx,B_NS_X
@ -568,7 +563,7 @@ draw_window:
mov ebx,B_SPIN_X ; < mov ebx,B_SPIN_X ; <
inc edx inc edx
mcall mcall
add ebx,61 shl 16 ; > add ebx,54 shl 16 ; >
inc edx inc edx
mcall mcall
call draw_days call draw_days
@ -577,8 +572,8 @@ draw_window:
mcall 4,157*65536+301,0x80CCCCCC,sys_text mcall 4,157*65536+301,0x80CCCCCC,sys_text
mcall ,211*65536+301,,separator mcall ,211*65536+301,,separator
mcall ,233*65536+301 mcall ,233*65536+301
mcall ,185*65536+289, ,plus mcall ,185*65536+287, ,plus
mcall ,185*65536+313, ,minus mcall ,185*65536+317, ,minus
mcall , 35*65536+300,0x00CCCCCC,set_date_t,15 ;set date text mcall , 35*65536+300,0x00CCCCCC,set_date_t,15 ;set date text
@ -603,8 +598,8 @@ draw_window:
mov ebx,B_SPIN mov ebx,B_SPIN
mov edx,spinner mov edx,spinner
mov esi,12 mov esi,8
mov ecx,COL_DROPDOWN_T mov ecx,COL_DROPDOWN_T
mcall mcall
mov edx,[Month] mov edx,[Month]
@ -616,12 +611,10 @@ draw_window:
mcall mcall
call draw_year call draw_year
call draw_clock
mov [dropped],0 mov [dropped],0
ret ret
draw_year: draw_year:
mcall 8,B_YEAR_X,B_Y,5,COL_MONTH_YEAR_B
ShowFocus 3,esi ShowFocus 3,esi
mcall 47,0x40001,Year,B_YEAR mcall 47,0x40001,Year,B_YEAR
ret ret
@ -696,8 +689,8 @@ draw_days:
mov edx,B_DAYS_Y mov edx,B_DAYS_Y
mov ebx,0x10001 mov ebx,0x10001
mov edi,[firstday] mov edi,[firstday]
.dayloop:
push ecx push ecx
.dayloop:
movzx edx,dx movzx edx,dx
mov esi,edi mov esi,edi
shl esi,21 shl esi,21
@ -714,18 +707,17 @@ draw_days:
mov ecx,number mov ecx,number
inc dword[ecx] inc dword[ecx]
pusha pusha
sub edx,8 shl 16 + 8
mov ebx,edx mov ebx,edx
mov bx,DATE_BUTTON_WIDTH-1 mov bx,DATE_BUTTON_WIDTH-1
sub ebx,8 shl 16
shrd ecx,edx,16 shrd ecx,edx,16
mov cx,DATE_BUTTON_HEIGHT-1 mov cx,DATE_BUTTON_HEIGHT-1
sub ecx,12 shl 16
mov edx,[number] mov edx,[number]
cmp edx,[day_sel] cmp edx,[day_sel]
je .draw_sel je .draw_sel
mov esi,COL_DATE_BUTTONS mov esi,COL_DATE_BUTTONS
jmp .draw_but jmp .draw_but
.draw_sel: ;draw selected button .draw_sel: ;draw selected button
add edx,1 shl 30 add edx,1 shl 30
add edx,200+1 shl 29 add edx,200+1 shl 29
mcall 8 mcall 8
@ -736,7 +728,7 @@ draw_days:
.not_active: .not_active:
DrawRect COL_DATE_INACTIVE_1,COL_DATE_INACTIVE_2,COL_DATE_INACTIVE_3,COL_DATE_INACTIVE_4 DrawRect COL_DATE_INACTIVE_1,COL_DATE_INACTIVE_2,COL_DATE_INACTIVE_3,COL_DATE_INACTIVE_4
jmp .out jmp .out
.draw_but: ;draw non selected button .draw_but: ;draw non selected button
add edx,200+1 shl 29 add edx,200+1 shl 29
mcall 8 mcall 8
mov eax,[Year] mov eax,[Year]
@ -755,43 +747,36 @@ draw_days:
add ecx,27 shl 16 add ecx,27 shl 16
mcall 13 mcall 13
.out: .out:
mov eax, [number] mov eax, [number]
xor edx, edx xor edx, edx
mov ecx, 10 mov ecx, 10
div ecx div ecx
mov [remainder], edx mov [remainder], edx
mov [quotient], eax mov [quotient], eax
popa popa
;first number ; first number
mov ecx,quotient mov ecx,quotient
mcall
add edx,1 shl 16
mcall mcall
sub edx,1 shl 16 add edx,1 shl 16
;second number
mov ecx,remainder
add edx,9 shl 16
mcall
add edx,1 shl 16
mcall mcall
sub edx,10 shl 16 ; second number
mov ecx,remainder
add edx,8 shl 16
pop ecx mcall
inc edi add edx,1 shl 16
cmp edi,7 mcall
jne .nowrap sub edx,10 shl 16
xor edi,edi inc edi
add dx,B_DAYS_SHIFT cmp edi,7
.nowrap: jne .nowrap
loop .eloop xor edi,edi
jmp .ex add dx,B_DAYS_SHIFT
.eloop: .nowrap:
jmp .dayloop dec dword [esp]
.ex: jnz .dayloop
ret pop ecx
ret
count_days: ; ecx -days in month count_days: ; ecx -days in month
call is_leap_year call is_leap_year

View File

@ -24,7 +24,7 @@ COL_WEEKDAY_BG equ 0xCCCDDD
COL_DATE_BUTTONS equ 0xF3F3F3 COL_DATE_BUTTONS equ 0xF3F3F3
COL_TIME_BUTTONS equ 0x5555dd COL_TIME_BUTTONS equ 0x5555dd
COL_GO_TODAY_T equ 0xd048c8 COL_GO_TODAY_T equ 0xd048c8
COL_MONTH_YEAR_B equ 0x0555555 ; 0 for time? COL_MONTH_YEAR_B equ 0x555555
COL_DROPDOWN_BG equ 0x666666 COL_DROPDOWN_BG equ 0x666666
COL_DROPDOWN_T equ 0x10CCCccc COL_DROPDOWN_T equ 0x10CCCccc
COL_NEW_STYLE_T equ 0xef3333 COL_NEW_STYLE_T equ 0xef3333
@ -49,26 +49,24 @@ 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+27
BT_WBAR_Y equ 283 shl 16+43 BT_WBAR_Y equ 283 shl 16+43
B_WBAR_X equ 1 shl 16+WIN_W-1 B_WBAR_X equ 1 shl 16+WIN_W-1
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+64
B_WX_SHIFT equ 32 shl 16 B_WX_SHIFT equ 32 shl 16
B_DROP equ B_MONTH+16 B_DROP equ B_MONTH+16
B_DAYS_Y equ 106 B_DAYS_Y equ 106
B_DAYS_SHIFT equ 30 B_DAYS_SHIFT equ 30
B_YEAR_X equ 198 shl 16+46 B_YEAR equ 204 shl 16+28
B_YEAR equ 206 shl 16+32
B_SPIN_WIDTH equ 13 B_SPIN_X equ 186 shl 16+12
B_SPIN_X equ 184 shl 16+B_SPIN_WIDTH B_SPIN equ 188 shl 16+28
B_SPIN equ 188 shl 16+32 spinner db '< >'
spinner db '< >'
B_TODAY_X equ 25 shl 16 B_TODAY_X equ 25 shl 16
B_TODAY_Y equ 48 shl 16+10 B_TODAY_Y equ 48 shl 16+10