From 8068f9225d9da0197fa520056124e476e158300a Mon Sep 17 00:00:00 2001 From: GerdtR Date: Fri, 1 Nov 2013 21:07:43 +0000 Subject: [PATCH] Now take into account also the upper-left corner of the workspace. git-svn-id: svn://kolibrios.org@4146 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/icon_new/@icon.asm | 1901 +++++++++++++------------ programs/system/icon_new/DlgAdd.inc | 952 +++++++------ programs/system/icon_new/RButton.inc | 1003 +++++++------ programs/system/icon_new/bgredraw.inc | 62 +- 4 files changed, 2013 insertions(+), 1905 deletions(-) diff --git a/programs/system/icon_new/@icon.asm b/programs/system/icon_new/@icon.asm index 8cb9b4882..e8e3f1146 100644 --- a/programs/system/icon_new/@icon.asm +++ b/programs/system/icon_new/@icon.asm @@ -1,42 +1,40 @@ ;иногда неверно определяется ширина менюшки -ICONS_DAT equ '/rd/1/icons.dat' -ICON_STRIP equ '/rd/1/iconstrp.png' -ICON_SIZE equ 68 -IMG_SIZE equ 32 -TEXT_BOTTOM_Y equ 14 -IMAGE_TOP_Y equ 10 ;>=1 -ALIGN_SIZE equ 68 -NAME_LENGTH equ 11 -MIN_NO_MOVING equ 8 - ;для диалога создания/редактирования -ICONSX equ 20 -ICONSY equ 80 +ICONS_DAT equ '/rd/1/icons.dat' +ICON_STRIP equ '/rd/1/iconstrp.png' +ICON_SIZE equ 68 +IMG_SIZE equ 32 +TEXT_BOTTOM_Y equ 14 +IMAGE_TOP_Y equ 10 ;>=1 +ALIGN_SIZE equ 68 +NAME_LENGTH equ 11 +MIN_NO_MOVING equ 8 + ;для диалога создания/редактирования +ICONSX equ 20 +ICONSY equ 80 ICONS_DRAW_COUNTW equ 10 ;количество иконок в ширину ICONS_DRAW_COUNTH equ 2 ;количество иконок в высоту -SPCW equ 3 ;пробел между иконками по горизонтали -SPCH equ 3 +SPCW equ 3 ;пробел между иконками по горизонтали +SPCH equ 3 END_ICONS_AREAW equ ICONSX+(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW END_ICONS_AREAH equ ICONSY+(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH -SizeData equ bufStdIco+32 -BegData equ fiStdIco.point +SizeData equ bufStdIco+32 +BegData equ fiStdIco.point ;------------------------------------------------------------------------------ - use32 - org 0x0 - db 'MENUET01' ; 8 byte id - dd 0x01 ; header version - dd START ; start of code - dd I_END ; size of image - dd ENDMEM ; memory for app - dd stack_main ; esp - dd 0 ; boot parameters - dd 0 ; path + use32 + org 0x0 + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd START ; start of code + dd I_END ; size of image + dd ENDMEM ; memory for app + dd stack_main ; esp + dd 0 ; boot parameters + dd 0 ; path ;------------------------------------------------------------------------------ -include 'lang.inc' - include 'lang.inc' include '../../macros.inc' include '../../proc32.inc' @@ -45,239 +43,239 @@ include '../../dll.inc' ;include '../../debug.inc' ;------------------------------------------------------------------------------ -START: ; start of execution - mcall 68,11 - stdcall dll.Load,IMPORTS - test eax,eax - jnz ErrLoadLibs +START: ; start of execution + mcall 68,11 + stdcall dll.Load,IMPORTS + test eax,eax + jnz ErrLoadLibs ; unpack deflate - mov eax,[unpack_DeflateUnpack2] - mov [deflate_unpack],eax + mov eax,[unpack_DeflateUnpack2] + mov [deflate_unpack],eax ;--------------------------------------------------------------------- ; get size of file ICONSTRP.PNG - mcall 70,fiStdIco - test eax,eax - jnz ErrorStrp + mcall 70,fiStdIco + test eax,eax + jnz ErrorStrp ; get memory for ICONSTRP.PNG - mov ecx,dword[bufStdIco+32] - mov [fiStdIco.size],ecx - mov [img_size],ecx - mcall 68,12 - mov [fiStdIco.point],eax - mov [image_file],eax + mov ecx,dword[bufStdIco+32] + mov [fiStdIco.size],ecx + mov [img_size],ecx + mcall 68,12 + mov [fiStdIco.point],eax + mov [image_file],eax ; load ICONSTRP.PNG - mov dword[fiStdIco],0 - mcall 70,fiStdIco - test eax,eax - jnz close + mov dword[fiStdIco],0 + mcall 70,fiStdIco + test eax,eax + jnz close ; convert PNG to RAW - xor eax,eax - mov [return_code],eax + xor eax,eax + mov [return_code],eax ;int3 - push image_file - call [cnv_png_import.Start] + push image_file + call [cnv_png_import.Start] - mov eax,[raw_pointer] - mov ebx,[eax+32] - mov [strip_file_size],ebx - mov eax,[eax+28] - add eax,[raw_pointer] - mov [strip_file],eax + mov eax,[raw_pointer] + mov ebx,[eax+32] + mov [strip_file_size],ebx + mov eax,[eax+28] + add eax,[raw_pointer] + mov [strip_file],eax ; back memory to system - mcall 68,13,[fiStdIco.point] + mcall 68,13,[fiStdIco.point] - mov eax,[raw_pointer] - mov eax,[eax+8] - shr eax,5 - mov [icon_count],eax + mov eax,[raw_pointer] + mov eax,[eax+8] + shr eax,5 + mov [icon_count],eax - and eax,0x7 - mov [cur_band_compensation],eax + and eax,0x7 + mov [cur_band_compensation],eax ;########## загружаем данные иконок в память ########################## - mcall 70,fiIni ;выделяем память, достаточной для хранения ini файла. Её точно хватит для хранения данных об иконках - test eax,eax - jnz ErrorIni + mcall 70,fiIni ;выделяем память, достаточной для хранения ini файла. Её точно хватит для хранения данных об иконках + test eax,eax + jnz ErrorIni - cmp dword[bufIni+32],0 - je ErrorIni - mcall 68,12,dword[bufIni+32] - mov dword[BegData],eax - jmp NoErrIni + cmp dword[bufIni+32],0 + je ErrorIni + mcall 68,12,dword[bufIni+32] + mov dword[BegData],eax + jmp NoErrIni ErrorIni: - mcall 70,fiRunProg - mcall -1 + mcall 70,fiRunProg + mcall -1 NoErrIni: - m2m [PIcoDB],[BegData] + m2m [PIcoDB],[BegData] - stdcall [ini_enum_sections],IconIni,LoadIconsData + stdcall [ini_enum_sections],IconIni,LoadIconsData ;int3 - mov eax,dword[PIcoDB] - sub eax,[BegData] - mov dword[SizeData],eax - mov eax,[BegData] - cmp eax,[PIcoDB] - jne @f - mov dword[eax],0 - mov dword[SizeData],0 + mov eax,dword[PIcoDB] + sub eax,[BegData] + mov dword[SizeData],eax + mov eax,[BegData] + cmp eax,[PIcoDB] + jne @f + mov dword[eax],0 + mov dword[SizeData],0 @@: ;###################################################################### - call FillIconsOffs ;заполняет MaxNumIcon,IconsOffs + call FillIconsOffs ;заполняет MaxNumIcon,IconsOffs - mcall 40,0100000b ;нужны только события мыши, перерисовка иконок будет в другом потоке + mcall 40,0100000b ;нужны только события мыши, перерисовка иконок будет в другом потоке - mov eax,[icon_count] - mov bl,ICONS_DRAW_COUNTH - div bl - test ah,ah - jz @f - inc al + mov eax,[icon_count] + mov bl,ICONS_DRAW_COUNTH + div bl + test ah,ah + jz @f + inc al @@: - and eax,0FFh - mov [sbIcons.max_area],eax + and eax,0FFh + mov [sbIcons.max_area],eax - mcall 51,1,BGRedrawThread,stack_bredraw ;запускаем поток перерисовки иконок - stdcall [OpenDialog_Init],OpenDialog_data + mcall 51,1,BGRedrawThread,stack_bredraw ;запускаем поток перерисовки иконок + stdcall [OpenDialog_Init],OpenDialog_data messages: - mcall 10 - sub eax,6 - jz MSGMouse + mcall 10 + sub eax,6 + jz MSGMouse - jmp messages + jmp messages MSGMouse: - mcall 37,0 ;GetMousePos - xor ebx,ebx - mov bx,ax - shr eax,16 - mov ecx,ebx - mov ebx,eax + mcall 37,0 ;GetMousePos + xor ebx,ebx + mov bx,ax + shr eax,16 + mov ecx,ebx + mov ebx,eax - mcall 34 - cmp eax,1 - jne messages + mcall 34 + cmp eax,1 + jne messages - cmp [RButtonActiv],1 - je messages + cmp [RButtonActiv],1 + je messages - mov [MouseY],ecx - mov [MouseX],ebx + mov [MouseY],ecx + mov [MouseX],ebx - mcall 37,2 - test al,001b - jnz LButtonPress - test al,010b - jnz RButtonPress - jmp messages + mcall 37,2 + test al,001b + jnz LButtonPress + test al,010b + jnz RButtonPress + jmp messages ErrLoadLibs: - ;dps 'Не удалось загрузить необходимые библиотеки' - ;debug_newline - jmp close + ;dps 'Не удалось загрузить необходимые библиотеки' + ;debug_newline + jmp close ErrorStrp: - ;dps 'Ошибка открытия iconstrp.png' - ;debug_newline + ;dps 'Ошибка открытия iconstrp.png' + ;debug_newline close: - mcall -1 + mcall -1 LButtonPress: - stdcall GetNumIcon,[MouseX],[MouseY],-1 + stdcall GetNumIcon,[MouseX],[MouseY],-1 ;int3 - cmp eax,-1 - jnz @f + cmp eax,-1 + jnz @f WaitLB1: - mcall 37,2 - test al,001b - jz messages - ;Yield - mcall 5,1 - jmp WaitLB1 + mcall 37,2 + test al,001b + jz messages + ;Yield + mcall 5,1 + jmp WaitLB1 @@: - push eax - stdcall DrawIcon,eax,1 + push eax + stdcall DrawIcon,eax,1 WaitLB: - mcall 37,2 - test al,001b - jz endWaitLB + mcall 37,2 + test al,001b + jz endWaitLB - mcall 37,0 - xor ebx,ebx - mov bx,ax - shr eax,16 - sub eax,[MouseX] - jns @f - neg eax + mcall 37,0 + xor ebx,ebx + mov bx,ax + shr eax,16 + sub eax,[MouseX] + jns @f + neg eax @@: - sub ebx,[MouseY] - jns @f - neg ebx + sub ebx,[MouseY] + jns @f + neg ebx @@: - cmp [bFixIcons],0 - jne @f - cmp eax,MIN_NO_MOVING - ja MovingIcon - cmp ebx,MIN_NO_MOVING - ja MovingIcon + cmp [bFixIcons],0 + jne @f + cmp eax,MIN_NO_MOVING + ja MovingIcon + cmp ebx,MIN_NO_MOVING + ja MovingIcon @@: - ;Yield - mcall 5,1 ;Sleep 1 + ;Yield + mcall 5,1 ;Sleep 1 - jmp WaitLB + jmp WaitLB endWaitLB: - mcall 37,0 - xor ebx,ebx - mov bx,ax - shr eax,16 - mov ecx,ebx - mov ebx,eax - mov [MouseX],ebx - mov [MouseY],ecx + mcall 37,0 + xor ebx,ebx + mov bx,ax + shr eax,16 + mov ecx,ebx + mov ebx,eax + mov [MouseX],ebx + mov [MouseY],ecx - stdcall GetNumIcon,[MouseX],[MouseY],-1 - cmp eax,[esp] ;[esp] = номер иконки - jne @f + stdcall GetNumIcon,[MouseX],[MouseY],-1 + cmp eax,[esp] ;[esp] = номер иконки + jne @f - mov edi,[IconsOffs+eax*4] - or ecx,-1 - xor al,al - repne scasb - mov ebx,edi - repne scasb - ;run program - mov dword[fiRunProg+8],edi - mov dword[fiRunProg+21],ebx - mcall 70,fiRunProg - test eax,80000000h - jz @f + mov edi,[IconsOffs+eax*4] + or ecx,-1 + xor al,al + repne scasb + mov ebx,edi + repne scasb + ;run program + mov dword[fiRunProg+8],edi + mov dword[fiRunProg+21],ebx + mcall 70,fiRunProg + test eax,80000000h + jz @f - mov dword[fiRunProg+8],ErrRunProg - mov dword[fiRunProg+21],pthNotify - mcall 70,fiRunProg + mov dword[fiRunProg+8],ErrRunProg + mov dword[fiRunProg+21],pthNotify + mcall 70,fiRunProg @@: - pop eax - stdcall RestoreBackgrnd,eax - jmp messages + pop eax + stdcall RestoreBackgrnd,eax + jmp messages ;------------------------------------------------------------------------------- MovingIcon: - stdcall GetNumIcon,[MouseX],[MouseY],-1 - mov [SelIcon],eax - mov [IconNoDraw],eax - stdcall RestoreBackgrnd,[SelIcon] + stdcall GetNumIcon,[MouseX],[MouseY],-1 + mov [SelIcon],eax + mov [IconNoDraw],eax + stdcall RestoreBackgrnd,[SelIcon] ; mov ecx,[MaxNumIcon] ; xor ebx,ebx @@ -342,756 +340,795 @@ MovingIcon: ;qweqwe: - mov [MovingActiv],1 - mcall 51,1,MovingWnd,stack_mov ;CreateThread MovingWnd,stack_dlg + mov [MovingActiv],1 + mcall 51,1,MovingWnd,stack_mov ;CreateThread MovingWnd,stack_dlg .WaitLB: - mcall 37,2 ;GetMouseKey - test al,001b - jz .endWaitLB + mcall 37,2 ;GetMouseKey + test al,001b + jz .endWaitLB - ;Yield - mcall 5,1 ;Sleep 1 - jmp .WaitLB + ;Yield + mcall 5,1 ;Sleep 1 + jmp .WaitLB .endWaitLB: - mcall 37,0 ;GetMousePos - xor ebx,ebx - mov bx,ax - shr eax,16 + mcall 37,0 ;GetMousePos + xor ebx,ebx + mov bx,ax + shr eax,16 - add ebx,7 - dec eax - - sub eax,ICON_SIZE/2 - jns @f - xor eax,eax - @@: - sub ebx,ICON_SIZE/2 - jns @f - xor ebx,ebx + sub eax,1+ICON_SIZE/2 + jnc @f + xor eax,eax @@: - movzx edx,[ScreenX] - sub edx,ICON_SIZE - cmp eax,edx - jbe @f - mov eax,edx + sub ebx,ICON_SIZE/2-7 + jnc @f + xor ebx,ebx @@: - movzx edx,[ScreenY] - sub edx,ICON_SIZE - cmp ebx,edx - jbe @f - mov ebx,edx + cmp ax,[wsX] + jae @f + mov ax,[wsX] @@: - xor edx,edx - mov dx,[ScreenX] - shr edx,1 - cmp eax,edx - jbe @f - sub ax,[ScreenX] - inc ax + cmp bx,[wsY] + jae @f + mov bx,[wsY] + @@: ;eax,ebx - реальная координата. Все координаты в проге относительно левого верхнего угла рабочей области + + xor edx,edx + mov dx,[wsXe] + sub edx,ICON_SIZE + cmp eax,edx + jbe @f + mov eax,edx @@: - xor edx,edx - mov dx,[ScreenY] - shr edx,1 - cmp ebx,edx - jbe @f - sub bx,[ScreenY] - inc bx + mov dx,[wsYe] + sub edx,ICON_SIZE + cmp ebx,edx + jbe @f + mov ebx,edx @@: - stdcall SetPosition,[SelIcon],eax,ebx + xor edx,edx ;преобразовываем в относительные + mov dx,[wsW] + shr edx,1 + add dx,[wsX] + cmp eax,edx + jbe @f + sub ax,[wsXe] + inc ax + jmp .mov1 + @@: + sub ax,[wsX] + .mov1: + + xor edx,edx + mov dx,[wsH] + shr edx,1 + add dx,[wsY] + cmp ebx,edx + jbe @f + sub bx,[wsYe] + inc bx + jmp .mov2 + @@: + sub bx,[wsY] + .mov2: + + stdcall SetPosition,[SelIcon],eax,ebx - m2m [PIcoDB],[BegData] - stdcall [ini_enum_sections],IconIni,Ini_SavePos ;in RButton.inc + m2m [PIcoDB],[BegData] + stdcall [ini_enum_sections],IconIni,Ini_SavePos ;in RButton.inc - mov [bNotSave],1 - mov [IconNoDraw],-1 + mov [bNotSave],1 + mov [IconNoDraw],-1 - mov [MovingActiv],0 ;только теперь отключаем окно с мышью + mov [MovingActiv],0 ;только теперь отключаем окно с мышью - jmp messages + jmp messages ;------------------------------------------------------------------------------- RButtonPress: - cmp [RButtonActiv],1 - je messages - mov [RButtonActiv],1 + cmp [RButtonActiv],1 + je messages + mov [RButtonActiv],1 @@: - mcall 37,2 ;GetMouseKey - test al,010b - jz @f - mcall 5,1 ;Yield - jmp @b + mcall 37,2 ;GetMouseKey + test al,010b + jz @f + mcall 5,1 ;Yield + jmp @b @@: - mcall 51,1,RButtonWin,stack_rmenu ;CreateThread RButtonWin,stack_rmenu + mcall 51,1,RButtonWin,stack_rmenu ;CreateThread RButtonWin,stack_rmenu - jmp messages + jmp messages ;############################################################################### ;ret eax = 1/0 = удача/ошибка proc DrawIcon NumIcon:DWORD,Activ:DWORD ;NumIcon = 0..n -local IconData:DWORD - ; int3 - push ebx edi esi +local IconData:DWORD + push ebx edi esi - mov ecx,ICON_SIZE*ICON_SIZE - xor eax,eax - ;mov eax,0FFFFFFFh - mov edi,IconArea - rep stosd + mov ecx,ICON_SIZE*ICON_SIZE + xor eax,eax + mov edi,IconArea + rep stosd - mov eax,[NumIcon] - cmp eax,[MaxNumIcon] - jb @f - xor eax,eax - pop esi edi ebx - ret + mov eax,[NumIcon] + cmp eax,[MaxNumIcon] + jb @f + xor eax,eax + pop esi edi ebx + ret @@: - mov esi,[IconsOffs+eax*4] - mov [IconData],esi + mov esi,[IconsOffs+eax*4] + mov [IconData],esi - ;рисуем текст - mov edi,esi - xor al,al - or ecx,-1 - repne scasb - mov edx,esi - mov eax,edi - sub eax,esi - dec eax - shl eax,1 ;*6 - lea eax,[eax*2+eax] - mov ebx,ICON_SIZE - sub ebx,eax - shr ebx,1 ;ebx = x текста - shl ebx,16 - mov bx,ICON_SIZE - sub bx,TEXT_BOTTOM_Y - mov ecx,88000000h - mov edi,IconAreaH - add ebx,-1*10000h+0 - mcall 4 - add ebx,2*10000h+0 - mcall 4 - add ebx,-1*10000h-1 - mcall 4 - add ebx,0*10000h+2 - mcall 4 - add ebx,1*10000h+0 - mcall 4 - add ebx,0*10000h+1 - mcall 4 - add ebx,-1*10000h+0 - mcall 4 - add ebx,0*10000h-2 - mov ecx,88FFFFFFh - mcall 4 - ;рисуем картинку + ;рисуем текст + mov edi,esi + xor al,al + or ecx,-1 + repne scasb + mov edx,esi + mov eax,edi + sub eax,esi + dec eax + shl eax,1 ;*6 + lea eax,[eax*2+eax] + mov ebx,ICON_SIZE + sub ebx,eax + shr ebx,1 ;ebx = x текста + shl ebx,16 + mov bx,ICON_SIZE + sub bx,TEXT_BOTTOM_Y + mov ecx,88000000h + mov edi,IconAreaH + add ebx,-1*10000h+0 + mcall 4 + add ebx,2*10000h+0 + mcall ;4 + add ebx,-1*10000h-1 + mcall ;4 + add ebx,0*10000h+2 + mcall ;4 + add ebx,1*10000h+0 + mcall ;4 + inc ebx;add ebx,0*10000h+1 + mcall ;4 + add ebx,-1*10000h+0 + mcall ;4 + add ebx,0*10000h-2 + mov ecx,88FFFFFFh + mcall ;4 + ;рисуем картинку - mov edi,esi - xor al,al - or ecx,-1 - repne scasb - repne scasb - repne scasb - mov al,[edi] - cmp al,'9' - ja PathToIcon - cmp al,'/' - jne GetIconInd + mov edi,esi + xor al,al + or ecx,-1 + repne scasb + repne scasb + repne scasb + mov al,[edi] + cmp al,'9' + ja PathToIcon + cmp al,'/' + jne GetIconInd PathToIcon: - mov al,30h ;заглушка!!!!!!!!!!!!! - mov byte[edi+1],0 + mov al,30h ;заглушка!!!!!!!!!!!!! + mov byte[edi+1],0 - jmp CopyToMem + jmp CopyToMem GetIconInd: - sub al,30h - cmp byte[edi+1],0 - je @f - shl eax,1 - lea eax,[eax*4+eax] - xor edx,edx - mov dl,[edi+1] - sub dl,30h - add eax,edx - @@: ;eax=num icon - cmp eax,[icon_count] - jb @f - xor eax,eax + sub al,30h + cmp byte[edi+1],0 + je @f + shl eax,1 + lea eax,[eax*4+eax] + xor edx,edx + mov dl,[edi+1] + sub dl,30h + add eax,edx + @@: ;eax=num icon + cmp eax,[icon_count] + jb @f + xor eax,eax @@: - test eax,eax - je DI1 - mov ecx,eax - xor eax,eax + test eax,eax + je DI1 + mov ecx,eax + xor eax,eax @@: - add eax,IMG_SIZE*IMG_SIZE*4 - loop @b + add eax,IMG_SIZE*IMG_SIZE*4 + loop @b DI1: - mov esi,eax - add esi,[raw_pointer] - add esi,0+4*11 + add eax,[raw_pointer] + add eax,0+4*11 + mov esi,eax CopyToMem: - mov edi,IconArea+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4 + mov edi,IconArea+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4 - mov eax,IMG_SIZE - mov edx,eax + mov eax,IMG_SIZE + mov edx,eax @@: - mov ecx,eax - rep movsd - add edi,(ICON_SIZE-IMG_SIZE)*4 - dec edx - jnz @b + mov ecx,eax + rep movsd + add edi,(ICON_SIZE-IMG_SIZE)*4 + dec edx + jnz @b ;----------------- - ;если надо, то рисуем обводку - cmp [Activ],0 - je .NoSelect + ;если надо, то рисуем обводку + cmp [Activ],0 + je .NoSelect - mov edi,IconArea - mov eax,0FF000000h - mov ecx,ICON_SIZE - rep stosd - ;mov edi,IconArea+ICON_SIZE*1 + mov edi,IconArea + mov eax,0FF000000h + mov ecx,ICON_SIZE + rep stosd + ;mov edi,IconArea+ICON_SIZE*1 - mov ecx,ICON_SIZE-1 - @@: mov dword[edi],eax - add edi,(ICON_SIZE)*4 - loop @b + mov ecx,ICON_SIZE-1 + @@: mov dword[edi],eax + add edi,(ICON_SIZE)*4 + loop @b - mov edi,IconArea+ICON_SIZE*2*4-4 - mov ecx,ICON_SIZE-1 - @@: mov dword[edi],eax - add edi,(ICON_SIZE)*4 - loop @b + mov edi,IconArea+ICON_SIZE*2*4-4 + mov ecx,ICON_SIZE-1 + @@: mov dword[edi],eax + add edi,(ICON_SIZE)*4 + loop @b - mov edi,IconArea+ICON_SIZE*(ICON_SIZE-1)*4+4 - mov ecx,ICON_SIZE-2 - rep stosd + mov edi,IconArea+ICON_SIZE*(ICON_SIZE-1)*4+4 + mov ecx,ICON_SIZE-2 + rep stosd - mov edi,IconArea+ICON_SIZE*4+4 - mov eax,0FFFFFFFFh - mov ecx,ICON_SIZE-2 - rep stosd + mov edi,IconArea+ICON_SIZE*4+4 + mov eax,0FFFFFFFFh + mov ecx,ICON_SIZE-2 + rep stosd - mov edi,IconArea+ICON_SIZE*4+4 - mov ecx,ICON_SIZE-2 - @@: mov dword[edi],eax - add edi,(ICON_SIZE)*4 - loop @b + mov edi,IconArea+ICON_SIZE*4+4 + mov ecx,ICON_SIZE-2 + @@: mov dword[edi],eax + add edi,(ICON_SIZE)*4 + loop @b - mov edi,IconArea+ICON_SIZE*2*4-4*2 - mov ecx,ICON_SIZE-3 - @@: mov dword[edi],eax - add edi,(ICON_SIZE)*4 - loop @b + mov edi,IconArea+ICON_SIZE*2*4-4*2 + mov ecx,ICON_SIZE-3 + @@: mov dword[edi],eax + add edi,(ICON_SIZE)*4 + loop @b - mov edi,IconArea+ICON_SIZE*(ICON_SIZE-2)*4+4*2 - mov ecx,ICON_SIZE-3 - rep stosd + mov edi,IconArea+ICON_SIZE*(ICON_SIZE-2)*4+4*2 + mov ecx,ICON_SIZE-3 + rep stosd ;-------------- .NoSelect: - mov edi,[IconData] - xor al,al - or ecx,-1 - repne scasb - repne scasb - repne scasb - repne scasb - mov edx,[edi] + mov edi,[IconData] + xor al,al + or ecx,-1 + repne scasb + repne scasb + repne scasb + repne scasb + mov edx,[edi] - test edx,00008000h - jz @f - add dx,[ScreenY] - @@: - test edx,80000000h - jz @f - rol edx,16 - add dx,[ScreenX] - rol edx,16 + test edx,00008000h + jz @f + add dx,[wsYe] + jmp .DI11 @@: + add dx,[wsY] + .DI11: - mov ebx,IconArea - mov ecx,ICON_SIZE*10000h+ICON_SIZE - mcall 25 + test edx,80000000h + jz @f + mov ax,[wsXe] + shl eax,16 + add edx,eax + jmp .DI12 + @@: + mov ax,[wsX] + shl eax,16 + add edx,eax + .DI12: + + mov ebx,IconArea + mov ecx,ICON_SIZE*10000h+ICON_SIZE + mcall 25 ; mov eax,1 - pop esi edi ebx - ret + pop esi edi ebx + ret endp proc RestoreBackgrnd,NumIcon:DWORD - push ebx edi - mov eax,[NumIcon] - cmp eax,[MaxNumIcon] - jb @f - xor eax,eax - pop edi ebx - ret + push ebx edi + mov eax,[NumIcon] + cmp eax,[MaxNumIcon] + jb @f + xor eax,eax + pop edi ebx + ret @@: - mov edi,[IconsOffs+eax*4] - xor al,al - or ecx,-1 - repne scasb - repne scasb - repne scasb - repne scasb + mov edi,[IconsOffs+eax*4] + xor al,al + or ecx,-1 + repne scasb + repne scasb + repne scasb + repne scasb - mov ax,[edi+2] - test ax,8000h - jz @f - add ax,[ScreenX] + mov ax,[edi+2] + test ax,8000h + jz @f + add ax,[wsXe] + jmp .rbg1 @@: + add ax,[wsX] + .rbg1: - mov bx,[edi] - test bx,8000h - jz @f - add bx,[ScreenY] + mov bx,[edi] + test bx,8000h + jz @f + add bx,[wsYe] + jmp .rbg2 @@: + add bx,[wsY] + .rbg2: - mov cx,ax - shl ecx,16 - add ax,ICON_SIZE - mov cx,ax - mov dx,bx - shl edx,16 - add bx,ICON_SIZE - mov dx,bx - dec ecx - dec edx - mcall 15,9 - pop edi ebx - ret + mov cx,ax + shl ecx,16 + add ax,ICON_SIZE + mov cx,ax + mov dx,bx + shl edx,16 + add bx,ICON_SIZE + mov dx,bx + dec ecx + dec edx + mcall 15,9 + pop edi ebx + ret endp ;ret eax=numIcon proc AddIcon stdcall,x,y,lpIcon,lpName,lpExeFile,lpParams - push ebx edi esi + push ebx edi esi - mov eax,[x] - mov ebx,[y] + mov eax,[x] + mov ebx,[y] - xor edx,edx - test eax,8000h - jnz @f - mov dx,[ScreenX] ;если надо, то преобразовываем в - shr edx,1 ;отрицательные координаты - cmp eax,edx - jbe @f - sub ax,[ScreenX] - inc eax + xor edx,edx + test eax,8000h + jnz @f + mov dx,[wsW] ;если надо, то преобразовываем в + shr edx,1 ;отрицательные координаты + add dx,[wsX] + cmp eax,edx + jbe @f + sub ax,[wsW] + inc eax @@: - test ebx,8000h - jnz @f - mov dx,[ScreenY] - shr edx,1 - cmp ebx,edx - jbe @f - sub bx,[ScreenY] - inc ebx + test ebx,8000h + jnz @f + mov dx,[wsY] + shr edx,1 + add dx,[wsH] + cmp ebx,edx + jbe @f + sub bx,[wsH] + inc ebx @@: - ;поправка на случай выхода за край экрана + ;поправка на случай выхода за край экрана - test eax,8000h - jnz @f - mov dx,[ScreenX] - sub edx,ICON_SIZE - cmp eax,edx - jbe @f - mov eax,edx + test eax,8000h + jnz @f + mov dx,[wsXe] + sub edx,ICON_SIZE + cmp eax,edx + jbe @f + mov eax,edx @@: - test ebx,8000h - jnz @f - mov dx,[ScreenY] - sub edx,ICON_SIZE - cmp ebx,edx - jbe @f - mov ebx,edx + test ebx,8000h + jnz @f + mov dx,[wsYe] + sub edx,ICON_SIZE + cmp ebx,edx + jbe @f + mov ebx,edx @@: - mov [x],eax - mov [y],ebx + mov [x],eax + mov [y],ebx - xor al,al - or ecx,-1 - mov edi,[lpName] - repne scasb - sub edi,[lpName] - mov ebx,edi - mov edi,[lpExeFile] - repne scasb - sub edi,[lpExeFile] - add ebx,edi - mov edi,[lpParams] - repne scasb - sub edi,[lpParams] - add ebx,edi - mov edi,[lpIcon] - repne scasb - sub edi,[lpIcon] - add ebx,edi - add ebx,4 - mov ecx,dword[SizeData] - add ecx,ebx - mov edx,[IconsOffs] - mcall 68,20 + xor al,al + or ecx,-1 + mov edi,[lpName] + repne scasb + sub edi,[lpName] + mov ebx,edi + mov edi,[lpExeFile] + repne scasb + sub edi,[lpExeFile] + add ebx,edi + mov edi,[lpParams] + repne scasb + sub edi,[lpParams] + add ebx,edi + mov edi,[lpIcon] + repne scasb + sub edi,[lpIcon] + add ebx,edi + add ebx,4 + mov ecx,dword[SizeData] + add ecx,ebx + mov edx,[IconsOffs] + mcall 68,20 - mov edx,dword[SizeData] - mov dword[SizeData],ecx - mov dword[BegData],eax - mov edi,eax - add edi,edx - mov esi,[lpName] + mov edx,dword[SizeData] + mov dword[SizeData],ecx + mov dword[BegData],eax + mov edi,eax + add edi,edx + mov esi,[lpName] @@: lodsb - stosb - test al,al - jnz @b + stosb + test al,al + jnz @b - mov esi,[lpExeFile] + mov esi,[lpExeFile] @@: lodsb - stosb - test al,al - jnz @b + stosb + test al,al + jnz @b - mov esi,[lpParams] + mov esi,[lpParams] @@: lodsb - stosb - test al,al - jnz @b + stosb + test al,al + jnz @b - mov esi,[lpIcon] + mov esi,[lpIcon] @@: lodsb - stosb - test al,al - jnz @b + stosb + test al,al + jnz @b - mov eax,[x] - mov ebx,[y] - shl eax,16 - mov ax,bx - mov dword[edi],eax + mov eax,[x] + mov ebx,[y] + shl eax,16 + mov ax,bx + mov dword[edi],eax - stdcall FillIconsOffs + stdcall FillIconsOffs - pop esi edi ebx - ret + pop esi edi ebx + ret endp proc EditIcon stdcall,NumIcon,lpIcon,lpName,lpExeFile,lpParams - push edi - mov eax,[NumIcon] - mov edi,[IconsOffs+eax*4] - xor al,al - or ecx,-1 - repne scasb - repne scasb - repne scasb - repne scasb - push dword[edi] - stdcall DelIcon,[NumIcon] - pop edx - xor eax,eax - mov ax,dx - shr edx,16 - stdcall AddIcon,edx,eax,DAreaIcon,DAreaName,DAreaPath,DAreaParams - pop edi - ret + push edi + mov eax,[NumIcon] + mov edi,[IconsOffs+eax*4] + xor al,al + or ecx,-1 + repne scasb + repne scasb + repne scasb + repne scasb + push dword[edi] + stdcall DelIcon,[NumIcon] + pop edx + xor eax,eax + mov ax,dx + shr edx,16 + stdcall AddIcon,edx,eax,DAreaIcon,DAreaName,DAreaPath,DAreaParams + pop edi + ret endp proc SetPosition stdcall,NumIcon,x,y - push edi - mov eax,[NumIcon] - mov edi,[IconsOffs+eax*4] - xor al,al - or ecx,-1 - repne scasb - repne scasb - repne scasb - repne scasb - mov eax,[x] - shl eax,16 - mov ax,word[y] - mov dword[edi],eax - pop edi - ret + push edi + mov eax,[NumIcon] + mov edi,[IconsOffs+eax*4] + xor al,al + or ecx,-1 + repne scasb + repne scasb + repne scasb + repne scasb + mov eax,[x] + shl eax,16 + mov ax,word[y] + mov dword[edi],eax + pop edi + ret endp proc GetNumIcon stdcall,x,y,NumIconI ;номер иконки, который проверять не надо или -1 local posX:WORD,\ posY:WORD - push ebx edi - mov ecx,[MaxNumIcon] - test ecx,ecx - jnz @f - or eax,-1 - pop edi ebx - ret + push ebx edi + mov ecx,[MaxNumIcon] + test ecx,ecx + jnz @f + or eax,-1 + pop edi ebx + ret @@: - mov ebx,ecx - dec ebx + mov ebx,ecx + dec ebx .TestIcon: - cmp dword[NumIconI],-1 - je @f + cmp dword[NumIconI],-1 + je @f - cmp ebx,[NumIconI] - jne @f - dec ebx - dec ecx - test ecx,ecx - jz .NoIcon + cmp ebx,[NumIconI] + jne @f + dec ebx + dec ecx + test ecx,ecx + jz .NoIcon @@: - push ecx + push ecx - or ecx,-1 - xor al,al - mov edi,[IconsOffs+ebx*4] - repne scasb - repne scasb - repne scasb - repne scasb + or ecx,-1 + xor al,al + mov edi,[IconsOffs+ebx*4] + repne scasb + repne scasb + repne scasb + repne scasb - mov ax,[edi+2] - test ax,8000h - jz @f - add ax,[ScreenX] + mov ax,[edi+2] + test ax,8000h + jz @f + add ax,[wsXe] + jmp .gni1 @@: - mov [posX],ax + add ax,[wsX] + .gni1: + mov [posX],ax - mov ax,[edi] - test ax,8000h - jz @f - add ax,[ScreenY] + mov ax,[edi] + test ax,8000h + jz @f + add ax,[wsYe] + jmp .gni2 @@: - mov [posY],ax + add ax,[wsY] + .gni2: - mov eax,[x] - mov edx,[y] + mov [posY],ax - cmp ax,[posX] - jb @f - add word[posX],ICON_SIZE - cmp ax,[posX] - ja @f + mov eax,[x] + mov edx,[y] - cmp dx,[posY] - jb @f - add word[posY],ICON_SIZE - cmp dx,[posY] - ja @f + cmp ax,[posX] + jb @f + add word[posX],ICON_SIZE + cmp ax,[posX] + ja @f - jmp .OkIcon + cmp dx,[posY] + jb @f + add word[posY],ICON_SIZE + cmp dx,[posY] + ja @f + + jmp .OkIcon @@: - dec ebx - pop ecx + dec ebx + pop ecx - loop .TestIcon - ;dec ecx - ;jnz .TestIcon - jmp .NoIcon + ;loop .TestIcon + dec ecx + jnz .TestIcon + jmp .NoIcon .OkIcon: - mov eax,ebx - pop edi ebx - ret + mov eax,ebx + pop edi ebx + ret .NoIcon: - or eax,-1 - pop edi ebx - ret + or eax,-1 + pop edi ebx + ret endp proc DelIcon stdcall,NumIcon - push ebx edi esi + push ebx edi esi - cmp [MaxNumIcon],0 - je .end + cmp [MaxNumIcon],0 + je .end - cmp [MaxNumIcon],1 - je .OhneIco + cmp [MaxNumIcon],1 + je .OhneIco - mov ebx,[NumIcon] + mov ebx,[NumIcon] - mov eax,[MaxNumIcon] - dec eax - mov [MaxNumIcon],eax - cmp ebx,eax - je @f + mov eax,[MaxNumIcon] + dec eax + mov [MaxNumIcon],eax + cmp ebx,eax + je @f - shl ebx,2 + shl ebx,2 - mov ecx,dword[BegData] - add ecx,dword[SizeData] - sub ecx,[IconsOffs+4+ebx] + mov ecx,dword[BegData] + add ecx,dword[SizeData] + sub ecx,[IconsOffs+4+ebx] - mov edx,[IconsOffs+4+ebx] - sub edx,[IconsOffs+ebx] - sub dword[SizeData],edx + mov edx,[IconsOffs+4+ebx] + sub edx,[IconsOffs+ebx] + sub dword[SizeData],edx - mov esi,[IconsOffs+4+ebx] - mov edi,[IconsOffs+ebx] - rep movsb - jmp .endDel + mov esi,[IconsOffs+4+ebx] + mov edi,[IconsOffs+ebx] + rep movsb + jmp .endDel @@: - mov ecx,dword[BegData] - add ecx,dword[SizeData] - sub ecx,[IconsOffs+ebx*4] - sub dword[SizeData],ecx + mov ecx,dword[BegData] + add ecx,dword[SizeData] + sub ecx,[IconsOffs+ebx*4] + sub dword[SizeData],ecx .endDel: - stdcall FillIconsOffs - jmp .end + stdcall FillIconsOffs + jmp .end .OhneIco: - mov edi,[BegData] - mov [SizeData],0 - mov dword[edi],0 - mov [MaxNumIcon],0 - mov dword[IconsOffs],0 + mov edi,[BegData] + mov [SizeData],0 + mov dword[edi],0 + mov [MaxNumIcon],0 + mov dword[IconsOffs],0 .end: - mcall 15,3 - pop esi edi ebx - ret + mcall 15,3 + pop esi edi ebx + ret endp - ;заполняет MaxNumIcon,IconsOffs + ;заполняет MaxNumIcon,IconsOffs proc FillIconsOffs - push ebx edi - mov edi,[BegData] - mov dword[MaxNumIcon],0 - cmp dword[edi],0 - jne @f - mov dword[IconsOffs],0 - pop edi ebx - ret + push ebx edi + mov edi,[BegData] + mov dword[MaxNumIcon],0 + cmp dword[edi],0 + jne @f + mov dword[IconsOffs],0 + pop edi ebx + ret @@: - mov [IconsOffs],edi - xor al,al - xor edx,edx - mov ebx,dword[SizeData] - add ebx,dword[BegData] - or ecx,-1 + mov [IconsOffs],edi + xor al,al + xor edx,edx + mov ebx,dword[SizeData] + add ebx,dword[BegData] + or ecx,-1 .CalcNumIc: - repne scasb - repne scasb - repne scasb - repne scasb - add edi,4 - mov dword[IconsOffs+edx+4],edi - inc dword[MaxNumIcon] - add edx,4 + repne scasb + repne scasb + repne scasb + repne scasb + add edi,4 + mov dword[IconsOffs+edx+4],edi + inc dword[MaxNumIcon] + add edx,4 - cmp edi,ebx - jae @f - jmp .CalcNumIc + cmp edi,ebx + jae @f + jmp .CalcNumIc @@: - mov dword[IconsOffs+edx],0 - pop edi ebx - ret + mov dword[IconsOffs+edx],0 + pop edi ebx + ret endp proc LoadIconsData stdcall,f_name,sec_name - push ebx esi edi + push ebx esi edi - mov edi,secRButt - mov esi,[sec_name] + mov edi,secRButt + mov esi,[sec_name] @@: lodsb - scasb - jnz .lid1 - test al,al - jnz @b + scasb + jnz .lid1 + test al,al + jnz @b - mov eax,1 - pop edi esi ebx - ret + mov eax,1 + pop edi esi ebx + ret .lid1: - mov edi,[PIcoDB] - mov esi,[sec_name] + mov edi,[PIcoDB] + mov esi,[sec_name] @@: lodsb - stosb - test al,al - jnz @b + stosb + test al,al + jnz @b - stdcall [ini_get_str],[f_name],[sec_name],keyPath,edi,4096,0 - test eax,eax - jz @f - xor eax,eax - pop edi esi ebx - ret + stdcall [ini_get_str],[f_name],[sec_name],keyPath,edi,4096,0 + test eax,eax + jz @f + xor eax,eax + pop edi esi ebx + ret @@: - xor al,al - or ecx,-1 - repne scasb + xor al,al + or ecx,-1 + repne scasb - stdcall [ini_get_str],[f_name],[sec_name],keyParams,edi,4096,0 - test eax,eax - jz @f - xor eax,eax - pop edi esi ebx - ret + stdcall [ini_get_str],[f_name],[sec_name],keyParams,edi,4096,0 + test eax,eax + jz @f + xor eax,eax + pop edi esi ebx + ret @@: - xor al,al - or ecx,-1 - repne scasb + xor al,al + or ecx,-1 + repne scasb - stdcall [ini_get_str],[f_name],[sec_name],keyIco,edi,4096,0 - test eax,eax - jz @f - xor eax,eax - pop edi esi ebx - ret + stdcall [ini_get_str],[f_name],[sec_name],keyIco,edi,4096,0 + test eax,eax + jz @f + xor eax,eax + pop edi esi ebx + ret @@: - xor al,al - or ecx,-1 - repne scasb + xor al,al + or ecx,-1 + repne scasb - stdcall [ini_get_int],[f_name],[sec_name],keyX,80000000h - cmp eax,80000000h - jne @f - xor eax,eax - pop edi esi ebx - ret + stdcall [ini_get_int],[f_name],[sec_name],keyX,80000000h + cmp eax,80000000h + jne @f + xor eax,eax + pop edi esi ebx + ret @@: - mov word[edi+2],ax + mov word[edi+2],ax - stdcall [ini_get_int],[f_name],[sec_name],keyY,80000000h - cmp eax,80000000h - jne @f - xor eax,eax - pop edi esi ebx - ret + stdcall [ini_get_int],[f_name],[sec_name],keyY,80000000h + cmp eax,80000000h + jne @f + xor eax,eax + pop edi esi ebx + ret @@: - mov word[edi],ax - add edi,4 - mov [PIcoDB],edi + mov word[edi],ax + add edi,4 + mov [PIcoDB],edi - mov eax,1 - pop edi esi ebx - ret + mov eax,1 + pop edi esi ebx + ret endp include 'bgredraw.inc' @@ -1120,94 +1157,94 @@ raw_pointer_2 dd 0 ;+20 ; not use for scaling align 4 fiStdIco: - dd 5 - dd 0 - dd 0 -.size dd 0 -.point dd bufStdIco - db ICON_STRIP,0 + dd 5 + dd 0 + dd 0 +.size dd 0 +.point dd bufStdIco + db ICON_STRIP,0 align 4 -fiRunProg: ;для запуска программ - dd 7 - dd 0 - dd 0 - dd 0 - dd ErrNotFoundIni - db 0 - dd pthNotify +fiRunProg: ;для запуска программ + dd 7 + dd 0 + dd 0 + dd 0 + dd ErrNotFoundIni + db 0 + dd pthNotify -fiIni dd 5 ;для ini файла - dd 0 - dd 0 - dd 0 - dd bufIni - db '/rd/1/settings/icon.ini',0 +fiIni dd 5 ;для ini файла + dd 0 + dd 0 + dd 0 + dd bufIni + db '/rd/1/settings/icon.ini',0 -IconsFile db ICON_STRIP,0 -NameIconsDat db ICONS_DAT,0 +IconsFile db ICON_STRIP,0 +NameIconsDat db ICONS_DAT,0 align 4 -MaxNumIcon dd 0 ;количество иконок -IconNoDraw dd -1 ;-1 либо номер иконки, которую не надо рисовать( когда её таскают :)) +MaxNumIcon dd 0 ;количество иконок +IconNoDraw dd -1 ;-1 либо номер иконки, которую не надо рисовать( когда её таскают :)) -bFixIcons dd 1 -bNotSave dd 0 +bFixIcons dd 1 +bNotSave dd 0 -LButtonActiv dd 0 -RButtonActiv dd 0 -MovingActiv dd 0 -DlgAddActiv dd 0 +LButtonActiv dd 0 +RButtonActiv dd 0 +MovingActiv dd 0 +DlgAddActiv dd 0 -IconIni db '/rd/1/settings/icon.ini',0 +IconIni db '/rd/1/settings/icon.ini',0 -pthNotify db '/rd/1/@notify',0 +pthNotify db '/rd/1/@notify',0 ;keyName db 'name',0 -keyPath db 'path',0 -keyParams db 'param',0 -keyIco db 'ico',0 -keyX db 'x',0 -keyY db 'y',0 +keyPath db 'path',0 +keyParams db 'param',0 +keyIco db 'ico',0 +keyX db 'x',0 +keyY db 'y',0 ;------------------------------------------------------------------------------- IMPORTS: library cnv_png,'cnv_png.obj',\ - archiver,'archiver.obj',\ - box_lib,'box_lib.obj',\ - proc_lib,'proc_lib.obj',\ - libini,'libini.obj' + archiver,'archiver.obj',\ + box_lib,'box_lib.obj',\ + proc_lib,'proc_lib.obj',\ + libini,'libini.obj' -import cnv_png,\ - cnv_png_import.Start,'START',\ - cnv_png_import.Version,'version',\ - cnv_png_import.Check,'Check_Header',\ - cnv_png_import.Assoc,'Associations' +import cnv_png,\ + cnv_png_import.Start,'START',\ + cnv_png_import.Version,'version',\ + cnv_png_import.Check,'Check_Header',\ + cnv_png_import.Assoc,'Associations' -import archiver,\ - unpack_DeflateUnpack2,'deflate_unpack2' +import archiver,\ + unpack_DeflateUnpack2,'deflate_unpack2' -import box_lib,\ - edit_box_draw,'edit_box',\ - edit_box_key,'edit_box_key',\ - edit_box_mouse,'edit_box_mouse',\ - scrollbar_h_draw,'scrollbar_h_draw',\ - scrollbar_h_mouse,'scrollbar_h_mouse' +import box_lib,\ + edit_box_draw,'edit_box',\ + edit_box_key,'edit_box_key',\ + edit_box_mouse,'edit_box_mouse',\ + scrollbar_h_draw,'scrollbar_h_draw',\ + scrollbar_h_mouse,'scrollbar_h_mouse' -import proc_lib,\ - OpenDialog_Init,'OpenDialog_init',\ - OpenDialog_Start,'OpenDialog_start' +import proc_lib,\ + OpenDialog_Init,'OpenDialog_init',\ + OpenDialog_Start,'OpenDialog_start' -import libini,\ - ini_enum_sections,'ini_enum_sections',\ - ini_enum_keys,'ini_enum_keys',\ - ini_get_str,'ini_get_str',\ - ini_set_str,'ini_set_str',\ - ini_get_color,'ini_get_color',\ - ini_get_int,'ini_get_int',\ - ini_set_int,'ini_set_int',\ - ini_del_section,'ini_del_section' +import libini,\ + ini_enum_sections,'ini_enum_sections',\ + ini_enum_keys,'ini_enum_keys',\ + ini_get_str,'ini_get_str',\ + ini_set_str,'ini_set_str',\ + ini_get_color,'ini_get_color',\ + ini_get_int,'ini_get_int',\ + ini_set_int,'ini_set_int',\ + ini_del_section,'ini_del_section' ;ini.get_str (f_name, sec_name, key_name, buffer, buf_len, def_val) @@ -1217,88 +1254,88 @@ import libini,\ ;------------------------------------------------------------------------------- ;----- RButton.inc ------------------------------------------------------------- ;------------------------------------------------------------------------------- -secRButt db 'rbmenu',0 +secRButt db 'rbmenu',0 -PredItem dd -1 +PredItem dd -1 if lang eq ru RMenuRedrawFon db 'Перерисовать',0 - RMenuAlign db 'Выровнять по сетке',0 + RMenuAlign db 'Выровнять по сетке',0 RMenuOffMoving db 'Закрепить иконки',0 - RMenuOnMoving db 'Открепить иконки',0 - RMenuAdd db 'Добавить',0 - RMenuDel db 'Удалить',0 - RMenuProp db 'Свойства',0 + RMenuOnMoving db 'Открепить иконки',0 + RMenuAdd db 'Добавить',0 + RMenuDel db 'Удалить',0 + RMenuProp db 'Свойства',0 else RMenuRedrawFon db 'Redraw',0 - RMenuAlign db 'Snap to Grid',0 + RMenuAlign db 'Snap to Grid',0 RMenuOffMoving db 'Fix the icons',0 - RMenuOnMoving db 'Unfix the icons',0 - RMenuAdd db 'Add',0 - RMenuDel db 'Delete',0 - RMenuProp db 'Properties',0 + RMenuOnMoving db 'Unfix the icons',0 + RMenuAdd db 'Add',0 + RMenuDel db 'Delete',0 + RMenuProp db 'Properties',0 end if if lang eq ru - ErrRunProg db 'Ошибка запуска программы',0 - WarningSave db 'Не забудьте сохранить изменения, запустить RDSave',0 + ErrRunProg db 'Ошибка запуска программы',0 + WarningSave db 'Не забудьте сохранить изменения, запустить RDSave',0 ErrNotFoundIni db 'Не найден icon.ini',0 - ErrName db 'Имя "rbmenu" зарезервировано',0 + ErrName db 'Имя "rbmenu" зарезервировано',0 else - ErrRunProg db 'Error runing program',0 - WarningSave db 'Do not forget to save the changes, run the RDSave',0 + ErrRunProg db 'Error runing program',0 + WarningSave db 'Do not forget to save the changes, run the RDSave',0 ErrNotFoundIni db 'icon.ini not found',0 - ErrName db 'The name "rbmenu" reserved',0 + ErrName db 'The name "rbmenu" reserved',0 end if ;------------------------------------------------------------------------------- ;------- AddDlg.inc --------------------------------------------------------------- ;------------------------------------------------------------------------------- if lang eq ru -DTitleAdd db 'Добавить иконку',0 -DTitleProp db 'Изменить иконку',0 +DTitleAdd db 'Добавить иконку',0 +DTitleProp db 'Изменить иконку',0 -DCaptName db 'Имя',0 -DCaptPath db 'Путь',0 -DCaptParams db 'Параметры',0 -DCaptIcon db 'Иконка',0 +DCaptName db 'Имя',0 +DCaptPath db 'Путь',0 +DCaptParams db 'Параметры',0 +DCaptIcon db 'Иконка',0 ;DCaptChange db '.',0 -DCaptCreate db 'Создать',0 +DCaptCreate db 'Создать',0 DCaptProperties db 'Изменить',0 -DCaptCancel db 'Отменить',0 +DCaptCancel db 'Отменить',0 else -DTitleAdd db 'Add icon',0 -DTitleProp db 'Change icon',0 +DTitleAdd db 'Add icon',0 +DTitleProp db 'Change icon',0 -DCaptName db 'Name',0 -DCaptPath db 'Path',0 -DCaptParams db 'Parameters',0 -DCaptIcon db 'Icon',0 -DCaptCreate db 'Create',0 +DCaptName db 'Name',0 +DCaptPath db 'Path',0 +DCaptParams db 'Parameters',0 +DCaptIcon db 'Icon',0 +DCaptCreate db 'Create',0 DCaptProperties db 'Change',0 -DCaptCancel db 'Cancel',0 +DCaptCancel db 'Cancel',0 end if ;/не менять положение edtName edit_box NAME_LENGTH*6+4,70+20+IMG_SIZE,6,0FFFFFFh,06F9480h,0FFh,0h,0,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,256,\ - DAreaPath,mouse_dd,0,0,0 + DAreaPath,mouse_dd,0,0,0 edtParams edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,46,0FFFFFFh,06F9480h,0FFh,0h,0,256,\ - DAreaParams,mouse_dd,0,0,0 + DAreaParams,mouse_dd,0,0,0 edtIcon edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,66,0FFFFFFh,06F9480h,0FFh,0h,0,256,\ - DAreaIcon,mouse_dd,0,0,0 + DAreaIcon,mouse_dd,0,0,0 endEdits: ;\ sbIcons: - dw END_ICONS_AREAW-ICONSX - dw ICONSX - dw 15 - dw END_ICONS_AREAH+3 - dd 0 - dd 1 + dw END_ICONS_AREAW-ICONSX + dw ICONSX + dw 15 + dw END_ICONS_AREAH+3 + dd 0 + dd 1 .max_area dd 0 .cur_area dd ICONS_DRAW_COUNTW .position dd 0 @@ -1324,115 +1361,123 @@ sbIcons: ;------------------------------------------------------------------------------- OpenDialog_data: -.type dd 0 -.procinfo dd RBProcInfo ;+4 -.com_area_name dd communication_area_name ;+8 -.com_area dd 0 ;+12 -.opendir_pach dd temp_dir_pach ;+16 -.dir_default_pach dd communication_area_default_pach ;+20 -.start_path dd open_dialog_path ;+24 -.draw_window dd DRedrawWin;draw_window_for_OD ;+28 -.status dd 0 ;+32 -.openfile_pach dd DAreaPath;fname_Info ;+36 -.filename_area dd 0;DAreaPath ;+40 -.filter_area dd Filter +.type dd 0 +.procinfo dd RBProcInfo ;+4 +.com_area_name dd communication_area_name ;+8 +.com_area dd 0 ;+12 +.opendir_pach dd temp_dir_pach ;+16 +.dir_default_pach dd communication_area_default_pach ;+20 +.start_path dd open_dialog_path ;+24 +.draw_window dd DRedrawWin;draw_window_for_OD ;+28 +.status dd 0 ;+32 +.openfile_pach dd DAreaPath;fname_Info ;+36 +.filename_area dd 0;DAreaPath ;+40 +.filter_area dd Filter .x: -.x_size dw 420 ;+48 ; Window X size -.x_start dw 100 ;+50 ; Window X position +.x_size dw 420 ;+48 ; Window X size +.x_start dw 100 ;+50 ; Window X position .y: -.y_size dw 320 ;+52 ; Window y size -.y_start dw 100 ;+54 ; Window Y position +.y_size dw 320 ;+52 ; Window y size +.y_start dw 100 ;+54 ; Window Y position communication_area_name: - db 'FFFFFFFF_open_dialog',0 + db 'FFFFFFFF_open_dialog',0 open_dialog_path: - db '/sys/File managers/opendial',0 + db '/sys/File managers/opendial',0 communication_area_default_pach: - db '/sys',0 + db '/sys',0 -Filter dd 0 +Filter dd 0 ;open_dialog db 0 ;------------------------------------------------------------------------------- ;/не разделять align 4 -IconAreaH dd ICON_SIZE,ICON_SIZE +IconAreaH dd ICON_SIZE,ICON_SIZE I_END: ;##### UDATA ################################################################### -IconArea rb 4*ICON_SIZE*ICON_SIZE +IconArea rb 4*ICON_SIZE*ICON_SIZE ;\ -sc system_colors -sc.workL rd 1 -sc.workH rd 1 +sc system_colors +sc.workL rd 1 +sc.workH rd 1 align 4 -ScreenX rw 1 -ScreenY rw 1 -MouseX rd 1 -MouseY rd 1 - -RBSlot rd 1 - -AddX rd 1 -AddY rd 1 - -SelIcon rd 1 -DlgSelIcon rd 1 -slotDlgAdd rd 1 -DlgBufImg rb IMG_SIZE*IMG_SIZE*3 +ScreenW rw 1 +ScreenH rw 1 +wsX rw 1 +wsY rw 1 +wsXe rw 1 +wsYe rw 1 +wsW rw 1 +wsH rw 1 -bufStdIco rb 40 -IconsOffs rd 100 -PIcoDB rd 1 +MouseX rd 1 +MouseY rd 1 + +RBSlot rd 1 + +AddX rd 1 +AddY rd 1 + +SelIcon rd 1 +DlgSelIcon rd 1 +slotDlgAdd rd 1 +DlgBufImg rb IMG_SIZE*IMG_SIZE*3 + + +bufStdIco rb 40 +IconsOffs rd 100 +PIcoDB rd 1 align 4 -icon_count rd 1 -strip_file rd 1 +icon_count rd 1 +strip_file rd 1 strip_file_size rd 1 cur_band_compensation rd 1 ;---- RButton ----------------------------------------------------------------------- -MinRMenuW rd 1 +MinRMenuW rd 1 -bufIni rb 40 -NumMenuButt rd 1 -RBMenuCP rd MAX_USER_BUTTONS*2 ;указатели на подпись и путь с прогой (Caption(dd), Path(dd)) и запасной (dd) для завершающего нуля -RMenuW rw 1 -RMenuH rw 1 +bufIni rb 40 +NumMenuButt rd 1 +RBMenuCP rd MAX_USER_BUTTONS*2 ;указатели на подпись и путь с прогой (Caption(dd), Path(dd)) и запасной (dd) для завершающего нуля +RMenuW rw 1 +RMenuH rw 1 -MaxPage rd 1 -mouse_dd rd 1 +MaxPage rd 1 +mouse_dd rd 1 -DAreaName rb NAME_LENGTH+1 -DAreaPath rb 256+1 -DAreaParams rb 256+1 -DAreaIcon rb 256+1 +DAreaName rb NAME_LENGTH+1 +DAreaPath rb 256+1 +DAreaParams rb 256+1 +DAreaIcon rb 256+1 align 4 -RBProcInfo rb 1024 +RBProcInfo rb 1024 align 4 ;------ OpenDialog ------------------------------- -temp_dir_pach rb 1024 -fname_Info rb 1024 +temp_dir_pach rb 1024 +fname_Info rb 1024 ;------------------------------------------------------------------------------- - rb 512 -stack_mov: ;одновременно таскать и держать открытым менюшку невозможно + rb 512 +stack_mov: ;одновременно таскать и держать открытым менюшку невозможно stack_rmenu: - rb 512 + rb 512 stack_dlg: - rb 512 + rb 512 stack_bredraw: - rb 512 + rb 512 stack_main: ;------------------------------------------------------------------------------ ENDMEM: \ No newline at end of file diff --git a/programs/system/icon_new/DlgAdd.inc b/programs/system/icon_new/DlgAdd.inc index 9e45071e1..6d995e528 100644 --- a/programs/system/icon_new/DlgAdd.inc +++ b/programs/system/icon_new/DlgAdd.inc @@ -1,210 +1,266 @@ -idbChange equ 2 -idbCreate equ 3 -idbLeft equ 4 -idbRight equ 5 -idbCancel equ 1 +idbChange equ 2 +idbCreate equ 3 +idbLeft equ 4 +idbRight equ 5 +idbCancel equ 1 DlgAdd: DlgProp: - mov eax,[SelIcon] - mov [DlgSelIcon],eax - cmp eax,-1 - jne SetProp + mov eax,[SelIcon] + mov [DlgSelIcon],eax + cmp eax,-1 + jne SetProp - m2m dword[AddX],dword[MouseX] - m2m dword[AddY],dword[MouseY] + ;----------- + mov eax,[MouseX] + mov ebx,[MouseY] - mov ecx,NAME_LENGTH - mov edi,DAreaName - xor al,al - rep stosb - mov dword[edtName.size],0 - mov dword[edtName.pos],0 + cmp ax,[wsX] + jae @f + mov ax,[wsX] + @@: - mov ecx,256 - mov edi,DAreaPath - rep stosb - mov dword[edtExePath.size],0 - mov dword[edtExePath.pos],0 + cmp bx,[wsY] + jae @f + mov bx,[wsY] + @@: ;eax,ebx - реальная координата. Все координаты в проге относительно левого верхнего угла рабочей области - mov ecx,256 - mov edi,DAreaParams - rep stosb - mov dword[edtParams.size],0 - mov dword[edtParams.pos],0 + xor edx,edx + mov dx,[wsXe] + sub edx,ICON_SIZE + cmp eax,edx + jbe @f + mov eax,edx + @@: - mov ecx,256 - mov edi,DAreaIcon - rep stosb - mov dword[edtIcon.size],0 - mov dword[edtIcon.pos],0 + mov dx,[wsYe] + sub edx,ICON_SIZE + cmp ebx,edx + jbe @f + mov ebx,edx + @@: - jmp startDlg + xor edx,edx ;преобразовываем в относительные + mov dx,[wsW] + shr edx,1 + add dx,[wsX] + cmp eax,edx + jbe @f + sub ax,[wsXe] + inc ax + jmp .dlg1 + @@: + sub ax,[wsX] + .dlg1: + + xor edx,edx + mov dx,[wsH] + shr edx,1 + add dx,[wsY] + cmp ebx,edx + jbe @f + sub bx,[wsYe] + inc bx + jmp .dlg2 + @@: + sub bx,[wsY] + .dlg2: + + mov [AddX],eax + mov [AddY],ebx + ;----------- + + mov ecx,NAME_LENGTH + mov edi,DAreaName + xor al,al + rep stosb + mov dword[edtName.size],0 + mov dword[edtName.pos],0 + + mov ecx,256 + mov edi,DAreaPath + rep stosb + mov dword[edtExePath.size],0 + mov dword[edtExePath.pos],0 + + mov ecx,256 + mov edi,DAreaParams + rep stosb + mov dword[edtParams.size],0 + mov dword[edtParams.pos],0 + + mov ecx,256 + mov edi,DAreaIcon + rep stosb + mov dword[edtIcon.size],0 + mov dword[edtIcon.pos],0 + + jmp startDlg ;-------- SetProp: - mov esi,[IconsOffs+eax*4] - mov edi,DAreaName - xor ecx,ecx + mov esi,[IconsOffs+eax*4] + mov edi,DAreaName + xor ecx,ecx @@: - lodsb - stosb - inc ecx - test al,al - jnz @b - dec ecx - mov dword[edtName.size],ecx - mov dword[edtName.pos],ecx + lodsb + stosb + inc ecx + test al,al + jnz @b + dec ecx + mov dword[edtName.size],ecx + mov dword[edtName.pos],ecx - xor ecx,ecx - mov edi,DAreaPath + xor ecx,ecx + mov edi,DAreaPath @@: - lodsb - stosb - inc ecx - test al,al - jnz @b - dec ecx - mov dword[edtExePath.size],ecx - mov dword[edtExePath.pos],ecx + lodsb + stosb + inc ecx + test al,al + jnz @b + dec ecx + mov dword[edtExePath.size],ecx + mov dword[edtExePath.pos],ecx - xor ecx,ecx - mov edi,DAreaParams + xor ecx,ecx + mov edi,DAreaParams @@: - lodsb - stosb - inc ecx - test al,al - jnz @b - dec ecx - mov dword[edtParams.size],ecx - mov dword[edtParams.pos],ecx + lodsb + stosb + inc ecx + test al,al + jnz @b + dec ecx + mov dword[edtParams.size],ecx + mov dword[edtParams.pos],ecx - xor ecx,ecx - mov edi,DAreaIcon + xor ecx,ecx + mov edi,DAreaIcon @@: - lodsb - stosb - inc ecx - test al,al - jnz @b - dec ecx - mov dword[edtIcon.size],ecx - mov dword[edtIcon.pos],ecx + lodsb + stosb + inc ecx + test al,al + jnz @b + dec ecx + mov dword[edtIcon.size],ecx + mov dword[edtIcon.pos],ecx startDlg: - mcall 9,RBProcInfo,-1 - mcall 18,21,dword[RBProcInfo+30] - mov [slotDlgAdd],eax + mcall 9,RBProcInfo,-1 + mcall 18,21,dword[RBProcInfo+30] + mov [slotDlgAdd],eax - or [edtName.flags],ed_focus + or [edtName.flags],ed_focus - mcall 40,100111b ;SetMaskMessage 100111b - xor eax,eax - mov dword[MaxPage],0 + mcall 40,100111b ;SetMaskMessage 100111b + xor eax,eax + mov dword[MaxPage],0 @@: - add eax,ICONS_DRAW_COUNTW - inc dword[MaxPage] - cmp eax,[icon_count] - jb @b - dec dword[MaxPage] - cmp dword[MaxPage],0 - jne @f - mov dword[MaxPage],1 + add eax,ICONS_DRAW_COUNTW + inc dword[MaxPage] + cmp eax,[icon_count] + jb @b + dec dword[MaxPage] + cmp dword[MaxPage],0 + jne @f + mov dword[MaxPage],1 @@: DReDraw: - mcall 48,3,sc,40 + mcall 48,3,sc,40 - mov eax,[sc.work] - rol eax,16 - add al,9 - jnc @f - mov al,0FFh + mov eax,[sc.work] + rol eax,16 + add al,9 + jnc @f + mov al,0FFh @@: - rol eax,16 - add al,9 - jnc @f - mov al,0FFh + rol eax,16 + add al,9 + jnc @f + mov al,0FFh @@: - add ah,9 - jnc @f - mov ah,0FFh + add ah,9 + jnc @f + mov ah,0FFh @@: - mov [sbIcons.bckg_col],eax - m2m [sbIcons.frnt_col],[sc.work] - m2m [sbIcons.line_col],[sc.work_graph] + mov [sbIcons.bckg_col],eax + m2m [sbIcons.frnt_col],[sc.work] + m2m [sbIcons.line_col],[sc.work_graph] - edit_boxes_set_sys_color edtName,edtExePath,sc - edit_boxes_set_sys_color edtExePath,edtParams,sc - edit_boxes_set_sys_color edtParams,edtIcon,sc - ;edit_boxes_set_sys_color edtIcon,endEdits,sc + edit_boxes_set_sys_color edtName,edtExePath,sc + edit_boxes_set_sys_color edtExePath,edtParams,sc + edit_boxes_set_sys_color edtParams,edtIcon,sc + ;edit_boxes_set_sys_color edtIcon,endEdits,sc - call DRedrawWin + call DRedrawWin DMessages: - mcall 10 ;WaitMessage + mcall 10 ;WaitMessage - dec eax - jz DReDraw - dec eax - jz DKey - dec eax - jz DButton - sub eax,3 - jz DMouse + dec eax + jz DReDraw + dec eax + jz DKey + dec eax + jz DButton + sub eax,3 + jz DMouse - jmp DMessages + jmp DMessages ;--------------------------------------------------------------------- DKey: - mcall 2 ;GetKeyPressed - cmp ah,1Bh - je DExit - cmp ah,9 ;Tab - je DNextEdit - stdcall [edit_box_key],edtName - stdcall [edit_box_key],edtExePath - stdcall [edit_box_key],edtParams - ;stdcall [edit_box_key],edtIcon + mcall 2 ;GetKeyPressed + cmp ah,1Bh + je DExit + cmp ah,9 ;Tab + je DNextEdit + stdcall [edit_box_key],edtName + stdcall [edit_box_key],edtExePath + stdcall [edit_box_key],edtParams + ;stdcall [edit_box_key],edtIcon - jmp DMessages + jmp DMessages DNextEdit: - test [edtName.flags],ed_focus - jne .DNE1 - test [edtExePath.flags],ed_focus - jne .DNE2 - test [edtParams.flags],ed_focus - jne .DNE3 - ;test [edtIcon.flags],ed_focus - ;jne .DNE4 - jmp DMessages + test [edtName.flags],ed_focus + jne .DNE1 + test [edtExePath.flags],ed_focus + jne .DNE2 + test [edtParams.flags],ed_focus + jne .DNE3 + ;test [edtIcon.flags],ed_focus + ;jne .DNE4 + jmp DMessages .DNE1: - and [edtName.flags],not ed_focus - or [edtExePath.flags],ed_focus - stdcall [edit_box_draw],edtName - stdcall [edit_box_draw],edtExePath - jmp DMessages + and [edtName.flags],not ed_focus + or [edtExePath.flags],ed_focus + stdcall [edit_box_draw],edtName + stdcall [edit_box_draw],edtExePath + jmp DMessages .DNE2: - and [edtExePath.flags],not ed_focus - or [edtParams.flags],ed_focus - stdcall [edit_box_draw],edtExePath - stdcall [edit_box_draw],edtParams - jmp DMessages + and [edtExePath.flags],not ed_focus + or [edtParams.flags],ed_focus + stdcall [edit_box_draw],edtExePath + stdcall [edit_box_draw],edtParams + jmp DMessages .DNE3: - and [edtParams.flags],not ed_focus - or [edtName.flags],ed_focus - stdcall [edit_box_draw],edtParams - stdcall [edit_box_draw],edtName - jmp DMessages + and [edtParams.flags],not ed_focus + or [edtName.flags],ed_focus + stdcall [edit_box_draw],edtParams + stdcall [edit_box_draw],edtName + jmp DMessages ;.DNE4: ; and [edtIcon.flags],not ed_focus @@ -214,258 +270,258 @@ DNextEdit: ; jmp DMessages ;--------------------------------------------------------------------- DButton: - mcall 17 ;GetButtonPressed - cmp ah, idbCancel - je DExit - cmp ah,idbChange - je DSetExePath - cmp ah,idbCreate - je DSaveIcon + mcall 17 ;GetButtonPressed + cmp ah, idbCancel + je DExit + cmp ah,idbChange + je DSetExePath + cmp ah,idbCreate + je DSaveIcon - jmp DMessages + jmp DMessages ;------------------------------------------------------------------------------- DMouse: - stdcall [edit_box_mouse],edtName - stdcall [edit_box_mouse],edtExePath - stdcall [edit_box_mouse],edtParams + stdcall [edit_box_mouse],edtName + stdcall [edit_box_mouse],edtExePath + stdcall [edit_box_mouse],edtParams ; stdcall [edit_box_mouse],edtIcon - push [sbIcons.position] - stdcall [scrollbar_h_mouse],sbIcons - pop eax - cmp eax,[sbIcons.position] - je @f - call DrawStdIcons + push [sbIcons.position] + stdcall [scrollbar_h_mouse],sbIcons + pop eax + cmp eax,[sbIcons.position] + je @f + call DrawStdIcons @@: - mcall 37,2 ;GetMouseKey - test eax,1 - jz DMessages - mcall 37,1 ;GetMouseWinPos + mcall 37,2 ;GetMouseKey + test eax,1 + jz DMessages + mcall 37,1 ;GetMouseWinPos - test eax,10001000h - jne DMessages - xor edx,edx - mov dx,ax ;y - shr eax,16 ;x + test eax,10001000h + jne DMessages + xor edx,edx + mov dx,ax ;y + shr eax,16 ;x - sub eax,ICONSX - js DMessages - sub edx,ICONSY - js DMessages + sub eax,ICONSX + js DMessages + sub edx,ICONSY + js DMessages - cmp eax,(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW - ja DMessages - cmp edx,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH - ja DMessages + cmp eax,(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW + ja DMessages + cmp edx,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH + ja DMessages - xor ebx,ebx - mov ecx,[sbIcons.position] - test ecx,ecx - jz .DM + xor ebx,ebx + mov ecx,[sbIcons.position] + test ecx,ecx + jz .DM @@: - add ebx,ICONS_DRAW_COUNTH - loop @b + add ebx,ICONS_DRAW_COUNTH + loop @b .DM: - sub eax,IMG_SIZE+SPCW - js .DM1 + sub eax,IMG_SIZE+SPCW + js .DM1 @@: - add ebx,ICONS_DRAW_COUNTH - sub eax,IMG_SIZE+SPCW - jns @b + add ebx,ICONS_DRAW_COUNTH + sub eax,IMG_SIZE+SPCW + jns @b .DM1: - sub edx,IMG_SIZE+SPCH - js .DM2 + sub edx,IMG_SIZE+SPCH + js .DM2 @@: - inc ebx - sub edx,IMG_SIZE+SPCH - jns @b + inc ebx + sub edx,IMG_SIZE+SPCH + jns @b .DM2: - mov eax,ebx + mov eax,ebx - cmp eax,[icon_count] - jae DMessages + cmp eax,[icon_count] + jae DMessages - mov bl,10 - div bl + mov bl,10 + div bl - add ah,30h - test al,al - jz @f + add ah,30h + test al,al + jz @f - add al,30h - mov byte[DAreaIcon],al - mov byte[DAreaIcon+1],ah - mov byte[DAreaIcon+2],0 - mov dword[edtIcon.size],2 - jmp .RedrawNum + add al,30h + mov byte[DAreaIcon],al + mov byte[DAreaIcon+1],ah + mov byte[DAreaIcon+2],0 + mov dword[edtIcon.size],2 + jmp .RedrawNum @@: - mov byte[DAreaIcon],ah - mov byte[DAreaIcon+1],0 - mov dword[edtIcon.size],1 - jmp .RedrawNum + mov byte[DAreaIcon],ah + mov byte[DAreaIcon+1],0 + mov dword[edtIcon.size],1 + jmp .RedrawNum .RedrawNum: ; stdcall [edit_box_draw],edtIcon - call DrawSelIcon - jmp DReDraw;DMessages; + call DrawSelIcon + jmp DReDraw;DMessages; ;------------------------------------------------------------------------------- DSetExePath: - stdcall [OpenDialog_Start],OpenDialog_data - mov edi,DAreaPath - xor al,al - or ecx,-1 - repne scasb - sub edi,DAreaPath - dec edi - mov dword[edtExePath+12*4],edi + stdcall [OpenDialog_Start],OpenDialog_data + mov edi,DAreaPath + xor al,al + or ecx,-1 + repne scasb + sub edi,DAreaPath + dec edi + mov dword[edtExePath+12*4],edi - jmp DMessages;DReDraw; + jmp DMessages;DReDraw; DSaveIcon: - mov edi,DAreaName - mov esi,secRButt + mov edi,DAreaName + mov esi,secRButt @@: lodsb - scasb - jne @f - test al,al - jnz @b + scasb + jne @f + test al,al + jnz @b - mov dword[fiRunProg+8],ErrName - mov dword[fiRunProg+21],pthNotify - mcall 70,fiRunProg + mov dword[fiRunProg+8],ErrName + mov dword[fiRunProg+21],pthNotify + mcall 70,fiRunProg - jmp DMessages + jmp DMessages @@: - mov dword[fiRunProg+8],WarningSave - mov dword[fiRunProg+21],pthNotify - mcall 70,fiRunProg + mov dword[fiRunProg+8],WarningSave + mov dword[fiRunProg+21],pthNotify + mcall 70,fiRunProg - cmp [DlgSelIcon],-1 - je @f - ;удаляем из ini старую иконку - mov ebx,[DlgSelIcon] - mov eax,[IconsOffs+ebx*4] - stdcall [ini_del_section],IconIni,eax + cmp [DlgSelIcon],-1 + je @f + ;удаляем из ini старую иконку + mov ebx,[DlgSelIcon] + mov eax,[IconsOffs+ebx*4] + stdcall [ini_del_section],IconIni,eax - stdcall EditIcon,[DlgSelIcon],DAreaIcon,DAreaName,DAreaPath,DAreaParams - jmp DExitAndSave + stdcall EditIcon,[DlgSelIcon],DAreaIcon,DAreaName,DAreaPath,DAreaParams + jmp DExitAndSave @@: - stdcall AddIcon,[AddX],[AddY],DAreaIcon,DAreaName,DAreaPath,DAreaParams - ;jmp DExitAndSave + stdcall AddIcon,[AddX],[AddY],DAreaIcon,DAreaName,DAreaPath,DAreaParams + ;jmp DExitAndSave ;------------------------------------------------------------------------------- DExitAndSave: - stdcall [ini_set_str],IconIni,DAreaName,keyPath,DAreaPath,dword[edtExePath.size] - stdcall [ini_set_str],IconIni,DAreaName,keyParams,DAreaParams,dword[edtParams.size] - stdcall [ini_set_str],IconIni,DAreaName,keyIco,DAreaIcon,dword[edtIcon.size] - stdcall [ini_set_int],IconIni,DAreaName,keyX,[MouseX] - stdcall [ini_set_int],IconIni,DAreaName,keyY,[MouseY] + stdcall [ini_set_str],IconIni,DAreaName,keyPath,DAreaPath,dword[edtExePath.size] + stdcall [ini_set_str],IconIni,DAreaName,keyParams,DAreaParams,dword[edtParams.size] + stdcall [ini_set_str],IconIni,DAreaName,keyIco,DAreaIcon,dword[edtIcon.size] + stdcall [ini_set_int],IconIni,DAreaName,keyX,[MouseX] + stdcall [ini_set_int],IconIni,DAreaName,keyY,[MouseY] DExit: - mov [DlgAddActiv],0 - mov [slotDlgAdd],0 - mcall -1 ;ExitThread + mov [DlgAddActiv],0 + mov [slotDlgAdd],0 + mcall -1 ;ExitThread ;################################################################## proc DRedrawWin - mcall 12,1 ;RedrawWinBeg - mov edx,[sc.work] - or edx,34000000h - cmp [DlgSelIcon],-1 - jne @f - mov edi,DTitleAdd - jmp .l1 + mcall 12,1 ;RedrawWinBeg + mov edx,[sc.work] + or edx,34000000h + cmp [DlgSelIcon],-1 + jne @f + mov edi,DTitleAdd + jmp .l1 @@: - mov edi,DTitleProp + mov edi,DTitleProp .l1: - mcall 0,<100,400>,<100,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH+165>,,, + mcall 0,<100,400>,<100,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH+165>,,, - stdcall [edit_box_draw],edtName - stdcall [edit_box_draw],edtExePath - stdcall [edit_box_draw],edtParams + stdcall [edit_box_draw],edtName + stdcall [edit_box_draw],edtExePath + stdcall [edit_box_draw],edtParams ; stdcall [edit_box_draw],edtIcon - call DrawStdIcons + call DrawStdIcons - stdcall [scrollbar_h_draw],sbIcons - mcall 38,,\ - ,\ - [sc.work_graph] - mcall ,,\ - ,\ - [sc.work_graph] + stdcall [scrollbar_h_draw],sbIcons + mcall 38,,\ + ,\ + [sc.work_graph] + mcall ,,\ + ,\ + [sc.work_graph] - mcall ,,\ - ,\ - [sc.work_graph] - mcall ,,\ - ,\ - [sc.work_graph] + mcall ,,\ + ,\ + [sc.work_graph] + mcall ,,\ + ,\ + [sc.work_graph] - ;BUTTONS - mcall 8,<250,49>,<30+END_ICONS_AREAH,16>,idbCreate,[sc.work_button] - mcall ,<305,54>, ,idbCancel - mcall ,<351,14>,<26,14> ,idbChange + ;BUTTONS + mcall 8,<250,49>,<30+END_ICONS_AREAH,16>,idbCreate,[sc.work_button] + mcall ,<305,54>, ,idbCancel + mcall ,<351,14>,<26,14> ,idbChange - ;CAPTIONS - mov ecx,[sc.work_text] - or ecx,80000000h - mcall 4,<30+IMG_SIZE,10>,,DCaptName - mcall ,<30+IMG_SIZE,30>,,DCaptPath - mcall ,<30+IMG_SIZE,50>,,DCaptParams - ;mcall ,<30+IMG_SIZE,70>,,DCaptIcon + ;CAPTIONS + mov ecx,[sc.work_text] + or ecx,80000000h + mcall 4,<30+IMG_SIZE,10>,,DCaptName + mcall ,<30+IMG_SIZE,30>,,DCaptPath + mcall ,<30+IMG_SIZE,50>,,DCaptParams + ;mcall ,<30+IMG_SIZE,70>,,DCaptIcon if lang eq ru - mov ecx,[sc.work_button_text] - or ecx,80000000h - mcall ,<309,35+END_ICONS_AREAH>,,DCaptCancel + mov ecx,[sc.work_button_text] + or ecx,80000000h + mcall ,<309,35+END_ICONS_AREAH>,,DCaptCancel - cmp [DlgSelIcon],-1 - jne @f - mpack ebx,255,35+END_ICONS_AREAH - mov edx,DCaptCreate - jmp .DRD1 + cmp [DlgSelIcon],-1 + jne @f + mpack ebx,255,35+END_ICONS_AREAH + mov edx,DCaptCreate + jmp .DRD1 @@: - mpack ebx,252,35+END_ICONS_AREAH - mov edx,DCaptProperties + mpack ebx,252,35+END_ICONS_AREAH + mov edx,DCaptProperties .DRD1: else - mov ecx,[sc.work_button_text] - or ecx,80000000h - mcall ,<315,35+END_ICONS_AREAH>,,DCaptCancel + mov ecx,[sc.work_button_text] + or ecx,80000000h + mcall ,<315,35+END_ICONS_AREAH>,,DCaptCancel - cmp [DlgSelIcon],-1 - jne @f - mpack ebx,257,35+END_ICONS_AREAH - mov edx,DCaptCreate - jmp .DRD1 + cmp [DlgSelIcon],-1 + jne @f + mpack ebx,257,35+END_ICONS_AREAH + mov edx,DCaptCreate + jmp .DRD1 @@: - mpack ebx,257,35+END_ICONS_AREAH - mov edx,DCaptProperties + mpack ebx,257,35+END_ICONS_AREAH + mov edx,DCaptProperties .DRD1: end if - mcall + mcall - mcall 1,351+4 ,26+10,[sc.work_button_text] - mcall ,351+4+3,26+10, - mcall ,351+4+6,26+10, + mcall 1,351+4 ,26+10,[sc.work_button_text] + mcall ,351+4+3,26+10, + mcall ,351+4+6,26+10, - call DrawSelIcon + call DrawSelIcon - mcall 12,2 ;RedrawWinEnd - ret + mcall 12,2 ;RedrawWinEnd + ret endp @@ -474,187 +530,187 @@ local IcoX:DWORD,\ IcoY:DWORD,\ iIcon:DWORD - mov ecx,[sbIcons.position] - xor eax,eax - m2m dword[iIcon],0 + mov ecx,[sbIcons.position] + xor eax,eax + m2m dword[iIcon],0 - test ecx,ecx - jz .DST1 + test ecx,ecx + jz .DST1 @@: - add [iIcon],ICONS_DRAW_COUNTH - add eax,IMG_SIZE*IMG_SIZE*4*ICONS_DRAW_COUNTH - loop @b + add [iIcon],ICONS_DRAW_COUNTH + add eax,IMG_SIZE*IMG_SIZE*4*ICONS_DRAW_COUNTH + loop @b .DST1: - lea esi,[eax+44] - add esi,[raw_pointer] + lea esi,[eax+44] + add esi,[raw_pointer] - mov [IcoX],ICONSX + mov [IcoX],ICONSX - mov ecx,ICONS_DRAW_COUNTW + mov ecx,ICONS_DRAW_COUNTW .DrawIcons: - push ecx + push ecx - mov [IcoY],ICONSY + mov [IcoY],ICONSY - mov ecx,ICONS_DRAW_COUNTH + mov ecx,ICONS_DRAW_COUNTH .DrawIcoStolb: - push ecx + push ecx - mov edi,DlgBufImg - mov edx,IMG_SIZE + mov edi,DlgBufImg + mov edx,IMG_SIZE .DrawLine: - mov ecx,IMG_SIZE + mov ecx,IMG_SIZE .DrawPix: - lodsd - test eax,0FF000000h - jnz @f - mov eax,[sc.work] + lodsd + test eax,0FF000000h + jnz @f + mov eax,[sc.work] @@: - mov [edi],ax - shr eax,16 - mov [edi+2],al - add edi,3 + mov [edi],ax + shr eax,16 + mov [edi+2],al + add edi,3 - loop .DrawPix + loop .DrawPix - dec edx - jnz .DrawLine + dec edx + jnz .DrawLine - mov edx,[IcoX] - shl edx,16 - mov dx,word[IcoY] - mcall 7,DlgBufImg, + mov edx,[IcoX] + shl edx,16 + mov dx,word[IcoY] + mcall 7,DlgBufImg, - inc [iIcon] - mov eax,[iIcon] - cmp eax,[icon_count] - jae .endDrawIcon + inc [iIcon] + mov eax,[iIcon] + cmp eax,[icon_count] + jae .endDrawIcon - add dword[IcoY],IMG_SIZE+SPCH - pop ecx - loop .DrawIcoStolb + add dword[IcoY],IMG_SIZE+SPCH + pop ecx + loop .DrawIcoStolb - add dword[IcoX],IMG_SIZE+SPCW - pop ecx - loop .DrawIcons - jmp .endProc + add dword[IcoX],IMG_SIZE+SPCW + pop ecx + loop .DrawIcons + jmp .endProc .endDrawIcon: - mov ecx,IMG_SIZE*IMG_SIZE - mov edi,DlgBufImg - mov eax,[sc.work] - mov ebx,eax - shr ebx,16 + mov ecx,IMG_SIZE*IMG_SIZE + mov edi,DlgBufImg + mov eax,[sc.work] + mov ebx,eax + shr ebx,16 @@: - mov word[edi],ax - mov [edi+2],bl - add edi,3 - loop @b + mov word[edi],ax + mov [edi+2],bl + add edi,3 + loop @b - ;затирание не использованых мест - jmp .Dalee + ;затирание не использованых мест + jmp .Dalee .DrawIcons2: - push ecx + push ecx - mov [IcoY],ICONSY - mov ecx,ICONS_DRAW_COUNTH + mov [IcoY],ICONSY + mov ecx,ICONS_DRAW_COUNTH .DrawIcoStolb2: - push ecx + push ecx - mov edx,[IcoX] - shl edx,16 - mov dx,word[IcoY] - mcall 7,DlgBufImg, + mov edx,[IcoX] + shl edx,16 + mov dx,word[IcoY] + mcall 7,DlgBufImg, .Dalee: - add dword[IcoY],IMG_SIZE+SPCH - pop ecx - loop .DrawIcoStolb2 + add dword[IcoY],IMG_SIZE+SPCH + pop ecx + loop .DrawIcoStolb2 - add dword[IcoX],IMG_SIZE+SPCW - pop ecx - loop .DrawIcons2 + add dword[IcoX],IMG_SIZE+SPCW + pop ecx + loop .DrawIcons2 .endProc: - ret + ret endp proc DrawSelIcon - mov edi,DAreaIcon - cmp byte[edi],0 - jne @f - ret + mov edi,DAreaIcon + cmp byte[edi],0 + jne @f + ret @@: - mov al,[edi] - cmp al,'9' - ja .PathToIcon - cmp al,'/' - jne .GetIconInd + mov al,[edi] + cmp al,'9' + ja .PathToIcon + cmp al,'/' + jne .GetIconInd .PathToIcon: - mov al,30h ;заглушка!!!!!!!!!!!!! - mov byte[edi+1],0 + mov al,30h ;заглушка!!!!!!!!!!!!! + mov byte[edi+1],0 .GetIconInd: ;int3 - sub al,30h - cmp byte[edi+1],0 - je @f - shl eax,1 - lea eax,[eax*4+eax] - xor edx,edx - mov dl,[edi+1] - sub dl,30h - add eax,edx - @@: ;eax=num icon - cmp eax,[icon_count] - jb @f - xor eax,eax + sub al,30h + cmp byte[edi+1],0 + je @f + shl eax,1 + lea eax,[eax*4+eax] + xor edx,edx + mov dl,[edi+1] + sub dl,30h + add eax,edx + @@: ;eax=num icon + cmp eax,[icon_count] + jb @f + xor eax,eax @@: - test eax,eax - je .DI1 - mov ecx,eax - xor eax,eax + test eax,eax + je .DI1 + mov ecx,eax + xor eax,eax @@: - add eax,IMG_SIZE*IMG_SIZE*4 - loop @b + add eax,IMG_SIZE*IMG_SIZE*4 + loop @b .DI1: - mov esi,eax - add esi,[raw_pointer] - add esi,44 + mov esi,eax + add esi,[raw_pointer] + add esi,44 - mov edi,DlgBufImg - mov edx,IMG_SIZE + mov edi,DlgBufImg + mov edx,IMG_SIZE .DrawLine: - mov ecx,IMG_SIZE + mov ecx,IMG_SIZE .DrawPix: - lodsd - test eax,0FF000000h - jnz @f - mov eax,[sc.work] + lodsd + test eax,0FF000000h + jnz @f + mov eax,[sc.work] @@: - mov word[edi],ax - shr eax,16 - mov [edi+2],al - add edi,3 + mov word[edi],ax + shr eax,16 + mov [edi+2],al + add edi,3 - loop .DrawPix + loop .DrawPix - dec edx - jnz .DrawLine + dec edx + jnz .DrawLine - mcall 7,DlgBufImg,,<15,15> + mcall 7,DlgBufImg,,<15,15> - ret + ret endp \ No newline at end of file diff --git a/programs/system/icon_new/RButton.inc b/programs/system/icon_new/RButton.inc index 48067fc3c..318f901ef 100644 --- a/programs/system/icon_new/RButton.inc +++ b/programs/system/icon_new/RButton.inc @@ -1,11 +1,4 @@ -;idbRRedrawFon equ 100 -;idbRAlign equ 101 -;idbRFixIcons equ 102 -;idbRAdd equ 103 -;idbRDel equ 104 -;idbRProp equ 105 - DELTA_COLOR equ 70 COLOR_SEL_BUT equ 00F7092Dh MAX_USER_BUTTONS equ 30 @@ -13,520 +6,520 @@ MAX_USER_BUTTONS equ 30 ;---- thread for rbutton ----------------------------------------------------------------------- RButtonWin: if lang eq ru - mov [MinRMenuW],18*6+10 + mov [MinRMenuW],18*6+10 else - mov [MinRMenuW],15*6+10 + mov [MinRMenuW],15*6+10 end if - mcall 40,100101b ;SetMaskMessage 100101b - mcall 48,3,sc,40 + mcall 40,100101b ;SetMaskMessage 100101b + mcall 48,3,sc,40 - mov eax,[sc.work] ;вычисляем цвет светлее фонового - rol eax,16 - add al,DELTA_COLOR - jnc @f - mov al,0FFh + mov eax,[sc.work] ;вычисляем цвет светлее фонового + rol eax,16 + add al,DELTA_COLOR + jnc @f + mov al,0FFh @@: - rol eax,16 - add al,DELTA_COLOR - jnc @f - mov al,0FFh + rol eax,16 + add al,DELTA_COLOR + jnc @f + mov al,0FFh @@: - add ah,DELTA_COLOR - jnc @f - mov ah,0FFh + add ah,DELTA_COLOR + jnc @f + mov ah,0FFh @@: - mov [sc.workH],eax + mov [sc.workH],eax - mov eax,[sc.work] ;вычисляем цвет темнее фонового - rol eax,16 - sub al,DELTA_COLOR - jnc @f - mov al,0FFh + mov eax,[sc.work] ;вычисляем цвет темнее фонового + rol eax,16 + sub al,DELTA_COLOR + jnc @f + mov al,0FFh @@: - rol eax,16 - sub al,DELTA_COLOR - jnc @f - mov al,0FFh + rol eax,16 + sub al,DELTA_COLOR + jnc @f + mov al,0FFh @@: - sub ah,DELTA_COLOR - jnc @f - mov ah,0FFh + sub ah,DELTA_COLOR + jnc @f + mov ah,0FFh @@: - mov [sc.workL],eax + mov [sc.workL],eax - stdcall GetNumIcon,[MouseX],[MouseY],-1 - mov [SelIcon],eax + stdcall GetNumIcon,[MouseX],[MouseY],-1 + mov [SelIcon],eax - ;выставляем первоначальные значения - m2m [RMenuW],[MinRMenuW] + ;выставляем первоначальные значения + m2m [RMenuW],[MinRMenuW] - cmp [SelIcon],-1 - jne .RBW1 + cmp [SelIcon],-1 + jne .RBW1 ;----------- если клик не по иконке ------------------------------------------------ - mov [NumMenuButt],0 + mov [NumMenuButt],0 - mcall 70,fiIni - mcall 68,12,dword[bufIni+32] ;выделяем память для подписей и путей запуска - mov [RBMenuCP],eax ;GetUserBut берёт отсюда первоначальный указатель на память - stdcall [ini_enum_keys],IconIni,secRButt,GetUserBut + mcall 70,fiIni + mcall 68,12,dword[bufIni+32] ;выделяем память для подписей и путей запуска + mov [RBMenuCP],eax ;GetUserBut берёт отсюда первоначальный указатель на память + stdcall [ini_enum_keys],IconIni,secRButt,GetUserBut - mov ebx,[NumMenuButt] - add [NumMenuButt],4 + mov ebx,[NumMenuButt] + add [NumMenuButt],4 - mov [RBMenuCP+ebx*8],RMenuRedrawFon - mov [RBMenuCP+ebx*8+8],RMenuAlign - cmp [bFixIcons],1 - je @f - mov [RBMenuCP+ebx*8+16],RMenuOffMoving - jmp .RBW11 + mov [RBMenuCP+ebx*8],RMenuRedrawFon + mov [RBMenuCP+ebx*8+8],RMenuAlign + cmp [bFixIcons],1 + je @f + mov [RBMenuCP+ebx*8+16],RMenuOffMoving + jmp .RBW11 @@: - mov [RBMenuCP+ebx*8+16],RMenuOnMoving + mov [RBMenuCP+ebx*8+16],RMenuOnMoving .RBW11: - mov [RBMenuCP+ebx*8+24],RMenuAdd + mov [RBMenuCP+ebx*8+24],RMenuAdd - mov [RBMenuCP+ebx*8+4],0 - mov [RBMenuCP+ebx*8+8+4],0 - mov [RBMenuCP+ebx*8+16+4],0 - mov [RBMenuCP+ebx*8+24+4],0 + mov [RBMenuCP+ebx*8+4],0 + mov [RBMenuCP+ebx*8+8+4],0 + mov [RBMenuCP+ebx*8+16+4],0 + mov [RBMenuCP+ebx*8+24+4],0 - jmp .RBW2 + jmp .RBW2 ;----------- если клик по иконке ------------------------------------------------ .RBW1: - xor ebx,ebx - mov [NumMenuButt],5 + xor ebx,ebx + mov [NumMenuButt],5 - mov [RBMenuCP+ebx*8],RMenuRedrawFon - mov [RBMenuCP+ebx*8+8],RMenuAlign - cmp [bFixIcons],1 - je @f - mov [RBMenuCP+ebx*8+16],RMenuOffMoving - jmp .RBW21 + mov [RBMenuCP+ebx*8],RMenuRedrawFon + mov [RBMenuCP+ebx*8+8],RMenuAlign + cmp [bFixIcons],1 + je @f + mov [RBMenuCP+ebx*8+16],RMenuOffMoving + jmp .RBW21 @@: - mov [RBMenuCP+ebx*8+16],RMenuOnMoving + mov [RBMenuCP+ebx*8+16],RMenuOnMoving .RBW21: - mov [RBMenuCP+ebx*8+24],RMenuDel - mov [RBMenuCP+ebx*8+32],RMenuProp + mov [RBMenuCP+ebx*8+24],RMenuDel + mov [RBMenuCP+ebx*8+32],RMenuProp - mov [RBMenuCP+ebx*8+4],0 - mov [RBMenuCP+ebx*8+8+4],0 - mov [RBMenuCP+ebx*8+16+4],0 - mov [RBMenuCP+ebx*8+24+4],0 - mov [RBMenuCP+ebx*8+32+4],0 + mov [RBMenuCP+ebx*8+4],0 + mov [RBMenuCP+ebx*8+8+4],0 + mov [RBMenuCP+ebx*8+16+4],0 + mov [RBMenuCP+ebx*8+24+4],0 + mov [RBMenuCP+ebx*8+32+4],0 ;------------------------------------------------------------------------------- .RBW2: - cmp [SelIcon],-1 - jne @f - mov eax,[NumMenuButt] - shl eax,4 - mov [RMenuH],ax - jmp .rbw1 + cmp [SelIcon],-1 + jne @f + mov eax,[NumMenuButt] + shl eax,4 + mov [RMenuH],ax + jmp .rbw1 @@: - mov [RMenuH],16*5 + mov [RMenuH],16*5 .rbw1: - add [RMenuW],3 ;на рамку - add [RMenuH],3 ;на рамку + add [RMenuW],3 ;на рамку + add [RMenuH],3 ;на рамку RBWRedraw: - mcall 12,1 ;RedrawWinBeg - mov ebx,[MouseX] - shl ebx,16 - mov bx,[RMenuW] + mcall 12,1 ;RedrawWinBeg + mov ebx,[MouseX] + shl ebx,16 + mov bx,[RMenuW] - mov ecx,[MouseY] - shl ecx,16 - mov cx,[RMenuH] + mov ecx,[MouseY] + shl ecx,16 + mov cx,[RMenuH] - mov edx,01000000h - mov esi,01000000h - xor eax,eax - int 40h + mov edx,01000000h + mov esi,01000000h + xor eax,eax + int 40h - and ebx,0FFFFh ;фоновый прямоугольник - inc bx - and ecx,0FFFFh - inc cx - mcall 13,,,[sc.work] + and ebx,0FFFFh ;фоновый прямоугольник + inc bx + and ecx,0FFFFh + inc cx + mcall 13,,,[sc.work] ;----------- определяем и рисуем кнопки - mov ecx,[NumMenuButt] + mov ecx,[NumMenuButt] .DrawUB: - push ecx + push ecx - mov eax,[NumMenuButt] - sub eax,ecx - mov edx,eax ;button ID = от 0 до NumMenuButt - or edx,60000000h - shl eax,4+16 ;*16*10000h - mov ecx,eax - mov cx,16 + mov eax,[NumMenuButt] + sub eax,ecx + mov edx,eax ;button ID = от 0 до NumMenuButt + or edx,60000000h + shl eax,4+16 ;*16*10000h + mov ecx,eax + mov cx,16 - xor ebx,ebx - mov bx,[RMenuW] - mov esi,[sc.work] - mcall 8 ;определили + xor ebx,ebx + mov bx,[RMenuW] + mov esi,[sc.work] + mcall 8 ;определили - mov ebx,70000h - shr ecx,16 - mov bx,cx - add bx,7 + mov ebx,70000h + shr ecx,16 + mov bx,cx + add bx,7 - mov ecx,[sc.work_text] - or ecx,80000000h + mov ecx,[sc.work_text] + or ecx,80000000h - mov eax,[NumMenuButt] - sub eax,[esp] - mov edx,[RBMenuCP+eax*8] - mcall 4 + mov eax,[NumMenuButt] + sub eax,[esp] + mov edx,[RBMenuCP+eax*8] + mcall 4 - pop ecx - loop .DrawUB + pop ecx + loop .DrawUB ;--------------- ; обрамляющий прямоугольник - xor ebx,ebx ;верх - mov bx,[RMenuW] - xor ecx,ecx - mcall 38,,,[sc.workL] + xor ebx,ebx ;верх + mov bx,[RMenuW] + xor ecx,ecx + mcall 38,,,[sc.workL] - mov bx,[RMenuW] ;право - shl ebx,16 - mov bx,[RMenuW] - xor ecx,ecx - mov cx,[RMenuH] - mcall + mov bx,[RMenuW] ;право + shl ebx,16 + mov bx,[RMenuW] + xor ecx,ecx + mov cx,[RMenuH] + mcall - xor ebx,ebx ;низ - mov bx,[RMenuW] - mov cx,[RMenuH] - shl ecx,16 - mov cx,[RMenuH] - mcall + xor ebx,ebx ;низ + mov bx,[RMenuW] + mov cx,[RMenuH] + shl ecx,16 + mov cx,[RMenuH] + mcall - xor ebx,ebx ;лево - xor ecx,ecx - mov cx,[RMenuH] - mcall + xor ebx,ebx ;лево + xor ecx,ecx + mov cx,[RMenuH] + mcall ; светлый левый верхний угол - xor ebx,ebx - mov bx,[RMenuW] - add ebx,1*10000h-1 - mov ecx,00010001h - mcall ,,,[sc.workH] + xor ebx,ebx + mov bx,[RMenuW] + add ebx,1*10000h-1 + mov ecx,00010001h + mcall ,,,[sc.workH] - mov ebx,00010001h - xor ecx,ecx - mov cx,[RMenuH] - add ecx,1*10000h-1 - mcall + mov ebx,00010001h + xor ecx,ecx + mov cx,[RMenuH] + add ecx,1*10000h-1 + mcall ;конец рисования - mcall 12,2 ;RedrawWinEnd + mcall 12,2 ;RedrawWinEnd ;------------------------------------------------------------------- - mcall 9,RBProcInfo,-1 ;GetThreadInfo RBProcInfo,-1 - mcall 18,21,dword[RBProcInfo+30] - m2m dword[RBSlot],eax + mcall 9,RBProcInfo,-1 ;GetThreadInfo RBProcInfo,-1 + mcall 18,21,dword[RBProcInfo+30] + m2m dword[RBSlot],eax RBWMessages: - mcall 10 ;WaitMessage - dec eax - jz RBWRedraw - sub eax,2 - jz RBWButton - sub eax,3 - jz RBWMouse - jmp RBWMessages + mcall 10 ;WaitMessage + dec eax + jz RBWRedraw + sub eax,2 + jz RBWButton + sub eax,3 + jz RBWMouse + jmp RBWMessages RBWButton: - mcall 17 ;GetButtonPressed - shr eax,8 + mcall 17 ;GetButtonPressed + shr eax,8 - mov ebx,eax - mov eax,[RBMenuCP+ebx*8+4] ;если сдесь 0, то клик по стандартной кнопке(которая не в ini) - test eax,eax - jnz .RBWB - mov eax,[RBMenuCP+ebx*8] ;смотрим, указатель на какую надпись в подписи - cmp eax,RMenuRedrawFon ; и по ней выбираем действие - jz RBRedrawFon - cmp eax,RMenuAlign - jz RBAlign - cmp eax,RMenuOffMoving - jz RBFixIcons - cmp eax,RMenuOnMoving - jz RBFixIcons - cmp eax,RMenuAdd - jz RBAdd - cmp eax,RMenuDel - jz RBDelete - cmp eax,RMenuProp - jz RBPropeties + mov ebx,eax + mov eax,[RBMenuCP+ebx*8+4] ;если сдесь 0, то клик по стандартной кнопке(которая не в ini) + test eax,eax + jnz .RBWB + mov eax,[RBMenuCP+ebx*8] ;смотрим, указатель на какую надпись в подписи + cmp eax,RMenuRedrawFon ; и по ней выбираем действие + jz RBRedrawFon + cmp eax,RMenuAlign + jz RBAlign + cmp eax,RMenuOffMoving + jz RBFixIcons + cmp eax,RMenuOnMoving + jz RBFixIcons + cmp eax,RMenuAdd + jz RBAdd + cmp eax,RMenuDel + jz RBDelete + cmp eax,RMenuProp + jz RBPropeties - jmp RBWExit + jmp RBWExit .RBWB: - mov dword[fiRunProg+8],0 - mov dword[fiRunProg+21],eax - mcall 70,fiRunProg + mov dword[fiRunProg+8],0 + mov dword[fiRunProg+21],eax + mcall 70,fiRunProg - jmp RBWExit + jmp RBWExit RBWMouse: - call MouseInWin - jnc .RBWMnoInWin ;если вне окна, то просто восстанавливаем предыдущую кнопку + call MouseInWin + jnc .RBWMnoInWin ;если вне окна, то просто восстанавливаем предыдущую кнопку - mcall 37,1 ;положение мыши относительно окна - and eax,0FFF0h ;нужен только Y, причём округлённый до верхней точки кратной 16(высота кнопки) - cmp [PredItem],eax - je .RBWMendLightBut + mcall 37,1 ;положение мыши относительно окна + and eax,0FFF0h ;нужен только Y, причём округлённый до верхней точки кратной 16(высота кнопки) + cmp [PredItem],eax + je .RBWMendLightBut - shr eax,4 ;если мышь на нижней рамке, то также только восстановить предыдущую кнопку - cmp eax,[NumMenuButt] - jae .RBWMnoInWin + shr eax,4 ;если мышь на нижней рамке, то также только восстановить предыдущую кнопку + cmp eax,[NumMenuButt] + jae .RBWMnoInWin - cmp [PredItem],-1 ;восстановление предыдущей кнопки - je @f + cmp [PredItem],-1 ;восстановление предыдущей кнопки + je @f - stdcall DrawRBLine,[PredItem],0 + stdcall DrawRBLine,[PredItem],0 @@: - call MouseInWin - jnc @f - mcall 37,1 ;положение мыши относительно окна - and eax,0FFF0h ;нужен только Y, причём округлённый до верхней точки кратной 16(высота кнопки) - mov [PredItem],eax - stdcall DrawRBLine,eax,1 + call MouseInWin + jnc @f + mcall 37,1 ;положение мыши относительно окна + and eax,0FFF0h ;нужен только Y, причём округлённый до верхней точки кратной 16(высота кнопки) + mov [PredItem],eax + stdcall DrawRBLine,eax,1 @@: - jmp .RBWMendLightBut + jmp .RBWMendLightBut .RBWMnoInWin: - cmp [PredItem],-1 ;восстановление предыдущей кнопки - je .RBWMendLightBut + cmp [PredItem],-1 ;восстановление предыдущей кнопки + je .RBWMendLightBut - stdcall DrawRBLine,[PredItem],0 - mov [PredItem],-1 + stdcall DrawRBLine,[PredItem],0 + mov [PredItem],-1 .RBWMendLightBut: - mcall 37,2 ;GetMouseKey - test eax,111b - jz RBWMessages + mcall 37,2 ;GetMouseKey + test eax,111b + jz RBWMessages - call MouseInWin - jc RBWMessages + call MouseInWin + jc RBWMessages RBWExit: - cmp [SelIcon],-1 - jne @f - mcall 68,13,[RBMenuCP] ;освобождаем память с подписями и путями к прогам + cmp [SelIcon],-1 + jne @f + mcall 68,13,[RBMenuCP] ;освобождаем память с подписями и путями к прогам @@: - mov [RButtonActiv],0 - mcall -1 ;ExitProcess + mov [RButtonActiv],0 + mcall -1 ;ExitProcess RBRedrawFon: - mcall 15,3 - jmp RBWExit + mcall 15,3 + jmp RBWExit RBAlign: - call AlignIcons + call AlignIcons - m2m [PIcoDB],[BegData] - stdcall [ini_enum_sections],IconIni,Ini_SavePos + m2m [PIcoDB],[BegData] + stdcall [ini_enum_sections],IconIni,Ini_SavePos - mov dword[fiRunProg+8],WarningSave - mov dword[fiRunProg+21],pthNotify - mcall 70,fiRunProg - mov [bNotSave],0 + mov dword[fiRunProg+8],WarningSave + mov dword[fiRunProg+21],pthNotify + mcall 70,fiRunProg + mov [bNotSave],0 - jmp RBRedrawFon + jmp RBRedrawFon RBFixIcons: - xor dword[bFixIcons],1 + xor dword[bFixIcons],1 - cmp [bNotSave],0 - je @f + cmp [bNotSave],0 + je @f - mov dword[fiRunProg+8],WarningSave - mov dword[fiRunProg+21],pthNotify - mcall 70,fiRunProg - mov [bNotSave],0 + mov dword[fiRunProg+8],WarningSave + mov dword[fiRunProg+21],pthNotify + mcall 70,fiRunProg + mov [bNotSave],0 @@: - jmp RBWExit + jmp RBWExit RBAdd: - cmp [DlgAddActiv],1 - je RBWSetActivWin - mov [DlgAddActiv],1 + cmp [DlgAddActiv],1 + je RBWSetActivWin + mov [DlgAddActiv],1 - mcall 51,1,DlgAdd,stack_dlg ;CreateThread DlgAdd,stack_dlg - jmp RBWExit + mcall 51,1,DlgAdd,stack_dlg ;CreateThread DlgAdd,stack_dlg + jmp RBWExit RBDelete: - mov eax,[SelIcon] - mov eax,[IconsOffs+eax*4] - stdcall [ini_del_section],IconIni,eax + mov eax,[SelIcon] + mov eax,[IconsOffs+eax*4] + stdcall [ini_del_section],IconIni,eax - stdcall DelIcon,[SelIcon] + stdcall DelIcon,[SelIcon] - mov dword[fiRunProg+8],WarningSave - mov dword[fiRunProg+21],pthNotify - mcall 70,fiRunProg - mov [bNotSave],0 + mov dword[fiRunProg+8],WarningSave + mov dword[fiRunProg+21],pthNotify + mcall 70,fiRunProg + mov [bNotSave],0 - jmp RBRedrawFon + jmp RBRedrawFon RBPropeties: - cmp [DlgAddActiv],1 - je RBWSetActivWin - mov [DlgAddActiv],1 + cmp [DlgAddActiv],1 + je RBWSetActivWin + mov [DlgAddActiv],1 - mcall 51,1,DlgProp,stack_dlg ;CreateThread DlgProp,stack_dlg - jmp RBWExit + mcall 51,1,DlgProp,stack_dlg ;CreateThread DlgProp,stack_dlg + jmp RBWExit RBWSetActivWin: - mcall 18,3,[slotDlgAdd] - jmp RBWExit + mcall 18,3,[slotDlgAdd] + jmp RBWExit proc DrawRBLine y,active - xor ebx,ebx - mov bx,[RMenuW] - add ebx,2*10000h-3 - mov ecx,[y] - add ecx,2 - shl ecx,16 - mov cx,16;-1-2 - cmp [active],1 - jne @f - mov edx,[sc.work_button] - jmp .L1 + xor ebx,ebx + mov bx,[RMenuW] + add ebx,2*10000h-3 + mov ecx,[y] + add ecx,2 + shl ecx,16 + mov cx,16;-1-2 + cmp [active],1 + jne @f + mov edx,[sc.work_button] + jmp .L1 @@: - mov edx,[sc.work] + mov edx,[sc.work] .L1: - mcall 13 + mcall 13 ;---------------------------------------------- - xor ebx,ebx ;верх - mov bx,[RMenuW] - add ebx,2*10000h-3 - mov cx,word[y] - shl ecx,16 - mov cx,word[y] - add ecx,00020002h + xor ebx,ebx ;верх + mov bx,[RMenuW] + add ebx,2*10000h-3 + mov cx,word[y] + shl ecx,16 + mov cx,word[y] + add ecx,00020002h - cmp [active],1 - jne @f - mov edx,[sc.workL] - jmp .L3 + cmp [active],1 + jne @f + mov edx,[sc.workL] + jmp .L3 @@: - mov edx,[sc.work] + mov edx,[sc.work] .L3: - mcall 38 + mcall 38 - mov ebx,00020002h ;лево - mov cx,word[y] - shl ecx,16 - mov cx,word[y] - add ecx,00020002h+16 + mov ebx,00020002h ;лево + mov cx,word[y] + shl ecx,16 + mov cx,word[y] + add ecx,00020002h+16 - cmp [active],1 - jne @f - mov edx,[sc.workL] + cmp [active],1 + jne @f + mov edx,[sc.workL] @@: - mcall + mcall - xor ebx,ebx ;низ - mov bx,[RMenuW] - add ebx,2*10000h-3 - mov cx,word[y] - shl ecx,16 - mov cx,word[y] - add ecx,16*10000h+16+00020002h + xor ebx,ebx ;низ + mov bx,[RMenuW] + add ebx,2*10000h-3 + mov cx,word[y] + shl ecx,16 + mov cx,word[y] + add ecx,16*10000h+16+00020002h - cmp [active],1 - jne @f - mov edx,[sc.workH] + cmp [active],1 + jne @f + mov edx,[sc.workH] @@: - mcall + mcall - mov bx,[RMenuW] ;право - shl ebx,16 - mov bx,[RMenuW] - add ebx,-2*10000h-2 - mov cx,word[y] - shl ecx,16 - mov cx,word[y] - add ecx,00020002h+16 + mov bx,[RMenuW] ;право + shl ebx,16 + mov bx,[RMenuW] + add ebx,-2*10000h-2 + mov cx,word[y] + shl ecx,16 + mov cx,word[y] + add ecx,00020002h+16 - cmp [active],1 - jne @f - mov edx,[sc.workH] + cmp [active],1 + jne @f + mov edx,[sc.workH] @@: - mcall + mcall - mov eax,[y] - shr eax,4 - mov edx,[RBMenuCP+eax*8] + mov eax,[y] + shr eax,4 + mov edx,[RBMenuCP+eax*8] - xor ebx,ebx - mov ebx,[y] - add ebx,7*10000h+7 + xor ebx,ebx + mov ebx,[y] + add ebx,7*10000h+7 - cmp [active],1 - jne @f - mov ecx,[sc.work_button_text] - jmp .L2 + cmp [active],1 + jne @f + mov ecx,[sc.work_button_text] + jmp .L2 @@: - mov ecx,[sc.work_text] + mov ecx,[sc.work_text] .L2: - or ecx,80000000h + or ecx,80000000h - mcall 4 + mcall 4 - ret + ret endp proc MouseInWin ;Carry flag = 1, если клик в окне - mcall 37,0 ;GetMousePos - xor ebx,ebx - mov bx,ax ;y - shr eax,16 ;x + mcall 37,0 ;GetMousePos + xor ebx,ebx + mov bx,ax ;y + shr eax,16 ;x - xor ecx,ecx - mov cx,bx - mov bx,ax + xor ecx,ecx + mov cx,bx + mov bx,ax - mcall 34 - cmp eax,[RBSlot] - jne @f - stc - ret + mcall 34 + cmp eax,[RBSlot] + jne @f + stc + ret @@: - clc - ret + clc + ret endp @@ -536,238 +529,240 @@ local posX:WORD,\ negatX:WORD,\ negatY:WORD - xor ebx,ebx + xor ebx,ebx - mov ecx,[MaxNumIcon] - test ecx,ecx - jnz .AlignIco - ret + mov ecx,[MaxNumIcon] + test ecx,ecx + jnz .AlignIco + ret .AlignIco: - push ecx - or ecx,-1 - mov edi,dword[IconsOffs+ebx] - xor eax,eax - repne scasb - repne scasb - repne scasb - repne scasb + push ecx + or ecx,-1 + mov edi,dword[IconsOffs+ebx] + xor eax,eax + repne scasb + repne scasb + repne scasb + repne scasb - mov dword[negatX],0 + mov dword[negatX],0 ;-------- преобразуем координаты в положительные - mov ax,[edi+2] - test ax,8000h - jz @f - neg ax - mov word[negatX],1 + mov ax,[edi+2] + test ax,8000h + jz @f + neg ax + mov word[negatX],1 @@: - mov [posX],ax + mov [posX],ax - mov ax,[edi] - test ax,8000h - jz @f - neg ax - mov word[negatY],1 + mov ax,[edi] + test ax,8000h + jz @f + neg ax + mov word[negatY],1 @@: - mov [posY],ax + mov [posY],ax ;----- - mov ax,[posY] - mov dx,ALIGN_SIZE + mov ax,[posY] + mov dx,ALIGN_SIZE - cmp ax,dx - jb .AI0 - @@: sub ax,dx - cmp ax,dx - jae @b + cmp ax,dx + jb .AI0 + @@: sub ax,dx + cmp ax,dx + jae @b .AI0: - mov dx,ax - cmp dx,ALIGN_SIZE/2 - jb .AI1 + mov dx,ax + cmp dx,ALIGN_SIZE/2 + jb .AI1 - mov ax,ALIGN_SIZE - sub ax,dx - add [posY],ax + mov ax,ALIGN_SIZE + sub ax,dx + add [posY],ax - jmp .AI2 + jmp .AI2 .AI1: - sub [posY],dx + sub [posY],dx .AI2: ;----- - mov ax,[posX] - mov dx,ALIGN_SIZE + mov ax,[posX] + mov dx,ALIGN_SIZE - cmp ax,dx - jb .AI3 - @@: sub ax,dx - cmp ax,dx - jae @b + cmp ax,dx + jb .AI3 + @@: sub ax,dx + cmp ax,dx + jae @b .AI3: - mov dx,ax - cmp dx,ALIGN_SIZE/2 - jb .AI4 + mov dx,ax + cmp dx,ALIGN_SIZE/2 + jb .AI4 - mov ax,ALIGN_SIZE - sub ax,dx - add [posX],ax + mov ax,ALIGN_SIZE + sub ax,dx + add [posX],ax - jmp .AI5 + jmp .AI5 .AI4: - sub [posX],dx + sub [posX],dx .AI5: ;----- преобразование назад и поправка в отрицательных координат - mov ax,[posX] + mov ax,[posX] - cmp [negatX],1 - jne @f - neg ax - inc ax - jmp .AI6 + cmp [negatX],1 + jne @f + neg ax + inc ax + jmp .AI6 @@: - mov dx,[ScreenX] - shr dx,1 - cmp ax,dx - jbe .AI6 - sub ax,[ScreenX] + mov dx,[wsW] + shr dx,1 + add dx,[wsX] + cmp ax,dx + jbe .AI6 + sub ax,[wsW] .AI6: - mov word[edi+2],ax + mov word[edi+2],ax - mov ax,[posY] - cmp [negatY],1 - jne @f - neg ax - inc ax - jmp .AI7 + mov ax,[posY] + cmp [negatY],1 + jne @f + neg ax + inc ax + jmp .AI7 @@: - mov dx,[ScreenY] - shr dx,1 - cmp ax,dx - jbe .AI7 - sub ax,[ScreenY] + mov dx,[wsH] + shr dx,1 + add dx,[wsY] + cmp ax,dx + jbe .AI7 + sub ax,[wsH] .AI7: - mov word[edi],ax + mov word[edi],ax ;-------- - pop ecx - add ebx,4 - dec ecx - jnz .AlignIco + pop ecx + add ebx,4 + dec ecx + jnz .AlignIco ; loop .AlignIco ; mov dword[fInfo],2 ; mcall 70,fInfo - ret + ret endp ;------------------------------------------------------------------------------- proc GetUserBut stdcall,f_name,sec_name,key_name,key_value - cmp [NumMenuButt],MAX_USER_BUTTONS - jne @f - ret + cmp [NumMenuButt],MAX_USER_BUTTONS + jne @f + ret @@: - push ebx esi edi + push ebx esi edi - mov edi,[key_name] ;определяем ширину меню - xor eax,eax - or ecx,-1 - repne scasb - sub edi,[key_name] - mov eax,edi - shl eax,1 - lea eax,[eax*2+eax+5*2] - cmp ax,[RMenuW] - jbe @f - mov [RMenuW],ax + mov edi,[key_name] ;определяем ширину меню + xor eax,eax + or ecx,-1 + repne scasb + sub edi,[key_name] + mov eax,edi + shl eax,1 + lea eax,[eax*2+eax+5*2] + cmp ax,[RMenuW] + jbe @f + mov [RMenuW],ax @@: - mov ebx,[NumMenuButt] + mov ebx,[NumMenuButt] - mov esi,[key_name] - mov edi,[RBMenuCP+ebx*8] + mov esi,[key_name] + mov edi,[RBMenuCP+ebx*8] @@: lodsb - stosb - test al,al - jnz @b + stosb + test al,al + jnz @b - mov [RBMenuCP+ebx*8+4],edi - mov esi,[key_value] + mov [RBMenuCP+ebx*8+4],edi + mov esi,[key_value] @@: lodsb - stosb - test al,al - jnz @b + stosb + test al,al + jnz @b - mov [RBMenuCP+ebx*8+8],edi + mov [RBMenuCP+ebx*8+8],edi - inc [NumMenuButt] + inc [NumMenuButt] - pop edi esi ebx - mov eax,1 - ret + pop edi esi ebx + mov eax,1 + ret endp proc Ini_SavePos stdcall,f_name,sec_name - push ebx edi esi + push ebx edi esi - xor ebx,ebx + xor ebx,ebx .SearchSect: - mov edi,[IconsOffs+ebx*4] - mov esi,[sec_name] + mov edi,[IconsOffs+ebx*4] + mov esi,[sec_name] @@: - lodsb - scasb - jne @f - test al,al - jnz @b + lodsb + scasb + jne @f + test al,al + jnz @b - jmp .IcoDataFound + jmp .IcoDataFound @@: - inc ebx - cmp ebx,[MaxNumIcon] - jb .SearchSect + inc ebx + cmp ebx,[MaxNumIcon] + jb .SearchSect - mov eax,1 - pop esi edi ebx - ret + mov eax,1 + pop esi edi ebx + ret .IcoDataFound: - or ecx,-1 - repne scasb - repne scasb - repne scasb + or ecx,-1 + repne scasb + repne scasb + repne scasb ;int3 - movzx eax,word[edi+2] - test eax,8000h - jz @f - or eax,0FFFF0000h + movzx eax,word[edi+2] + test eax,8000h + jz @f + or eax,0FFFF0000h @@: - stdcall [ini_set_int],[f_name],[sec_name],keyX,eax + stdcall [ini_set_int],[f_name],[sec_name],keyX,eax - movzx eax,word[edi] - test eax,8000h - jz @f - or eax,0FFFF0000h + movzx eax,word[edi] + test eax,8000h + jz @f + or eax,0FFFF0000h @@: - stdcall [ini_set_int],[f_name],[sec_name],keyY,eax + stdcall [ini_set_int],[f_name],[sec_name],keyY,eax - mov eax,1 - pop esi edi ebx - ret + mov eax,1 + pop esi edi ebx + ret endp diff --git a/programs/system/icon_new/bgredraw.inc b/programs/system/icon_new/bgredraw.inc index 3bbf0b161..34c855a08 100644 --- a/programs/system/icon_new/bgredraw.inc +++ b/programs/system/icon_new/bgredraw.inc @@ -1,38 +1,50 @@ BGRedrawThread: - mcall 40,010000b + mcall 40,010000b BGRTRedrawIcons: - mcall 48,5 - mov dx,ax - shr eax,16 - sub dx,ax - mov [ScreenX],dx - mov ax,bx - shr ebx,16 - sub ax,bx - mov [ScreenY],ax + mcall 48,5 - mov ecx,[MaxNumIcon] - test ecx,ecx - jz .NoDraw - xor ebx,ebx - @@: push ecx - cmp [IconNoDraw],ebx - je .nd - stdcall DrawIcon,ebx,0 + mov [wsXe],ax + mov [wsYe],bx + + mov dx,ax + shr eax,16 + mov [wsX],ax + sub dx,ax + mov [wsW],dx + + mov ax,bx + shr ebx,16 + mov [wsY],bx + sub ax,bx + mov [wsH],ax + + mcall 14 + mov [ScreenH],ax + shr eax,16 + mov [ScreenW],ax + + mov ecx,[MaxNumIcon] + test ecx,ecx + jz .NoDraw + xor ebx,ebx + @@: push ecx + cmp [IconNoDraw],ebx + je .nd + stdcall DrawIcon,ebx,0 .nd: - inc ebx - pop ecx - loop @b + inc ebx + pop ecx + loop @b .NoDraw: BGRTmessages: - mcall 10 - sub eax,5 - jz BGRTRedrawIcons + mcall 10 + sub eax,5 + jz BGRTRedrawIcons - jmp BGRTmessages + jmp BGRTmessages