@icon: use bigger fonts and optimize redraw in Dialog "Add/Change icon"

git-svn-id: svn://kolibrios.org@7012 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2017-09-26 18:05:30 +00:00
parent 410ae12073
commit d11225a260
6 changed files with 63 additions and 65 deletions

View File

@ -10,9 +10,9 @@ MIN_NO_MOVING equ 8 ;
;--------¤«ï ¤¨ «®£  ᮧ¤ ­¨ï/। ªâ¨à®¢ ­¨ï ;--------¤«ï ¤¨ «®£  ᮧ¤ ­¨ï/। ªâ¨à®¢ ­¨ï
ICONSX equ 20 ICONSX equ 20
ICONSY equ 80 ICONSY equ 90
ICONS_DRAW_COUNTW equ 10 ;ª®«¨ç¥á⢮ ¨ª®­®ª ¢ è¨à¨­ã ICONS_DRAW_COUNTW equ 12 ;ª®«¨ç¥á⢮ ¨ª®­®ª ¢ è¨à¨­ã
ICONS_DRAW_COUNTH equ 4 ;ª®«¨ç¥á⢮ ¨ª®­®ª ¢ ¢ëá®âã ICONS_DRAW_COUNTH equ 6 ;ª®«¨ç¥á⢮ ¨ª®­®ª ¢ ¢ëá®âã
SPCW equ 3 ;¯à®¡¥« ¬¥¦¤ã ¨ª®­ª ¬¨ ¯® £®à¨§®­â «¨ SPCW equ 3 ;¯à®¡¥« ¬¥¦¤ã ¨ª®­ª ¬¨ ¯® £®à¨§®­â «¨
SPCH equ 3 SPCH equ 3
END_ICONS_AREAW equ ICONSX+(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW END_ICONS_AREAW equ ICONSX+(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW
@ -1144,10 +1144,9 @@ if lang eq ru
DTitleAdd db '„®¡ ¢¨âì ¨ª®­ªã',0 DTitleAdd db '„®¡ ¢¨âì ¨ª®­ªã',0
DTitleProp db 'ˆ§¬¥­¨âì ¨ª®­ªã',0 DTitleProp db 'ˆ§¬¥­¨âì ¨ª®­ªã',0
DCaptName db 'ˆ¬ï',0 DCaptName db ' ˆ¬ï',0
DCaptPath db '<27>ãâì',0 DCaptPath db ' <20>ãâì',0
DCaptParams db '<27> à ¬¥âàë',0 DCaptParams db ' Š«îç¨',0
DCaptIcon db 'ˆª®­ª ',0
;DCaptChange db '.',0 ;DCaptChange db '.',0
DCaptCreate db '‘®§¤ âì',0 DCaptCreate db '‘®§¤ âì',0
DCaptProperties db 'ˆ§¬¥­¨âì',0 DCaptProperties db 'ˆ§¬¥­¨âì',0
@ -1157,23 +1156,23 @@ else
DTitleAdd db 'Add icon',0 DTitleAdd db 'Add icon',0
DTitleProp db 'Change icon',0 DTitleProp db 'Change icon',0
DCaptName db 'Name',0 DCaptName db ' Name',0
DCaptPath db 'Path',0 DCaptPath db ' Path',0
DCaptParams db 'Parameters',0 DCaptParams db ' Params',0
DCaptIcon db 'Icon',0
DCaptCreate db 'Create',0 DCaptCreate db 'Create',0
DCaptProperties db 'Change',0 DCaptProperties db 'Change',0
DCaptCancel db 'Cancel',0 DCaptCancel db 'Cancel',0
end if end if
DCaptDots db '...',0
;/­¥ ¬¥­ïâì ¯®«®¦¥­¨¥ ;/­¥ ¬¥­ïâì ¯®«®¦¥­¨¥
edtName edit_box NAME_LENGTH*6+4,70+20+IMG_SIZE,6,0FFFFFFh,06F9480h,0FFh,0h,0,NAME_LENGTH,\ edtName edit_box NAME_LENGTH*8+4,120+IMG_SIZE,6,0FFFFFFh,06F9480h,0FFh,0h,0x90000000,NAME_LENGTH,\
DAreaName,mouse_dd,0,0,0 DAreaName,mouse_dd,0,0,0
edtExePath edit_box 281-3-20-IMG_SIZE,70+20+IMG_SIZE,26,0FFFFFFh,06F9480h,0FFh,0h,0,255,\ edtExePath edit_box END_ICONS_AREAW-120-IMG_SIZE-40,120+IMG_SIZE,30,0FFFFFFh,06F9480h,\
DAreaPath,mouse_dd,0,0,0 0FFh,0h,0x90000000,255, DAreaPath,mouse_dd,0,0,0
edtParams edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,46,0FFFFFFh,06F9480h,0FFh,0h,0,255,\ edtParams edit_box END_ICONS_AREAW-120-IMG_SIZE, 120+IMG_SIZE,54,0FFFFFFh,06F9480h,\
DAreaParams,mouse_dd,0,0,0 0FFh,0h,0x90000000,255, DAreaParams,mouse_dd,0,0,0
edtIcon edit_box 28,24,50,0FFFFFFh,0FFFFFFh,0FFh,0h,0,3,\ edtIcon edit_box 28,24,62,0FFFFFFh,0FFFFFFh,0FFh,0h,0x90000000,3,\
DAreaIcon,0,0,0,0 DAreaIcon,0,0,0,0
endEdits: endEdits:
;\ ;\

View File

@ -92,9 +92,10 @@ DlgProp:
mov ecx,256 mov ecx,256
mov edi,DAreaIcon mov edi,DAreaIcon
rep stosb
mov dword[edtIcon.size],0 mov [DAreaIcon],'0'
mov dword[edtIcon.pos],0 mov dword[edtIcon.size],1
mov dword[edtIcon.pos],1
jmp startDlg jmp startDlg
;-------- ;--------
@ -370,10 +371,8 @@ DMouse:
; stdcall [edit_box_draw],edtIcon ; stdcall [edit_box_draw],edtIcon
; need to optimize redraw call DrawSelIcon
; call DrawSelIcon jmp DMessages
; jmp DMessages
jmp DReDraw
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
DSetExePath: DSetExePath:
stdcall [OpenDialog_Start],OpenDialog_data stdcall [OpenDialog_Start],OpenDialog_data
@ -455,79 +454,71 @@ proc DRedrawWin
@@: @@:
mov edi,DTitleProp mov edi,DTitleProp
.l1: .l1:
mcall 0,<100,400>,<100,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH+165>,,, mcall 0,<100,END_ICONS_AREAW+ICONSX+10>,<100,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH+178>,,,
stdcall [edit_box_draw],edtName stdcall [edit_box_draw],edtName
stdcall [edit_box_draw],edtExePath stdcall [edit_box_draw],edtExePath
stdcall [edit_box_draw],edtParams stdcall [edit_box_draw],edtParams
stdcall [edit_box_draw],edtIcon
call DrawStdIcons call DrawStdIcons
stdcall [scrollbar_h_draw],sbIcons stdcall [scrollbar_h_draw],sbIcons
mcall 38,<ICONSX+1,END_ICONS_AREAW-2>,\ mcall 38,<ICONSX+1,END_ICONS_AREAW-2>,<END_ICONS_AREAH+3,END_ICONS_AREAH+3>,[sc.work_graph]
<END_ICONS_AREAH+3,END_ICONS_AREAH+3>,\ mcall ,<ICONSX+1,END_ICONS_AREAW-2>,<END_ICONS_AREAH+3+15,END_ICONS_AREAH+3+15>,[sc.work_graph]
[sc.work_graph]
mcall ,<ICONSX+1,END_ICONS_AREAW-2>,\
<END_ICONS_AREAH+3+15,END_ICONS_AREAH+3+15>,\
[sc.work_graph]
mcall ,<ICONSX,ICONSX>,\ mcall ,<ICONSX,ICONSX>,<END_ICONS_AREAH+3+1,END_ICONS_AREAH+3+15-1>,[sc.work_graph]
<END_ICONS_AREAH+3+1,END_ICONS_AREAH+3+15-1>,\ mcall ,<END_ICONS_AREAW-1,END_ICONS_AREAW-1>,<END_ICONS_AREAH+3+1,END_ICONS_AREAH+3+15-1>, [sc.work_graph]
[sc.work_graph]
mcall ,<END_ICONS_AREAW-1,END_ICONS_AREAW-1>,\
<END_ICONS_AREAH+3+1,END_ICONS_AREAH+3+15-1>,\
[sc.work_graph]
;BUTTONS ;BUTTONS
mcall 8,<250,49>,<30+END_ICONS_AREAH,16>,idbCreate,[sc.work_button] mcall 8,<265,75>,<30+END_ICONS_AREAH,24>,idbCreate,[sc.work_button]
mcall ,<305,54>, ,idbCancel mcall ,<360,77>, ,idbCancel
mcall ,<351,14>,<26,14> ,idbChange mcall ,<END_ICONS_AREAW-30,30>,<30,20> ,idbChange
;CAPTIONS ;CAPTIONS
mov ecx,[sc.work_text] mov ecx,[sc.work_text]
or ecx,80000000h or ecx,90000000h
mcall 4,<30+IMG_SIZE,10>,,DCaptName mcall 4,<30+IMG_SIZE,10>,,DCaptName
mcall ,<30+IMG_SIZE,30>,,DCaptPath mcall ,<30+IMG_SIZE,35>,,DCaptPath
mcall ,<30+IMG_SIZE,50>,,DCaptParams mcall ,<30+IMG_SIZE,59>,,DCaptParams
;mcall ,<30+IMG_SIZE,70>,,DCaptIcon
if lang eq ru if lang eq ru
mov ecx,[sc.work_button_text] mov ecx,[sc.work_button_text]
or ecx,80000000h or ecx,90000000h
mcall ,<309,35+END_ICONS_AREAH>,,DCaptCancel mcall ,<369,35+END_ICONS_AREAH>,,DCaptCancel
cmp [DlgSelIcon],-1 cmp [DlgSelIcon],-1
jne @f jne @f
mpack ebx,255,35+END_ICONS_AREAH mpack ebx,275,35+END_ICONS_AREAH
mov edx,DCaptCreate mov edx,DCaptCreate
jmp .DRD1 jmp .DRD1
@@: @@:
mpack ebx,252,35+END_ICONS_AREAH mpack ebx,272,35+END_ICONS_AREAH
mov edx,DCaptProperties mov edx,DCaptProperties
.DRD1: .DRD1:
else else
mov ecx,[sc.work_button_text] mov ecx,[sc.work_button_text]
or ecx,80000000h or ecx,90000000h
mcall ,<315,35+END_ICONS_AREAH>,,DCaptCancel mcall ,<372,35+END_ICONS_AREAH>,,DCaptCancel
cmp [DlgSelIcon],-1 cmp [DlgSelIcon],-1
jne @f jne @f
mpack ebx,257,35+END_ICONS_AREAH mpack ebx,277,35+END_ICONS_AREAH
mov edx,DCaptCreate mov edx,DCaptCreate
jmp .DRD1 jmp .DRD1
@@: @@:
mpack ebx,257,35+END_ICONS_AREAH mpack ebx,277,35+END_ICONS_AREAH
mov edx,DCaptProperties mov edx,DCaptProperties
.DRD1: .DRD1:
end if end if
mcall mcall
mcall 1,351+4 ,26+10,[sc.work_button_text] pusha
mcall ,351+4+3,26+10, mov ecx,[sc.work_button_text]
mcall ,351+4+6,26+10, or ecx,90000000h
mcall 4,<END_ICONS_AREAW-30+4,33>,,DCaptDots
popa
call DrawSelIcon call DrawSelIcon
@ -656,6 +647,15 @@ local IcoX:DWORD,\
endp endp
proc DrawSelIcon proc DrawSelIcon
mov edx,[sc.work]
mcall 13,<ICONSX+18,3*8>,<59,12>
mov ecx,[sc.work_text]
or ecx,90000000h
mcall 4,<ICONSX+18,59>,,DAreaIcon
mov edi,DAreaIcon mov edi,DAreaIcon
cmp byte[edi],0 cmp byte[edi],0
jne @f jne @f
@ -721,7 +721,7 @@ proc DrawSelIcon
dec edx dec edx
jnz .DrawLine jnz .DrawLine
mcall 7,DlgBufImg,<IMG_SIZE,IMG_SIZE>,<15,15> mcall 7,DlgBufImg,<IMG_SIZE,IMG_SIZE>,<30,15>
ret ret
endp endp

View File

@ -1,6 +0,0 @@
@erase lang.inc
@echo lang fix et >lang.inc
@fasm -m 16384 @icon.asm @icon
@kpack @icon
@erase lang.inc
@pause

View File

@ -0,0 +1,5 @@
@echo lang fix ru >lang.inc
@fasm -m 16384 @icon.asm @icon
@erase lang.inc
@kpack @icon
@pause