Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1684 → Rev 1685

/programs/develop/libraries/box_lib/trunk/box_lib.mac
189,7 → 189,7
mov ecx,((end-start)/ch_struc_size)
@@:
push ebp ;㪠§ â¥«ì ­  ¯¥à¢ë© checkbox
call [init_checkbox2] ;¬ ªà®á ¯à®¢¥àª¨ ¬ë誨 ­ ¤ checkbox'®¬
call [init_checkbox] ;¬ ªà®á ¯à®¢¥àª¨ ¬ë誨 ­ ¤ checkbox'®¬
add ebp,ch_struc_size
loop @b
}
201,7 → 201,7
mov ecx,((end-start)/ch_struc_size)
@@:
push ebp ;㪠§ â¥«ì ­  ¯¥à¢ë© checkbox
call [check_box_mouse2] ;­ à¨á®¢ âì checkbox
call [check_box_mouse] ;­ à¨á®¢ âì checkbox
add ebp,ch_struc_size
loop @b
}
213,7 → 213,7
mov ecx,((end-start)/ch_struc_size)
@@:
push ebp ;㪠§ â¥«ì ­  ¯¥à¢ë© checkbox
call [check_box_draw2] ;­ à¨á®¢ âì checkbox
call [check_box_draw] ;­ à¨á®¢ âì checkbox
add ebp,ch_struc_size
loop @b
}
225,9 → 225,10
mov esi,color_table
@@:
push dword [esi+32] ;梥â ⥪áâ  ¢ à ¡®ç¥© ®¡« á⨠®ª­ 
pop dword ch_text_color
or dword [esp],0x80000000 ;­¥®¡å®¤¨¬® ¤«ï ¢ë¢®¤  ASCIIZ áâப
pop dword 2ch_text_color
push dword [esi+36] ;梥⠣à ä¨ª¨ ¢ ®ª­¥ (à §¤¥«¨â¥«ì­ë¥ «¨­¨¨ ¨ â.¯.)
pop dword ch_border_color
pop dword 2ch_border_color
add ebp,ch_struc_size
loop @b
}
/programs/develop/libraries/box_lib/trunk/doc/checkbox/info_checkbox.htm
8,6 → 8,16
<p><a href="../box_lib.htm">Íà ãëàâíóþ &uarr;</a></p>
<h1>Îãëàâëåíèå</h1>
<p><a href="#vveden">Ââåäåíèå</a></p>
<p><a href="#version2">Version 2</a></p>
<p><a href="#funct2">Ôóíêöèè 2</a></p>
<ul>
<li><a href="#fun_init2">init_checkbox2</a></li>
<li><a href="#fun_draw2">check_box_draw2</a></li>
<li><a href="#fun_mouse2">check_box_mouse2</a></li>
<li><a href="#version_ch2">version_ch2</a></li>
</ul>
<br>
<p><a href="#version1">Version 1</a></p>
<p><a href="#funct">Ôóíêöèè</a></p>
<ul>
<li><a href="#fun_draw">check_box_draw</a></li>
18,8 → 28,63
<p><a href="#checkbox_styles">Ñòèëè ýëåìåíòà</a></p>
 
<h1><a name="vveden">Ââåäåíèå</a></h1>
<p>Ôëàæîê, èñïîëüçóåòñÿ ïðè ââîäå ëîãè÷åñêîé èíôîðìàöèè.</p>
<p>Checkbox ïðåäíàçíà÷åí äëÿ óñòàíîâêè, ñíÿòèÿ ôëàãà àêòèâíîñòè ïðîöåññà. ×àñòî
èñïîëüçóåòñÿ äëÿ âêëþ÷åíèÿ / âûêëþ÷åíèÿ òåõ èëè èíûõ ôóíêöèé.</p>
<h1><a name="version2">Checkbox version 2</a></h1>
<p>Version 2 áûëà ðàçðàáîòàíà â 2010 ãîäó è ÿâëÿåòñÿ ïåðåðàáîòàííîé è îïòèìèçèðîâàííîé âåðñèåé. Îñíîâíûå îòëè÷èÿ îò âåðñèè 1:</p>
<ul>
<li>Ïîääåðæêà ASCIIZ ñòðîê.</li>
<li>Ïîÿâèëñÿ êîä èíèöèàëèçàöèè áîêñà, ÷òî óìåíüøàåò çàäåðæêè ïðè îáðàáîòêè ñîáûòèé ìûøêè.</li>
<li>Îïòèìèçèðîâàííà ñòðóêòóðà êîìïîíåíòà, ïðè íåèçìåííîì ðàçìåðå.</li>
<li>Íàïèñàíû ìàêðîñû, êîòîðûå ïîçâîëÿþò ðàáîòàòü ñ ãðóïïàìè checkbox.</li>
</ul>
 
 
<h1><a name="funct2">Ôóíêöèè2</a></h1>
 
<h2><a name="fun_init2">init_checkbox2</a></h2>
<p>Ýòà ôóíêöèÿ äîëæíà âûçûâàòñÿ ïðè èíèöèàëèçàöèè ïðèëîæåíèÿ, ôàêòè÷åñêè îíà ñ÷èòàåò êîëëè÷åñòâî ñèìâîëîâ â ñòîêå äëÿ âûâîäà. Åñëè íå íóæíî âûâîäèòü ïîäïèñè ê checkbox, òî åå ìîæíî íå âûçûâàòü.</p>
 
<h2><a name="fun_draw2">check_box_draw2</a></h2>
<p>Ýòà ôóíêöèÿ äîëæíà âûçûâàòñÿ ïðè ââîäå èíôîðìàöèè ñ êëàâèàòóðû.</p>
 
<h2><a name="fun_mouse2">check_box_mouse2</a></h2>
<p>Ýòà ôóíêöèÿ äîëæíà âûçûâàòñÿ ïðè ââîäå èíôîðìàöèè ñ ìûøè.</p>
 
<h2><a name="version_ch2">version_ch2</a></h2>
<p>Âåðñèÿ ýëåìåíòà</p>
 
<h1><a name="struc_checkbox2">Ñòðóêòóðà checkbox2</a></h1>
<pre>struc check_box2 left_s,top_s,ch_text_margin,color,border_color,text_color,text,flags
{ ;ñòðóêòóðà ïàðàìåòðîâ äëÿ ÷åê áîêñà
.left_s: dd left_s ;+0 ïîëîæåíèå ïî õ dw + ðàçìåð dw
.top_s: dd top_s ;+4 ïîëîæåíèå ïî ó dw + ðàçìåð dw
.ch_text_margin: dd ch_text_margin ;ðàññòîÿíèå îò ïðÿìîóãîëüíèêà ÷åê áîêñà äî íàäïèñè
.color: dd color ;öâåò âíóòðè ÷åêáîêñà
.border_color: dd border_color ;öâåò ðàìêè
.text_color: dd text_color ;öâåò íàäïèñè äîëæåí áûòü â ôîðìàòå öâåò or 0x80000000, ýòî äëÿ îòîáðàæåíèÿ ASCIIZ ñòðîê.
.text: dd text ;àäðåñ â êîäå ïðîãðàììû ãäå ðàñïîëîæåí òåêñò
.flags: dd flags+0 ;ôëàãè
.size_of_str: dd 0x0 ;äëèííà ñòðîêè, âû÷èñëÿåòñÿ ïðè èíèöèàëèçàöèè êîìïîíåíòà
}
</pre>
<p><b>left_s</b> - îòñòóï ñëåâà + äëèííà â ôîðìàòå (ïîëîæåíèå ïî x * 65536 +äëèííà ïî õ).</p>
<p><b>top</b> - îòñòóï ñâåðõó + äëèííà ïî y (ïîëîæåíèå ïî y* 65536 +äëèííà ïî y).</p>
<p><b>ch_text_margin</b> - ðàññòîÿíèå îò ïðÿìîóãîëüíèêà ÷åê áîêñà äî íàäïèñè.</p>
<p><b>color</b> - öâåò âíóòðè ÷åêáîêñà.</p>
 
<h1><a name="checkbox_styles">Ñòèëè ýëåìåíòà</a></h1>
 
<pre>
ch_flag_en = 10b ;ôëàã óñòàíîâëåííîãî ÷åê áîêñà.
ch_flag_top = 0x0 ;ôëàã ðàñïîëîæåíèÿ òåêñòà ââåðõó ò.å. 3-é áèò
ch_flag_middle = 100b ;ôëàã ðàñïîëîæåíèÿ òåêñòà â öåíòðå ò.å. 4-é áèò.
ch_flag_bottom = 1000b ;ôëàã ðàñïîëîæåíèÿ òåêñòà â íèçó ò.å. ïî óìîë÷àíèþ ïðèíèìàåòñÿ çíà÷åíèå âíèçó ò.å. îòñóñòâèå 3-ãî è 4-ãî áèòà
</pre>
 
 
<h1><a name="version1">Checkbox version 1</a></h1>
<p>Version 1 áûëà ðàçðàáîòàíà â 2007-2009 ãîäàõ.</p>
<h1><a name="funct">Ôóíêöèè</a></h1>
 
<h2><a name="fun_draw">check_box_draw</a></h2>
/programs/media/scrshoot/scrshoot.asm
12,6 → 12,7
; 24.07.2008 <Lrz> ®¡­®¢«¥­ editbox
; 01.02.07 - ®¡­®¢«ñ­ editbox
; 31.01.07 - ¢áñ ⥯¥àì à¨áã¥âáï ®â­®á¨â¥«ì­® ª«¨¥­â᪮© ®¡« áâ¨
; 02.11.10 - ˆá¯®«ì§ã¥âáï checkbox ¢¥àᨨ 2
 
title equ 'Screenshooter v 1.0' ; ‡ £®«®¢®ª ®ª­ 
include '../../develop/libraries/box_lib/load_lib.mac'
140,6 → 141,8
 
; ãáâ ­ ¢«¨¢ ¥¬ ¬ áªã ᮡë⨩
set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse+evm_ipc)
;¨­¨æ¨ «¨§ æ¨ï checkboxes
init_checkboxes2 check_boxes,check_boxes_end
 
; á ¯à룠¥¬ ¯à¨ ª ¦¤®© ¯¥à¥à¨á®¢ª¥
red:
149,7 → 152,8
; ãáâ ­ ¢«¨¢ ¥¬ á¨á⥬­ë¥ æ¢¥â  ã GUI ª®¬¯®­¥­â®¢
txt_but_set_sys_color buttons,buttons_end,sc ; \
labels_set_sys_color labels,labels_end,sc ; |
check_boxes_set_sys_color check_boxes,check_boxes_end,sc ; |
check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc; |
; check_boxes_set_sys_color check_boxes,check_boxes_end,sc ; |
edit_boxes_set_sys_color editboxes,editboxes_end,sc ; /
 
get_screen_prop scr ; ¯®«ãç ¥¬ ¨­ä®à¬ æ¨î ®¡ íªà ­¥
202,20 → 206,21
push dword edit4
call [edit_box_mouse]
;----------------------------------
push dword ch1
call [check_box_mouse]
push dword ch2
call [check_box_mouse]
push dword ch3
call [check_box_mouse]
push dword ch4
call [check_box_mouse]
push dword ch5
call [check_box_mouse]
push dword ch6
call [check_box_mouse]
push dword use_rect
call [check_box_mouse]
checkboxes_mouse2 check_boxes,check_boxes_end
; push dword ch1
; call [check_box_mouse]
; push dword ch2
; call [check_box_mouse]
; push dword ch3
; call [check_box_mouse]
; push dword ch4
; call [check_box_mouse]
; push dword ch5
; call [check_box_mouse]
; push dword ch6
; call [check_box_mouse]
; push dword use_rect
; call [check_box_mouse]
;-----------------------------------
; mouse_check_boxes check_boxes,check_boxes_end
; mouse_edit_boxes editboxes,editboxes_end
331,20 → 336,23
draw_txt_buttons buttons,buttons_end ; ª­®¯ª¨
; draw_check_boxes check_boxes,check_boxes_end ; ä« ¦ª¨
;------ check all checkbox ---------
push dword ch1
call [check_box_draw]
push dword ch2
call [check_box_draw]
push dword ch3
call [check_box_draw]
push dword ch4
call [check_box_draw]
push dword ch5
call [check_box_draw]
push dword ch6
call [check_box_draw]
push dword use_rect
call [check_box_draw]
; push dword ch1
; call [check_box_draw]
; push dword ch2
; call [check_box_draw]
; push dword ch3
; call [check_box_draw]
; push dword ch4
; call [check_box_draw]
; push dword ch5
; call [check_box_draw]
; push dword ch6
; call [check_box_draw]
; push dword use_rect
; call [check_box_draw]
 
checkboxes_draw2 check_boxes,check_boxes_end
 
;------ end check all checkbox ------
 
stop_draw_window ; ª®­¥æ ¯¥à¥à¨á®¢ª¨
740,13 → 748,13
buttons_end:
;---------------------------------------------------------------------
check_boxes:
ch1 check_box 5,105,5,11,cl_white,0,0,ch_text.1,(ch_text.2-ch_text.1),ch_flag_en ; ᢥà­ãâì ®ª­®
ch2 check_box 5,120,5,11,cl_white,0,0,ch_text.2,(ch_text.3-ch_text.2),ch_flag_en ; § â¥¬ ᤥ« âì  ªâ¨¢­ë¬
ch3 check_box 145,105,5,11,cl_white,0,0,ch_text.3,(ch_text.4-ch_text.3),ch_flag_en ; ¯®ª § âì á­¨¬®ª
ch4 check_box 5,135,5,11,cl_white,0,0,ch_text.4,(ch_text.5-ch_text.4),ch_flag_en ; § ¤¥à¦ª 
ch5 check_box 5,150,5,11,cl_white,0,0,ch_text.5,(ch_text.6-ch_text.5),ch_flag_en
ch6 check_box 5,165,5,11,cl_white,0,0,ch_text.6,(ch_text.7-ch_text.6),ch_flag_en
use_rect check_box 145,150,5,11,cl_white,0,0,ch_text.7,(ch_text.8-ch_text.7) ; ¨á¯. ®¡« áâì
ch1 check_box2 (5 shl 16+11),(105 shl 16 +11),5,cl_white,0,0x80000000,ch_text.1,ch_flag_en+ch_flag_bottom ; ᢥà­ãâì ®ª­®
ch2 check_box2 (5 shl 16+11),(120 shl 16 +11),5,cl_white,0,0x80000000,ch_text.2,ch_flag_en+ch_flag_bottom ; § â¥¬ ᤥ« âì  ªâ¨¢­ë¬
ch3 check_box2 (1455 shl 16+11),(105 shl 16 +11),5,cl_white,0,0x80000000,ch_text.3,ch_flag_en+ch_flag_bottom ; ¯®ª § âì á­¨¬®ª
ch4 check_box2 (5 shl 16+11),(135 shl 16 +11),5,cl_white,0,0x80000000,ch_text.4,ch_flag_en+ch_flag_bottom ; § ¤¥à¦ª 
ch5 check_box2 (5 shl 16+11),(150 shl 16 +11),5,cl_white,0,0x80000000,ch_text.5,ch_flag_en+ch_flag_bottom
ch6 check_box2 (5 shl 16+11),(165 shl 16 +11),5,cl_white,0,0x80000000,ch_text.6,ch_flag_en+ch_flag_bottom
use_rect check_box2 (145 shl 16+11),(150 shl 16 +11),5,cl_white,0,0x80000000,ch_text.7,ch_flag_bottom ; ¨á¯. ®¡« áâì
;  ¢â®­ã¬¥à æ¨ï
check_boxes_end:
;---------------------------------------------------------------------
773,14 → 781,13
.7 db '§ ¤ âì',0
 
ch_text:
.1 db '‘¢¥à­ãâì ®ª­®';,0
.2 db '®ª § âì á­¨¬®ª';,0
.3 db '§ â¥¬ ᤥ« âì  ªâ¨¢­ë¬';,0
.4 db '‡ ¤¥à¦ª :';,0
.5 db '€¢â®á®åà ­¥­¨¥';,0
.6 db '€¢â®­ã¬¥à æ¨ï, ­ ç¨­ ï á';,0
.7 db 'Ž¡« áâì'
.8:
.1 db '‘¢¥à­ãâì ®ª­®',0
.2 db '®ª § âì á­¨¬®ª',0
.3 db '§ â¥¬ ᤥ« âì  ªâ¨¢­ë¬',0
.4 db '‡ ¤¥à¦ª :',0
.5 db '€¢â®á®åà ­¥­¨¥',0
.6 db '€¢â®­ã¬¥à æ¨ï, ­ ç¨­ ï á',0
.7 db 'Ž¡« áâì',0
 
no_shoot db '‘­¨¬®ª ­¥ ᤥ« ­',0
shooting db '”®â®£à ä¨à®¢ ­¨¥...',0
820,14 → 827,13
.7 db 'Set',0
 
ch_text:
.1 db 'Minimize window';,0
.2 db 'Show photo';,0
.3 db 'then make active';,0
.4 db 'Delay:';,0
.5 db 'Autosave';,0
.6 db 'Start numeration from';,0
.7 db 'Area'
.8:
.1 db 'Minimize window',0
.2 db 'Show photo',0
.3 db 'then make active',0
.4 db 'Delay:',0
.5 db 'Autosave',0
.6 db 'Start numeration from',0
.7 db 'Area',0
 
no_shoot db 'There is no photo',0
shooting db 'Photographing...',0
/programs/media/scrshoot/scrshoot.mac
86,18 → 86,18
mcall
}
 
macro check_boxes_set_sys_color start,end,color_table
{
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] ;ôëàãè
;macro check_boxes_set_sys_color start,end,color_table
;{
;ch_left equ [edi] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî õ
;ch_top equ [edi+4] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî ó
;ch_text_margin equ [edi+8] ;=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] ;ôëàãè
 
 
;ch_left equ [edi] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî õ
109,17 → 109,17
;ch_text_length equ [edi+20] ;äëèíà íàäïèñè (2^64 òàêîé äëèíû ìîæåò áûòü òåêñò)
;ch_flags equ [edi+24] ;ôëàãè
 
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
}
; 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
;}
macro get_key
{
;mov eax,2
/programs/media/scrshoot/srectwin.inc
258,10 → 258,16
edit_box_mouse dd aEdit_box_mouse
;version_ed dd aVersion_ed
 
 
init_checkbox dd aInit_checkbox
check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse
;version_ch dd aVersion_ch
 
;check_box_draw dd aCheck_box_draw
;check_box_mouse dd aCheck_box_mouse
;version_ch dd aVersion_ch
 
option_box_draw dd aOption_box_draw
option_box_mouse dd aOption_box_mouse
;version_op dd aVersion_op
300,8 → 306,14
aEdit_box_mouse db 'edit_box_mouse',0
;aVersion_ed db 'version_ed',0
 
aCheck_box_draw db 'check_box_draw',0
aCheck_box_mouse db 'check_box_mouse',0
 
aInit_checkbox db 'init_checkbox2',0
aCheck_box_draw db 'check_box_draw2',0
aCheck_box_mouse db 'check_box_mouse2',0
;aVersion_ch db 'version_ch2',0
 
;aCheck_box_draw db 'check_box_draw',0
;aCheck_box_mouse db 'check_box_mouse',0
;aVersion_ch db 'version_ch',0
 
aOption_box_draw db 'option_box_draw',0