kolibrios/programs/develop/kol_f_edit/ced_constr.inc
IgorA be5947897e Add new programm 'kol_f_edit'
Details view in 'readme.htm'

git-svn-id: svn://kolibrios.org@1698 a494cfbc-eb01-0410-851d-a64ba20cac60
2010-11-11 21:47:18 +00:00

322 lines
8.1 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
@@:
xor edx,edx
mov dl,C_WI
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:
xor edx,edx ;à¨á㥬 £à ä¨ç¥áª¨¥ í«¥¬¥­âë
mov dl,C_BU
stdcall draw_arr_objects, edx,draw_obj_but
mov dl,C_ED
stdcall draw_arr_objects, edx,draw_obj_edit
mov dl,C_CB
stdcall draw_arr_objects, edx,draw_obj_check
mov dl,C_DT
stdcall draw_arr_objects, edx,draw_obj_text
mov dl,C_RE
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
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_wh dd ? ;à §¬¥à ª¢ ¤à â¨ª 
col_txt dd ? ;梥â ⥪âá 
endl
pushad
mov ebx,dword[p_obj]
;1,2,3, 4,5,6, 7,8 - x,y,txt, col_fon,col_frame,col_txt, w_txt,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,7
stdcall conv_str_to_int,edx
mov [ot_txt],eax
stdcall get_obj_text_col,ebx,8
stdcall conv_str_to_int,edx
dec eax ;à §¬¥à ¬¥­ìè¥ ­  1 ¯¨ªá¥«ì
mov [size_wh],eax
stdcall get_obj_text_col,ebx,5
stdcall conv_str_to_int,edx
stdcall [buf2d_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],\
dword[size_wh],dword[size_wh], eax
inc dword[coor_x]
inc dword[coor_y]
sub dword[size_wh],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],\
dword[size_wh],dword[size_wh], eax
stdcall get_obj_text_col,ebx,6
stdcall conv_str_to_int,edx
mov [col_txt],eax
mov eax,[ot_txt]
add eax,[size_wh]
add eax,2-1 ;sub dword[size_wh],2 ;inc dword[coor_x]
add [coor_x],eax ;¢ëç¨á«ï¥¬ ª®®à¤¨­ âë ¤«ï ⥪á⮢®© ¯®¤¯¨á¨
add [coor_y],5-1 ;inc dword[coor_y]
stdcall get_obj_text_col,ebx,3
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_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