kolibrios-gitea/programs/develop/kol_f_edit/ced_constr.inc
IgorA 88d9c9e6b1 1) small update 'init_checkbox2' in 'box_lib.obj'
2) update 'kol_f_edit' now can create element 'checkbox2'

git-svn-id: svn://kolibrios.org@1720 a494cfbc-eb01-0410-851d-a64ba20cac60
2010-12-18 10:13:51 +00:00

385 lines
10 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;
; ¢ í⮬ ä ©«¥ ᮡ࠭ë ä㭪樨 à¨áãî騥 ®ª­® ª®­áâàãªâ®à 
;
macro move_to_skin coord_x,coord_y
{
add coord_x,SKIN_W1
add coord_y,SKIN_H
}
;¯¥à¥à¨á®¢ª  ®ª­  ª®­áâàãªâ®à 
align 4
draw_constructor:
stdcall [buf2d_clear], buf_fon,0xffffff
pushad
cmp [err_ini1],1
jne @f
stdcall [buf2d_draw_text], buf_fon, buf_font,txtErrIni1,10,10,\
0xff0000 ;à¨á㥬 áâபã á ⥪á⮬
stdcall [buf2d_draw_text], buf_fon, buf_font,fp_obj_opt,10,20,\
0xff0000 ;à¨á㥬 áâபã á ⥪á⮬
jmp .end_draw
@@:
mov edx,C_WND
stdcall find_obj_in_file,edx ;eax - 㪠§ â¥«ì ­  áâàãªâãàã ®ª­ 
cmp eax,0
je .end_draw
mov dword[obj_m_win],eax
;4-width
stdcall get_obj_text_col,[obj_m_win],4 ;edx = offset
stdcall conv_str_to_int,edx
mov ecx,eax ;ecx=width
;5-height
stdcall get_obj_text_col,[obj_m_win],5 ;edx = offset
stdcall conv_str_to_int,edx
;eax=height
stdcall [buf2d_rect_by_size], buf_fon, 0,0,ecx,eax, dword[sc.frame] ;à¨á㥬 ¢­¥è­îî à ¬ªã ®ª­ 
sub eax,2
sub ecx,2
stdcall [buf2d_filled_rect_by_size], buf_fon, 1,1,ecx,eax, dword[sc.grab] ;à¨á㥬 ä®­ à ¬ª¨ ®ª­ 
sub eax,6
sub ecx,6
stdcall [buf2d_rect_by_size], buf_fon, 4,4,ecx,eax, dword[sc.frame] ;à¨á㥬 ¢­ãâ७­îî à ¬ªã ®ª­ 
sub eax,2
sub ecx,2
stdcall [buf2d_filled_rect_by_size], buf_fon, 5,5,ecx,eax, dword[sc.work] ;à¨á㥬 ä®­ ®ª­ 
;---;---;---
;jmp .end_skin
;---;---;---
stdcall get_obj_text_col,[obj_m_win],1
stdcall conv_str_to_int,edx ;eax = window style
cmp eax,3
jl .end_skin
stdcall [buf2d_bit_blt], buf_fon, 0,0, buf_skin1 ;«¥¢ë© ᪨­
mov edi,buf_skin1
mov eax,buf2d_w ;eax - ¯®§¨æ¨ï ¤«ï à¨á®¢ ­¨ï á।­¥£® ᪨­ 
mov edi,buf_skin2
mov ebx,buf2d_w ;ebx - è¨à¨­  «¥¢®£® ᪨­ 
sub ecx,ebx ;®â­¨¬ ¥¬ ®â è¨à¨­ë ®ª­  è¨à¨­ã á।­¥£® ᪨­ 
@@:
stdcall [buf2d_bit_blt], buf_fon, eax,0, buf_skin2 ;¯à®à¨á®¢ª  á।­¥£® ᪨­ 
add eax,ebx
cmp eax,ecx ;áà ¢­¨¢ ¥¬ ¯®§¨æ¨î á।­¥£® ᪨­  á è¨à¨­®© ®ª­ 
jl @b
;4-width
stdcall get_obj_text_col,[obj_m_win],4 ;edx = offset
stdcall conv_str_to_int,edx
mov edi,buf_skin3
sub eax,buf2d_w ;®â­¨¬ ¥¬ è¨à¨­ã ¯à ¢®£® ᪨­ 
stdcall [buf2d_bit_blt], buf_fon, eax,0, buf_skin3 ;¯à®à¨á®¢ª  ¯à ¢®£® ᪨­ 
.end_skin:
;à¨á㥬 £à ä¨ç¥áª¨¥ í«¥¬¥­âë
mov edx,C_BUT
stdcall draw_arr_objects, edx,draw_obj_but
mov edx,C_EDB
stdcall draw_arr_objects, edx,draw_obj_edit
mov edx,C_CHB
stdcall draw_arr_objects, edx,draw_obj_check
mov edx,C_DTT
stdcall draw_arr_objects, edx,draw_obj_text
mov edx,C_REC
stdcall draw_arr_objects, edx,draw_obj_rect_f13
.end_draw:
popad
ret
;äã­ªæ¨ï à¨áã¥â ¬ áá¨¢ë ®¯à¥¤¥«¥­­ëå í«¥¬¥­â®¢
align 4
proc draw_arr_objects, obj_t:dword,p_fun_draw:dword
push eax ebx
stdcall find_obj_in_file,[obj_t] ;eax - 㪠§ â¥«ì ­  áâàãªâãàã ®¡ê¥ªâ 
cmp eax,0
je .end_draw_o
mov ebx,[p_fun_draw]
stdcall ebx,eax
@@:
stdcall find_obj_in_file_next,[obj_t] ;eax - 㪠§ â¥«ì ­  áâàãªâãàã ®¡ê¥ªâ 
cmp eax,0
je .end_draw_o
stdcall ebx,eax
jmp @b
.end_draw_o:
pop ebx eax
ret
endp
;äã­ªæ¨ï à¨áã¥â ®¡ê¥ªâ ª­®¯ª¨, ¢ ®ª­¥ ª®­áâàãªâ®à 
align 4
proc draw_obj_but, p_obj:dword
locals
coor_x dd ?
coor_y dd ?
endl
pushad
mov ebx,dword[p_obj]
;1,2,3,4,5 - x,y,w,h,color
stdcall get_obj_text_col,ebx,1
stdcall conv_str_to_int,edx
mov [coor_x],eax
stdcall get_obj_text_col,ebx,2
stdcall conv_str_to_int,edx
mov [coor_y],eax
move_to_skin [coor_x],[coor_y]
stdcall get_obj_text_col,ebx,3
stdcall conv_str_to_int,edx
mov edi,eax
stdcall get_obj_text_col,ebx,4
stdcall conv_str_to_int,edx
mov ecx,eax
stdcall get_obj_text_col,ebx,5
stdcall conv_str_to_int,edx
test_bool_prop ebx,BIT_MOD_BUT_NFON
jc .no_draw_fon
stdcall [buf2d_filled_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],edi,ecx,eax
jmp @f
.no_draw_fon: ;­¥ ¯à®à¨á®¢ë¢ ¥¬ ª­®¯ªã
stdcall [buf2d_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],edi,ecx,eax
@@:
popad
ret
endp
;äã­ªæ¨ï à¨áã¥â ®¡ê¥ªâ ⥪á⮢®£® ¯®«ï, ¢ ®ª­¥ ª®­áâàãªâ®à 
align 4
proc draw_obj_edit, p_obj:dword
locals
coor_x dd ?
coor_y dd ?
col_txt dd ? ;梥â ⥪âá 
endl
pushad
mov ebx,dword[p_obj]
;1,2,3,4,...,6,...8,...,10 - w,x,y,col_fon,...,col_frame,...,col_txt,...,txt
stdcall get_obj_text_col,ebx,2
stdcall conv_str_to_int,edx
mov [coor_x],eax
stdcall get_obj_text_col,ebx,3
stdcall conv_str_to_int,edx
mov [coor_y],eax
move_to_skin [coor_x],[coor_y]
stdcall get_obj_text_col,ebx,1
stdcall conv_str_to_int,edx
mov ecx,eax
stdcall get_obj_text_col,ebx,6
stdcall conv_str_to_int,edx
stdcall [buf2d_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],\
ecx,15, eax
inc dword[coor_x]
inc dword[coor_y]
sub ecx,2
stdcall get_obj_text_col,ebx,4
stdcall conv_str_to_int,edx
stdcall [buf2d_filled_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],\
ecx,13, eax
stdcall get_obj_text_col,ebx,8
stdcall conv_str_to_int,edx
mov [col_txt],eax
add [coor_x],2-1 ;ᬥ頥¬ ª®®à¤¨­ âã, çâ®-¡ë
add [coor_y],4-1 ;⥪áâ ¡ë« ¢ ¯®«¥ ¢ë஢­¥­
stdcall get_obj_text_col,ebx,10
stdcall [buf2d_draw_text], buf_fon, buf_font,edx,dword[coor_x],dword[coor_y],\
dword[col_txt] ;à¨á㥬 áâபã á ⥪á⮬
popad
ret
endp
;äã­ªæ¨ï à¨áã¥â ®¡ê¥ªâ ä« ¦ª , ¢ ®ª­¥ ª®­áâàãªâ®à 
align 4
proc draw_obj_check, p_obj:dword
locals
coor_x dd ?
coor_y dd ?
ot_txt dd ? ;®âáâ㯠¤«ï ⥪áâ 
size_w dd ? ;à §¬¥à ª¢ ¤à â¨ª  w
size_h dd ? ;à §¬¥à ª¢ ¤à â¨ª  h
col_txt dd ? ;梥â ⥪âá 
endl
pushad
mov ebx,dword[p_obj]
;1,2,3,4,5, 6,7,8, 9 - ot_x,ot_y,w,h,ot_w_txt, col_fon,col_frame,col_txt, txt
stdcall get_obj_text_col,ebx,1 ;ot_x
stdcall conv_str_to_int,edx
mov [coor_x],eax
stdcall get_obj_text_col,ebx,2 ;ot_y
stdcall conv_str_to_int,edx
mov [coor_y],eax
move_to_skin [coor_x],[coor_y]
stdcall get_obj_text_col,ebx,5 ;ot_w_txt
stdcall conv_str_to_int,edx
mov [ot_txt],eax
stdcall get_obj_text_col,ebx,3 ;w
stdcall conv_str_to_int,edx
dec eax ;à §¬¥à ¬¥­ìè¥ ­  1 ¯¨ªá¥«ì
mov [size_w],eax
stdcall get_obj_text_col,ebx,4 ;h
stdcall conv_str_to_int,edx
dec eax ;à §¬¥à ¬¥­ìè¥ ­  1 ¯¨ªá¥«ì
mov [size_h],eax
stdcall get_obj_text_col,ebx,7 ;col_frame
stdcall conv_str_to_int,edx
stdcall [buf2d_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],\
dword[size_w],dword[size_h], eax
;§ «¨¢ª  ä®­  checkbox- 
inc dword[coor_x]
inc dword[coor_y]
sub dword[size_w],2
sub dword[size_h],2
stdcall get_obj_text_col,ebx,6 ;col_fon
stdcall conv_str_to_int,edx
stdcall [buf2d_filled_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],\
dword[size_w],dword[size_h], eax
test_bool_prop ebx,BIT_MOD_CHE
jnc @f
;à¨á®¢ ­¨¥ ®â¬¥âª¨ ¢ checkbox-¥
inc dword[coor_x]
inc dword[coor_y]
sub dword[size_w],2
sub dword[size_h],2
stdcall get_obj_text_col,ebx,7 ;col_frame
stdcall conv_str_to_int,edx
stdcall [buf2d_filled_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],\
dword[size_w],dword[size_h], eax
@@:
;¢®áâ ­ ¢«¨¢ ¥¬ ¯®«®¦¥­¨¥ ¨ à §¬¥àë
stdcall get_obj_text_col,ebx,1 ;ot_x
stdcall conv_str_to_int,edx
mov [coor_x],eax
stdcall get_obj_text_col,ebx,2 ;ot_y
stdcall conv_str_to_int,edx
mov [coor_y],eax
move_to_skin [coor_x],[coor_y]
stdcall get_obj_text_col,ebx,3 ;w
stdcall conv_str_to_int,edx
dec eax ;à §¬¥à ¬¥­ìè¥ ­  1 ¯¨ªá¥«ì
mov [size_w],eax
stdcall get_obj_text_col,ebx,4 ;h
stdcall conv_str_to_int,edx
dec eax ;à §¬¥à ¬¥­ìè¥ ­  1 ¯¨ªá¥«ì
mov [size_h],eax
stdcall get_obj_text_col,ebx,8 ;col_txt
stdcall conv_str_to_int,edx
mov [col_txt],eax
mov eax,[coor_x]
add eax,[size_w]
add eax,[ot_txt] ;¢ëç¨á«ï¥¬ ª®®à¤¨­ âë ¤«ï ⥪á⮢®© ¯®¤¯¨á¨
test_bool_prop ebx,BIT_MOD_CHE_T
jc .end_txt_align ;if text aligment = top
test_bool_prop ebx,BIT_MOD_CHE_M
jnc @f
shl [coor_y],1 ;㬭®¦ ¥¬ ­  2
mov ecx,[size_h]
add [coor_y],ecx ;¤®¡ ¢«ï¥¬ ¢ëá®âã checkbox
sub [coor_y],9 ;®â­¨¬ ¥¬ ¢ëá®âã ᨬ¢®« 
shr [coor_y],1 ;¤¥«¨¬ ­  ¯®«ã稢襥áï 2, ¯®«ãç ¥¬ ®âáâ㯠¤«ï áâ®ï饣® ¯® 業âàã ⥪áâ 
jmp .end_txt_align
@@:
test_bool_prop ebx,BIT_MOD_CHE_B
jnc @f
mov ecx,[size_h]
add [coor_y],ecx ;¤®¡ ¢«ï¥¬ ¢ëá®âã checkbox
sub [coor_y],9 ;®â­¨¬ ¥¬ ¢ëá®âã ᨬ¢®« 
;¯®«ãç ¥¬ ®âáâ㯠¤«ï áâ®ï饣® á­¨§ã ⥪áâ 
@@:
.end_txt_align:
stdcall get_obj_text_col,ebx,9 ;txt
stdcall [buf2d_draw_text], buf_fon, buf_font,edx,eax,dword[coor_y],\
dword[col_txt] ;à¨á㥬 áâபã á ⥪á⮬
popad
ret
endp
;äã­ªæ¨ï à¨áã¥â ®¡ê¥ªâ ⥪á⮢®© ¯®¤¯¨á¨, ¢ ®ª­¥ ª®­áâàãªâ®à 
align 4
proc draw_obj_text, p_obj:dword
locals
coor_x dd ?
coor_y dd ?
col_txt dd ? ;梥â ⥪âá 
endl
pushad
mov ebx,dword[p_obj]
;0,1,2,3,... - txt,x,y,col_txt,...
stdcall get_obj_text_col,ebx,1
stdcall conv_str_to_int,edx
mov [coor_x],eax
stdcall get_obj_text_col,ebx,2
stdcall conv_str_to_int,edx
mov [coor_y],eax
move_to_skin [coor_x],[coor_y]
stdcall get_obj_text_col,ebx,3
stdcall conv_str_to_int,edx
mov [col_txt],eax
stdcall get_obj_text_col,ebx,0
stdcall [buf2d_draw_text], buf_fon, buf_font,edx,dword[coor_x],dword[coor_y],\
dword[col_txt] ;à¨á㥬 áâபã á ⥪á⮬
popad
ret
endp
;äã­ªæ¨ï à¨áã¥â ®¡ê¥ªâ ¯àאַ㣮«ì­¨ª  (á¨á¨â. ä. 13)
align 4
proc draw_obj_rect_f13, p_obj:dword
locals
coor_x dd ?
coor_y dd ?
color dd ? ;梥â ⥪âá 
endl
pushad
mov ebx,dword[p_obj]
;0,1,2,3,4 - color,x,y,w,h
stdcall get_obj_text_col,ebx,1
stdcall conv_str_to_int,edx
mov [coor_x],eax
stdcall get_obj_text_col,ebx,2
stdcall conv_str_to_int,edx
mov [coor_y],eax
move_to_skin [coor_x],[coor_y]
stdcall get_obj_text_col,ebx,0
stdcall conv_str_to_int,edx
mov [color],eax
stdcall get_obj_text_col,ebx,3
stdcall conv_str_to_int,edx
mov ecx,eax
stdcall get_obj_text_col,ebx,4
stdcall conv_str_to_int,edx
mov esi,eax
stdcall [buf2d_filled_rect_by_size], buf_fon,\
dword[coor_x],dword[coor_y],ecx,esi,dword[color]
popad
ret
endp