From abbc09c677f42176df6ccf8e5772361cbc9f44c9 Mon Sep 17 00:00:00 2001 From: "Alexey Teplov (" Date: Sun, 3 Oct 2010 17:24:53 +0000 Subject: [PATCH] bugfix. git-svn-id: svn://kolibrios.org@1640 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../libraries/box_lib/trunk/box_lib.mac | 57 ++++++++--------- .../libraries/box_lib/trunk/checkbox.mac | 61 ++++++++++--------- 2 files changed, 60 insertions(+), 58 deletions(-) diff --git a/programs/develop/libraries/box_lib/trunk/box_lib.mac b/programs/develop/libraries/box_lib/trunk/box_lib.mac index baf1448ce6..e56ef4a711 100644 --- a/programs/develop/libraries/box_lib/trunk/box_lib.mac +++ b/programs/develop/libraries/box_lib/trunk/box_lib.mac @@ -103,48 +103,49 @@ macro edit_boxes_set_sys_color start,end,color_table } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Basic macros for use CheckBox ; -;Last change 25.09.2010 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -ch_struc_size=36 ;à §¬¥à áâàãªâãàë -ch_flag_en=10b ;ä« £ ãáâ ­®¢«¥­­®£® 祪 ¡®ªá . +ch_struc_size=36 +ch_flag_en=10b ;í«¥¬¥­â ¢ë¡à ­ -ch_left equ [ebp] ;ª®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® å -ch_top equ [ebp+2] ;ª®®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® ã -ch_text_margin equ [ebp+4] ;=4 à ááâ®ï­¨¥ ®â ¯àאַ㣮«ì­¨ª  祪 ¡®ªá  ¤® ­ ¤¯¨á¨ -ch_size equ [ebp+8] ;12 à §¬¥à ª¢ ¤à â  祪 ¡®ªá  -ch_color equ [ebp+12] ;梥⠢­ãâਠcheckbox -ch_border_color equ [ebp+16] ; or [edi+4] ;梥â à ¬ª¨ checkbox ¥¥ ¬®¦­® § ¤ âì á ¬®áâ®ï⥫쭮 -ch_text_color equ [ebp+20] ;[edi+4] ;梥â ⥪áâ  -ch_text_ptr equ [ebp+24] ;㪠§ â¥«ì ­  ­ ç «® ⥪á⮢®© áâப¨ -ch_text_length equ [ebp+28] ;¤«¨­­  áâப¨ -ch_flags equ [ebp+32] ;ä« £¨ +ch_left equ [edi] ;ª®®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® å +ch_top equ [edi+2] ;ª®®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® ã +ch_text_margin equ [edi+4] ;=4 à ááâ®ï­¨¥ ®â ¯àאַ㣮«ì­¨ª  祪 ¡®ªá  ¤® ­ ¤¯¨á¨ +ch_size equ [edi+8] ;12 à §¬¥à ª¢ ¤à â  祪 ¡®ªá  +ch_color equ [edi+12] ;梥⠢­ãâਠcheckbox +ch_border_color equ [edi+16] ; or [edi+4] ;梥â à ¬ª¨ checkbox ¥¥ ¬®¦­® § ¤ âì á ¬®áâ®ï⥫쭮 +ch_text_color equ [edi+20] ;[edi+4] ;梥â ⥪áâ  +ch_text_ptr equ [edi+24] ;㪠§ â¥«ì ­  ­ ç «® ⥪á⮢®© áâப¨ +ch_text_length equ [edi+28] +ch_flags equ [edi+32] ;ä« £¨ struc check_box left,top,ch_text_margin,ch_size,color,border_color,text_color,text,ch_text_length,flags -{ ;áâàãªâãà  ¯ à ¬¥â஢ ¤«ï 祪 ¡®ªá  -.left: dw left ;+0 ¯®«®¦¥­¨¥ ¯® å -.top: dw top ;+2 ¯®«®¦¥­¨¥ ¯® ã +{ ;áâàãªâãà  ¯ à ¬¥â஢ ¤«ï 祪 ¡®ªá  +.left: dw left ;+0 ¯®«®¦¥­¨¥ ¯® å +.top: dw top ;+2 ¯®«®¦¥­¨¥ ¯® ã .ch_text_margin: dd ch_text_margin ;à ááâ®ï­¨¥ ®â ¯àאַ㣮«ì­¨ª  祪 ¡®ªá  ¤® ­ ¤¯¨á¨ -.ch_size: dd ch_size ;à §¬¥à ª¢ ¤à â  祪 ¡®ªá , ¤«ï ¯à¨¬¥à  12 -.color: dd color ;梥⠢­ãâਠ祪¡®ªá  +.ch_size: dd ch_size ;à §¬¥à ª¢ ¤à â  祪 ¡®ªá , ¤«ï ¯à¨¬¥à  12 +.color: dd color ;梥⠢­ãâਠ祪¡®ªá  .border_color: dd border_color ;梥â à ¬ª¨ .text_color: dd text_color ;梥⠭ ¤¯¨á¨ .text: dd text ; ¤à¥á ¢ ª®¤¥ ¯à®£à ¬¬ë £¤¥ à á¯®«®¦¥­ ⥪áâ .ch_text_length: dd ch_text_length ;¤«¨­­  áâப¨ á ᨬ¢®« ¬¨ -.flags: dd flags+0 ; ä« £¨ +.flags: dd flags+0 ; ä« £¨ } macro check_boxes_set_sys_color start,end,color_table { - mov edi,start - mov ecx,((end-start)/ch_struc_size) - mov esi,color_table + mov edi,start + mov ecx,((end-start)/ch_struc_size) + mov esi,color_table @@: - push dword [esi+32] ;梥â ⥪áâ  ¢ à ¡®ç¥© ®¡« á⨠®ª­  - pop dword ch_text_color - push dword [esi+36] ;梥⠣à ä¨ª¨ ¢ ®ª­¥ (à §¤¥«¨â¥«ì­ë¥ «¨­¨¨ ¨ â.¯.) - pop dword ch_border_color - add edi,ch_struc_size - loop @b +; push dword [esi+20] ;梥â à ¡®ç¥© ®¡« á⨠®ª­  +; pop dword ch_color + push dword [esi+32] ;梥â ⥪áâ  ¢ à ¡®ç¥© ®¡« á⨠®ª­  + pop dword ch_text_color + push dword [esi+36] ;梥⠣à ä¨ª¨ ¢ ®ª­¥ (à §¤¥«¨â¥«ì­ë¥ «¨­¨¨ ¨ â.¯.) + pop dword ch_border_color + add edi,ch_struc_size + loop @b } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/programs/develop/libraries/box_lib/trunk/checkbox.mac b/programs/develop/libraries/box_lib/trunk/checkbox.mac index b535d1fe50..19424bccb5 100644 --- a/programs/develop/libraries/box_lib/trunk/checkbox.mac +++ b/programs/develop/libraries/box_lib/trunk/checkbox.mac @@ -6,44 +6,45 @@ macro use_checkbox_draw { check_box_draw: pusha ;ñîõðàíèì âñå ðåãèñòðû - mov edi,dword [esp+36] - mov eax,13 - movzx ebx,word ch_left - shl ebx,16 - add ebx,ch_size - mov ecx,ch_top - shl ecx,16 - add ecx,dword ch_size - mov edx,dword ch_border_color - mcall ;ðèñóåì ðàìêó + mov edi,dword [esp+36] + mov eax,13 + movzx ebx,word ch_left + shl ebx,16 + add ebx,ch_size + mov ecx,ch_top + shl ecx,16 + add ecx,dword ch_size + mov edx,dword ch_border_color + mcall ;ðèñóåì ðàìêó - mov edx,dword ch_color - add ebx,1 shl 16 - 2 - add ecx,1 shl 16 - 2 - mcall ;çàêðàøèâàåì âíóòðåííîñòè ÷åêáîêñà + mov edx,dword ch_color + add ebx,1 shl 16 - 2 + add ecx,1 shl 16 - 2 + mcall ;çàêðàøèâàåì âíóòðåííîñòè ÷åêáîêñà test dword ch_flags,2 ;äîñòàòü çíà÷åíèå áèòà èç ïåðåìåííîé è ïîìåñòèòü â ôëàã CF jz @f ;â åñëè CF=1, òî âûïîëíèì ñëåäóþùóþ ïðîöåäóðó èíà÷å ïåðåéòè íà íèæíþþ @@ - call check_box_draw_ch ;íàðèñîâàòü âêëþ÷åííûé ÷åê áîêñ + call check_box_draw_ch ;íàðèñîâàòü âêëþ÷åííûé ÷åê áîêñ @@: ;---------------------------- ;ðàñ÷åò êóäà áóäåò ïðîèçâåäåí âûâîä òåêñòà ;---------------------------- - movzx ebx,word ch_left ;çàãðóçèòü çíà÷åíèå õ äëÿ ÷åê áîêñà - add ebx,dword ch_size - add ebx,dword ch_text_margin ;äîáàâèòü ðàçìåð ñòîðîíû è ðàññòîÿíèå íà êîòîðîì íà÷íåòñÿ âûâîä òåêñòà - shl ebx,16 ;ñäâèíåì íà 16 ðàçðÿäîâ â ëåâî (óìíîæèì íà 65536) - mov bx,word ch_top ;çàãðóçèì çíà÷åíèå ïî y - add ebx,ch_size - mov ecx,dword ch_text_color ;çàãðóçèì öâåò íàäïèñè + flags - sub ebx,7 ;äîáàâèì çíà÷åíèå äëèíû ñòîðîíû -9+2 + movzx ebx,word ch_left ;çàãðóçèòü çíà÷åíèå õ äëÿ ÷åê áîêñà + add ebx,dword ch_size + add ebx,dword ch_text_margin;äîáàâèòü ðàçìåð ñòîðîíû è ðàññòîÿíèå íà êîòîðîì íà÷íåòñÿ âûâîä òåêñòà + shl ebx,16 ;ñäâèíåì íà 16 ðàçðÿäîâ â ëåâî (óìíîæèì íà 65536) + mov bx,word ch_top ;çàãðóçèì çíà÷åíèå ïî y + add ebx,ch_size + mov ecx,dword ch_text_color ;çàãðóçèì öâåò íàäïèñè + flags + sub ebx,7 ;äîáàâèì çíà÷åíèå äëèíû ñòîðîíû -9+2 - mov edx,dword ch_text_ptr ;óêàæåì àäðåñ îò êóäà íóæíî âûâîäèòü ñòðîêó - mov esi,dword ch_text_length - mov eax,4 ;âíåñåì â eax çíà÷åíèå âûâîäà íàäïèñè íà êàíâó - mcall ;Âûâîä - popa ;âîññòàíîâèòü çíà÷åíèÿ ðåãèñòðîâ èç ñòåêà - ret 4 ;âûéäåì èç ïðîöåäóðû + mov edx,dword ch_text_ptr ;óêàæåì àäðåñ îò êóäà íóæíî âûâîäèòü ñòðîêó + mov esi,dword ch_text_length + ;âíåñåì â eax çíà÷åíèå âûâîäà íàäïèñè íà êàíâó + mov eax,4 + mcall ;Âûâîä +popa ;âîññòàíîâèòü çíà÷åíèÿ ðåãèñòðîâ èç ñòåêà +ret 4 ;âûéäåì èç ïðîöåäóðû check_box_clear_ch: ;î÷èñòêà ÷åê áîêñà mov edx,dword ch_color ;öâåò âíóòðè ÷åê áîêñà @@ -53,7 +54,7 @@ check_box_draw_ch: ; @@: movzx ebx,word ch_left ;çàãðóçèòü êîîðäèíàòó ïî õ mov eax,dword ch_size - mov di,ax + mov bp,ax shr eax,2 push ax