Subversion Repositories Kolibri OS

Rev

Rev 1714 | Rev 1720 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;
  2. ; ¢ í⮬ ä ©«¥ ᮡ࠭ë ä㭪樨 à¨áãî騥 ®ª­® ª®­áâàãªâ®à 
  3. ;
  4.  
  5. macro move_to_skin coord_x,coord_y
  6. {
  7.         add coord_x,SKIN_W1
  8.         add coord_y,SKIN_H
  9. }
  10.  
  11. ;¯¥à¥à¨á®¢ª  ®ª­  ª®­áâàãªâ®à 
  12. align 4
  13. draw_constructor:
  14.         stdcall [buf2d_clear], buf_fon,0xffffff
  15.  
  16. pushad
  17.         cmp [err_ini1],1
  18.         jne @f
  19.                 stdcall [buf2d_draw_text], buf_fon, buf_font,txtErrIni1,10,10,\
  20.                         0xff0000 ;à¨á㥬 áâபã á ⥪á⮬
  21.                 stdcall [buf2d_draw_text], buf_fon, buf_font,fp_obj_opt,10,20,\
  22.                         0xff0000 ;à¨á㥬 áâபã á ⥪á⮬
  23.                 jmp .end_draw
  24.         @@:
  25.  
  26.         mov edx,C_WND
  27.         stdcall find_obj_in_file,edx ;eax - 㪠§ â¥«ì ­  áâàãªâãàã ®ª­ 
  28.         cmp eax,0
  29.         je .end_draw
  30.         mov dword[obj_m_win],eax
  31.  
  32.         ;4-width
  33.         stdcall get_obj_text_col,[obj_m_win],4 ;edx = offset
  34.         stdcall conv_str_to_int,edx
  35.         mov ecx,eax ;ecx=width
  36.  
  37.         ;5-height
  38.         stdcall get_obj_text_col,[obj_m_win],5 ;edx = offset
  39.         stdcall conv_str_to_int,edx
  40.         ;eax=height
  41.  
  42.         stdcall [buf2d_rect_by_size], buf_fon, 0,0,ecx,eax, dword[sc.frame] ;à¨á㥬 ¢­¥è­îî à ¬ªã ®ª­ 
  43.         sub eax,2
  44.         sub ecx,2
  45.         stdcall [buf2d_filled_rect_by_size], buf_fon, 1,1,ecx,eax, dword[sc.grab] ;à¨á㥬 ä®­ à ¬ª¨ ®ª­ 
  46.  
  47.         sub eax,6
  48.         sub ecx,6
  49.         stdcall [buf2d_rect_by_size], buf_fon, 4,4,ecx,eax, dword[sc.frame] ;à¨á㥬 ¢­ãâ७­îî à ¬ªã ®ª­ 
  50.         sub eax,2
  51.         sub ecx,2
  52.         stdcall [buf2d_filled_rect_by_size], buf_fon, 5,5,ecx,eax, dword[sc.work] ;à¨á㥬 ä®­ ®ª­ 
  53.  
  54. ;---;---;---
  55. ;jmp .end_skin
  56. ;---;---;---
  57.  
  58.         stdcall get_obj_text_col,[obj_m_win],1
  59.         stdcall conv_str_to_int,edx ;eax = window style
  60.         cmp eax,3
  61.         jl .end_skin
  62.                 stdcall [buf2d_bit_blt], buf_fon, 0,0, buf_skin1 ;«¥¢ë© ᪨­
  63.                 mov edi,buf_skin1
  64.                 mov eax,buf2d_w ;eax - ¯®§¨æ¨ï ¤«ï à¨á®¢ ­¨ï á।­¥£® ᪨­ 
  65.                 mov edi,buf_skin2
  66.                 mov ebx,buf2d_w ;ebx - è¨à¨­  «¥¢®£® ᪨­ 
  67.                 sub ecx,ebx ;®â­¨¬ ¥¬ ®â è¨à¨­ë ®ª­  è¨à¨­ã á।­¥£® ᪨­ 
  68.                 @@:
  69.                         stdcall [buf2d_bit_blt], buf_fon, eax,0, buf_skin2 ;¯à®à¨á®¢ª  á।­¥£® ᪨­ 
  70.                         add eax,ebx
  71.                         cmp eax,ecx ;áà ¢­¨¢ ¥¬ ¯®§¨æ¨î á।­¥£® ᪨­  á è¨à¨­®© ®ª­ 
  72.                         jl @b
  73.  
  74.                 ;4-width
  75.                 stdcall get_obj_text_col,[obj_m_win],4 ;edx = offset
  76.                 stdcall conv_str_to_int,edx
  77.                 mov edi,buf_skin3
  78.                 sub eax,buf2d_w ;®â­¨¬ ¥¬ è¨à¨­ã ¯à ¢®£® ᪨­ 
  79.                 stdcall [buf2d_bit_blt], buf_fon, eax,0, buf_skin3 ;¯à®à¨á®¢ª  ¯à ¢®£® ᪨­ 
  80.         .end_skin:
  81.  
  82.         ;à¨á㥬 £à ä¨ç¥áª¨¥ í«¥¬¥­âë
  83.         mov edx,C_BUT
  84.         stdcall draw_arr_objects, edx,draw_obj_but
  85.         mov edx,C_EDB
  86.         stdcall draw_arr_objects, edx,draw_obj_edit
  87.         mov edx,C_CHB
  88.         stdcall draw_arr_objects, edx,draw_obj_check
  89.         mov edx,C_DTT
  90.         stdcall draw_arr_objects, edx,draw_obj_text
  91.         mov edx,C_REC
  92.         stdcall draw_arr_objects, edx,draw_obj_rect_f13
  93.  
  94.         .end_draw:
  95. popad
  96.         ret
  97.  
  98. ;äã­ªæ¨ï à¨áã¥â ¬ áá¨¢ë ®¯à¥¤¥«¥­­ëå í«¥¬¥­â®¢
  99. align 4
  100. proc draw_arr_objects, obj_t:dword,p_fun_draw:dword
  101. push eax ebx
  102.         stdcall find_obj_in_file,[obj_t] ;eax - 㪠§ â¥«ì ­  áâàãªâãàã ®¡ê¥ªâ 
  103.         cmp eax,0
  104.         je .end_draw_o
  105.                 mov ebx,[p_fun_draw]
  106.                 stdcall ebx,eax
  107.                 @@:
  108.                         stdcall find_obj_in_file_next,[obj_t] ;eax - 㪠§ â¥«ì ­  áâàãªâãàã ®¡ê¥ªâ 
  109.                         cmp eax,0
  110.                         je .end_draw_o
  111.                                 stdcall ebx,eax
  112.                 jmp @b
  113.         .end_draw_o:
  114. pop ebx eax
  115.         ret
  116. endp
  117.  
  118. ;äã­ªæ¨ï à¨áã¥â ®¡ê¥ªâ ª­®¯ª¨, ¢ ®ª­¥ ª®­áâàãªâ®à 
  119. align 4
  120. proc draw_obj_but, p_obj:dword
  121. locals
  122.         coor_x dd ?
  123.         coor_y dd ?
  124. endl
  125.         pushad
  126.                 mov ebx,dword[p_obj]
  127.                 ;1,2,3,4,5 - x,y,w,h,color
  128.  
  129.                 stdcall get_obj_text_col,ebx,1
  130.                 stdcall conv_str_to_int,edx
  131.                 mov [coor_x],eax
  132.                 stdcall get_obj_text_col,ebx,2
  133.                 stdcall conv_str_to_int,edx
  134.                 mov [coor_y],eax
  135.                 move_to_skin [coor_x],[coor_y]
  136.                 stdcall get_obj_text_col,ebx,3
  137.                 stdcall conv_str_to_int,edx
  138.                 mov edi,eax
  139.                 stdcall get_obj_text_col,ebx,4
  140.                 stdcall conv_str_to_int,edx
  141.                 mov ecx,eax
  142.                 stdcall get_obj_text_col,ebx,5
  143.                 stdcall conv_str_to_int,edx
  144.                 test_bool_prop ebx,BIT_MOD_BUT_NFON
  145.                 jc .no_draw_fon
  146.                         stdcall [buf2d_filled_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],edi,ecx,eax
  147.                         jmp @f
  148.                 .no_draw_fon: ;­¥ ¯à®à¨á®¢ë¢ ¥¬ ª­®¯ªã
  149.                         stdcall [buf2d_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],edi,ecx,eax
  150.                 @@:
  151.         popad
  152.         ret
  153. endp
  154.  
  155. ;äã­ªæ¨ï à¨áã¥â ®¡ê¥ªâ ⥪á⮢®£® ¯®«ï, ¢ ®ª­¥ ª®­áâàãªâ®à 
  156. align 4
  157. proc draw_obj_edit, p_obj:dword
  158. locals
  159.         coor_x dd ?
  160.         coor_y dd ?
  161.         col_txt dd ? ;梥â ⥪âá 
  162. endl
  163.         pushad
  164.                 mov ebx,dword[p_obj]
  165.                 ;1,2,3,4,...,6,...8,...,10 - w,x,y,col_fon,...,col_frame,...,col_txt,...,txt
  166.  
  167.                 stdcall get_obj_text_col,ebx,2
  168.                 stdcall conv_str_to_int,edx
  169.                 mov [coor_x],eax
  170.                 stdcall get_obj_text_col,ebx,3
  171.                 stdcall conv_str_to_int,edx
  172.                 mov [coor_y],eax
  173.                 move_to_skin [coor_x],[coor_y]
  174.                 stdcall get_obj_text_col,ebx,1
  175.                 stdcall conv_str_to_int,edx
  176.                 mov ecx,eax
  177.                 stdcall get_obj_text_col,ebx,6
  178.                 stdcall conv_str_to_int,edx
  179.                 stdcall [buf2d_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],\
  180.                         ecx,15, eax
  181.  
  182.                 inc dword[coor_x]
  183.                 inc dword[coor_y]
  184.                 sub ecx,2
  185.                 stdcall get_obj_text_col,ebx,4
  186.                 stdcall conv_str_to_int,edx
  187.                 stdcall [buf2d_filled_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],\
  188.                         ecx,13, eax
  189.  
  190.                 stdcall get_obj_text_col,ebx,8
  191.                 stdcall conv_str_to_int,edx
  192.                 mov [col_txt],eax
  193.                 add [coor_x],2-1 ;ᬥ頥¬ ª®®à¤¨­ âã, çâ®-¡ë
  194.                 add [coor_y],4-1 ;⥪áâ ¡ë« ¢ ¯®«¥ ¢ë஢­¥­
  195.                 stdcall get_obj_text_col,ebx,10
  196.                 stdcall [buf2d_draw_text], buf_fon, buf_font,edx,dword[coor_x],dword[coor_y],\
  197.                         dword[col_txt] ;à¨á㥬 áâபã á ⥪á⮬
  198.  
  199.         popad
  200.         ret
  201. endp
  202.  
  203. ;äã­ªæ¨ï à¨áã¥â ®¡ê¥ªâ ä« ¦ª , ¢ ®ª­¥ ª®­áâàãªâ®à 
  204. align 4
  205. proc draw_obj_check, p_obj:dword
  206. locals
  207.         coor_x dd ?
  208.         coor_y dd ?
  209.         ot_txt dd ? ;®âáâ㯠¤«ï ⥪áâ 
  210.         size_wh dd ? ;à §¬¥à ª¢ ¤à â¨ª 
  211.         col_txt dd ? ;梥â ⥪âá 
  212. endl
  213.         pushad
  214.                 mov ebx,dword[p_obj]
  215.                 ;1,2,3, 4,5,6, 7,8 - x,y,txt, col_fon,col_frame,col_txt, w_txt,w_h
  216.  
  217.                 stdcall get_obj_text_col,ebx,1
  218.                 stdcall conv_str_to_int,edx
  219.                 mov [coor_x],eax
  220.                 stdcall get_obj_text_col,ebx,2
  221.                 stdcall conv_str_to_int,edx
  222.                 mov [coor_y],eax
  223.                 move_to_skin [coor_x],[coor_y]
  224.                 stdcall get_obj_text_col,ebx,7
  225.                 stdcall conv_str_to_int,edx
  226.                 mov [ot_txt],eax
  227.                 stdcall get_obj_text_col,ebx,8
  228.                 stdcall conv_str_to_int,edx
  229.                 dec eax ;à §¬¥à ¬¥­ìè¥ ­  1 ¯¨ªá¥«ì
  230.                 mov [size_wh],eax
  231.                 stdcall get_obj_text_col,ebx,5
  232.                 stdcall conv_str_to_int,edx
  233.                 stdcall [buf2d_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],\
  234.                         dword[size_wh],dword[size_wh], eax
  235.  
  236.                 inc dword[coor_x]
  237.                 inc dword[coor_y]
  238.                 sub dword[size_wh],2
  239.                 stdcall get_obj_text_col,ebx,4
  240.                 stdcall conv_str_to_int,edx
  241.                 stdcall [buf2d_filled_rect_by_size], buf_fon, dword[coor_x],dword[coor_y],\
  242.                         dword[size_wh],dword[size_wh], eax
  243.  
  244.                 stdcall get_obj_text_col,ebx,6
  245.                 stdcall conv_str_to_int,edx
  246.                 mov [col_txt],eax
  247.                 mov eax,[ot_txt]
  248.                 add eax,[size_wh]
  249.                 add eax,2-1 ;sub dword[size_wh],2 ;inc dword[coor_x]
  250.                 add [coor_x],eax ;¢ëç¨á«ï¥¬ ª®®à¤¨­ âë ¤«ï ⥪á⮢®© ¯®¤¯¨á¨
  251.                 add [coor_y],5-1 ;inc dword[coor_y]
  252.                 stdcall get_obj_text_col,ebx,3
  253.                 stdcall [buf2d_draw_text], buf_fon, buf_font,edx,dword[coor_x],dword[coor_y],\
  254.                         dword[col_txt] ;à¨á㥬 áâபã á ⥪á⮬
  255.         popad
  256.         ret
  257. endp
  258.  
  259. ;äã­ªæ¨ï à¨áã¥â ®¡ê¥ªâ ⥪á⮢®© ¯®¤¯¨á¨, ¢ ®ª­¥ ª®­áâàãªâ®à 
  260. align 4
  261. proc draw_obj_text, p_obj:dword
  262. locals
  263.         coor_x dd ?
  264.         coor_y dd ?
  265.         col_txt dd ? ;梥â ⥪âá 
  266. endl
  267.         pushad
  268.                 mov ebx,dword[p_obj]
  269.                 ;0,1,2,3,... - txt,x,y,col_txt,...
  270.  
  271.                 stdcall get_obj_text_col,ebx,1
  272.                 stdcall conv_str_to_int,edx
  273.                 mov [coor_x],eax
  274.                 stdcall get_obj_text_col,ebx,2
  275.                 stdcall conv_str_to_int,edx
  276.                 mov [coor_y],eax
  277.                 move_to_skin [coor_x],[coor_y]
  278.  
  279.                 stdcall get_obj_text_col,ebx,3
  280.                 stdcall conv_str_to_int,edx
  281.                 mov [col_txt],eax
  282.  
  283.                 stdcall get_obj_text_col,ebx,0
  284.                 stdcall [buf2d_draw_text], buf_fon, buf_font,edx,dword[coor_x],dword[coor_y],\
  285.                         dword[col_txt] ;à¨á㥬 áâபã á ⥪á⮬
  286.         popad
  287.         ret
  288. endp
  289.  
  290. ;äã­ªæ¨ï à¨áã¥â ®¡ê¥ªâ ¯àאַ㣮«ì­¨ª  (á¨á¨â. ä. 13)
  291. align 4
  292. proc draw_obj_rect_f13, p_obj:dword
  293. locals
  294.         coor_x dd ?
  295.         coor_y dd ?
  296.         color dd ? ;梥â ⥪âá 
  297. endl
  298.         pushad
  299.                 mov ebx,dword[p_obj]
  300.                 ;0,1,2,3,4 - color,x,y,w,h
  301.  
  302.                 stdcall get_obj_text_col,ebx,1
  303.                 stdcall conv_str_to_int,edx
  304.                 mov [coor_x],eax
  305.                 stdcall get_obj_text_col,ebx,2
  306.                 stdcall conv_str_to_int,edx
  307.                 mov [coor_y],eax
  308.                 move_to_skin [coor_x],[coor_y]
  309.  
  310.                 stdcall get_obj_text_col,ebx,0
  311.                 stdcall conv_str_to_int,edx
  312.                 mov [color],eax
  313.  
  314.                 stdcall get_obj_text_col,ebx,3
  315.                 stdcall conv_str_to_int,edx
  316.                 mov ecx,eax
  317.  
  318.                 stdcall get_obj_text_col,ebx,4
  319.                 stdcall conv_str_to_int,edx
  320.                 mov esi,eax
  321.  
  322.                 stdcall [buf2d_filled_rect_by_size], buf_fon,\
  323.                         dword[coor_x],dword[coor_y],ecx,esi,dword[color]
  324.         popad
  325.         ret
  326. endp
  327.