Subversion Repositories Kolibri OS

Rev

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

  1. set_rect_window:
  2.         mov     ebx,set_rect_window_procinfo
  3.         call    get_slot_n
  4.  
  5.         mov     [set_rect_window_slot],ecx
  6.  
  7.         set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse)
  8. .red:
  9.         edit_boxes_set_sys_color rect_input,rect_input_end,sc
  10.         labels_set_sys_color rect_input_labels,rect_input_labels_end,sc
  11.         check_boxes_set_sys_color2 riw_check_boxes,riw_check_boxes_end,sc
  12.         call    .draw_window
  13. .still:
  14.         wait_event .red,.key,.button,.mouse
  15.  
  16. .key:
  17.         get_key
  18.  
  19.         stdcall    [edit_box_key], rect_input.left
  20.         stdcall    [edit_box_key], rect_input.top
  21.         stdcall    [edit_box_key], rect_input.width
  22.         stdcall    [edit_box_key], rect_input.height
  23.  
  24.         call    read_rect
  25.         call    draw_rect_on_screen
  26.  
  27.         jmp     .still
  28.  
  29. .button:
  30.         get_pressed_button
  31.  
  32.         cmp     ah,1
  33.         jne     @f
  34.         btr     dword [flags],3
  35.         jmp     close
  36. @@:
  37.  
  38.         jmp     .still
  39.  
  40. .mouse:
  41.         get_active_window
  42.         cmp     eax,[set_rect_window_slot]
  43.         jne     .still
  44.  
  45.         stdcall    [edit_box_mouse], rect_input.left
  46.         stdcall    [edit_box_mouse], rect_input.top
  47.         stdcall    [edit_box_mouse], rect_input.width
  48.         stdcall    [edit_box_mouse], rect_input.height
  49.  
  50. ;;;;;;;;;;;;;;;;;;;;;;
  51.         stdcall    [check_box_mouse], use_rect_active_window
  52.  
  53.         jmp     .still
  54.  
  55. .draw_window:
  56.         start_draw_window
  57.  
  58.         mov     edx,[sc.work]
  59.         add     edx,0x33000000
  60.         mov     edi,riw_grab_text
  61.         xor     esi,esi
  62.         mcall   SF_CREATE_WINDOW, 100*65536+250, 100*65536+130
  63.  
  64.         draw_labels rect_input_labels,rect_input_labels_end
  65.  
  66.         stdcall    [edit_box_draw], rect_input.left
  67.         stdcall    [edit_box_draw], rect_input.top
  68.         stdcall    [edit_box_draw], rect_input.width
  69.         stdcall    [edit_box_draw], rect_input.height
  70. ;;;;;;;;;;;;;;;;;;;;;;
  71.         stdcall    [check_box_draw], use_rect_active_window
  72.  
  73.         call    read_rect
  74.         call    draw_rect_on_screen
  75.  
  76.         stop_draw_window
  77. ret
  78.  
  79. ;--------------------------------------------------------------------
  80. ;--- ‘ç¨â뢠­¨¥ ®¡« â¨ ----------------------------------------------
  81. ;--------------------------------------------------------------------
  82. read_rect:
  83.         bt      dword [use_rect_active_window.flags],1
  84.         jc      read_rect_from_active_window
  85.  
  86.         mov     edi,rect_input_buffer.left
  87.         call    zstr_to_int
  88.         cmp     ax,[scr.width]
  89.         jb      @f
  90.         mov     ax,[scr.width]
  91. @@:
  92.         mov     [rect.left],ax
  93.  
  94.         mov     edi,rect_input_buffer.top
  95.         call    zstr_to_int
  96.         cmp     ax,[scr.height]
  97.         jb      @f
  98.         mov     ax,[scr.height]
  99. @@:
  100.         mov     [rect.top],ax
  101.  
  102.         mov     edi,rect_input_buffer.width
  103.         call    zstr_to_int
  104.         mov     bx,[scr.width]
  105.         sub     bx,[rect.left]
  106.         cmp     ax,bx
  107.         jb      @f
  108.         mov     ax,bx
  109. @@:
  110.         mov     [rect.width],ax
  111.  
  112.         mov     edi,rect_input_buffer.height
  113.         call    zstr_to_int
  114.         mov     bx,[scr.height]
  115.         sub     bx,[rect.top]
  116.         cmp     ax,bx
  117.         jb      @f
  118.         mov     ax,bx
  119. @@:
  120.         mov     [rect.height],ax
  121. ret
  122.  
  123. read_rect_from_active_window:
  124.         call    get_active_window_info
  125.  
  126.         mov     eax,[active_app.left]
  127.         mov     [rect.left],ax
  128.         mov     eax,[active_app.top]
  129.         mov     [rect.top],ax
  130.         mov     eax,[active_app.width]
  131.         inc     eax
  132.         mov     [rect.width],ax
  133.         mov     eax,[active_app.height]
  134.         inc     eax
  135.         mov     [rect.height],ax
  136. ret
  137.  
  138. draw_rect_on_screen:
  139.  
  140.         xor     edx,edx
  141.         mcall   SF_DRAW_RECT, 150*65536+80, 5*65536+60
  142.  
  143.         ;movzx   eax,word [rect.left]
  144.         ;mul     word [scr.width]
  145.         xor     edx,edx
  146.         movzx   eax,word [scr.width]
  147.         mov     ebx,80
  148.         div     ebx
  149.         mov     ebx,eax
  150.  
  151.         xor     edx,edx
  152.         movzx   eax,word [rect.height]
  153.         div     ebx
  154.         push    ax
  155.  
  156.         xor     edx,edx
  157.         movzx   eax,word [rect.width]
  158.         div     ebx
  159.         push    ax
  160.  
  161.         xor     edx,edx
  162.         movzx   eax,word [rect.top]
  163.         div     ebx
  164.         push    ax
  165.  
  166.         xor     edx,edx
  167.         movzx   eax,word [rect.left]
  168.         div     ebx
  169.         push    ax
  170.  
  171.         pop     bx
  172.         add     bx,150
  173.         shl    ebx,16
  174.  
  175.         pop     cx
  176.         add     cx,5
  177.         shl     ecx,16
  178.  
  179.         pop     bx
  180.         pop     cx
  181.  
  182.         mcall   SF_DRAW_RECT,,,0xffffff
  183. ret
  184.  
  185. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  186. ;DATA ¤ ­­ë¥
  187. ;‚ᥣ¤  ᮡ«î¤ âì ¯®á«¥¤®¢ â¥«ì­®áâì ¢ ¨¬¥­¨.
  188.  
  189. system_dir_Boxlib       db '/sys/lib/box_lib.obj',0
  190. system_dir_ProcLib      db '/sys/lib/proc_lib.obj',0
  191. system_dir_LibImg   db '/sys/lib/libimg.obj',0
  192.  
  193. if lang eq ru
  194. head_f_i:
  195. head_f_l        db '‘¨á⥬­ ï ®è¨¡ª ',0
  196.  
  197. err_message_found_lib1  db 'box_lib.obj - ­¥ ­ ©¤¥­ !',0
  198. err_message_found_lib2  db 'proc_lib.obj - ­¥ ­ ©¤¥­ !',0
  199. err_message_found_lib3  db 'libimg.obj - ­¥ ­ ©¤¥­ !',0
  200.  
  201. err_message_import1     db 'box_lib.obj - ®è¨¡ª  ¨¬¯®àâ !',0
  202. err_message_import2     db 'proc_lib.obj - ®è¨¡ª  ¨¬¯®àâ !',0
  203. err_message_import3     db 'libimg.obj - ®è¨¡ª  ¨¬¯®àâ !',0
  204.  
  205. else
  206.  
  207. head_f_i:
  208. head_f_l        db 'System error',0
  209.  
  210. err_message_found_lib1  db 'box_lib.obj - Not found!',0
  211. err_message_found_lib2  db 'proc_lib.obj - Not found!',0
  212. err_message_found_lib3  db 'libimg.obj - Not found!',0
  213.  
  214. err_message_import1     db 'box_lib.obj - Wrong import!',0
  215. err_message_import2     db 'proc_lib.obj - Wrong import!',0
  216. err_message_import3     db 'libimg.obj - Wrong import!',0
  217. end if
  218. ;---------------------------------------------------------------------
  219. align 4
  220. ProcLib_import:
  221. OpenDialog_Init         dd aOpenDialog_Init
  222. OpenDialog_Start        dd aOpenDialog_Start
  223. ;OpenDialog__Version    dd aOpenDialog_Version
  224.         dd      0
  225.         dd      0
  226. aOpenDialog_Init        db 'OpenDialog_init',0
  227. aOpenDialog_Start       db 'OpenDialog_start',0
  228. ;aOpenDialog_Version    db 'Version_OpenDialog',0
  229. ;---------------------------------------------------------------------
  230. align 4
  231. Box_lib_import:
  232. ;init_lib               dd a_init
  233. ;version_lib            dd a_version
  234.  
  235. edit_box_draw           dd aEdit_box_draw
  236. edit_box_key            dd aEdit_box_key
  237. edit_box_mouse          dd aEdit_box_mouse
  238. ;version_ed             dd aVersion_ed
  239.  
  240. init_checkbox           dd aInit_checkbox
  241. check_box_draw          dd aCheck_box_draw
  242. check_box_mouse         dd aCheck_box_mouse
  243. ;version_ch     dd      aVersion_ch
  244.  
  245. option_box_draw dd aOption_box_draw
  246. option_box_mouse        dd aOption_box_mouse
  247. ;version_op             dd aVersion_op
  248.  
  249. PathShow_prepare        dd sz_PathShow_prepare
  250. PathShow_draw           dd sz_PathShow_draw
  251. ;Version_path_show      dd szVersion_path_show
  252.                         dd 0,0
  253.  
  254. ;a_init                 db 'lib_init',0
  255. ;a_version              db 'version',0
  256.  
  257. aEdit_box_draw          db 'edit_box',0
  258. aEdit_box_key           db 'edit_box_key',0
  259. aEdit_box_mouse         db 'edit_box_mouse',0
  260. ;aVersion_ed            db 'version_ed',0
  261.  
  262.  
  263. aInit_checkbox   db 'init_checkbox2',0
  264. aCheck_box_draw  db 'check_box_draw2',0
  265. aCheck_box_mouse db 'check_box_mouse2',0
  266. ;aVersion_ch     db 'version_ch2',0
  267.  
  268. aOption_box_draw        db 'option_box_draw',0
  269. aOption_box_mouse       db 'option_box_mouse',0
  270. ;aVersion_op            db 'version_op',0
  271.  
  272. sz_PathShow_prepare     db 'PathShow_prepare',0
  273. sz_PathShow_draw        db 'PathShow_draw',0
  274. ;szVersion_path_show    db 'version_PathShow',0
  275. ;---------------------------------------------------------------------
  276. align 4
  277. import_libimg:
  278.         dd alib_init1
  279.         img_is_img  dd aimg_is_img
  280.         img_info    dd aimg_info
  281.         img_from_file dd aimg_from_file
  282.         img_to_file dd aimg_to_file
  283.         img_from_rgb dd aimg_from_rgb
  284.         img_to_rgb  dd aimg_to_rgb
  285.         img_to_rgb2 dd aimg_to_rgb2
  286.         img_decode  dd aimg_decode
  287.         img_encode  dd aimg_encode
  288.         img_create  dd aimg_create
  289.         img_destroy dd aimg_destroy
  290.         img_destroy_layer dd aimg_destroy_layer
  291.         img_count   dd aimg_count
  292.         img_lock_bits dd aimg_lock_bits
  293.         img_unlock_bits dd aimg_unlock_bits
  294.         img_flip    dd aimg_flip
  295.         img_flip_layer dd aimg_flip_layer
  296.         img_rotate  dd aimg_rotate
  297.         img_rotate_layer dd aimg_rotate_layer
  298.         img_draw    dd aimg_draw
  299. dd 0,0
  300.         alib_init1   db 'lib_init',0
  301.         aimg_is_img  db 'img_is_img',0
  302.         aimg_info    db 'img_info',0
  303.         aimg_from_file db 'img_from_file',0
  304.         aimg_to_file db 'img_to_file',0
  305.         aimg_from_rgb db 'img_from_rgb',0
  306.         aimg_to_rgb  db 'img_to_rgb',0
  307.         aimg_to_rgb2 db 'img_to_rgb2',0
  308.         aimg_decode  db 'img_decode',0
  309.         aimg_encode  db 'img_encode',0
  310.         aimg_create  db 'img_create',0
  311.         aimg_destroy db 'img_destroy',0
  312.         aimg_destroy_layer db 'img_destroy_layer',0
  313.         aimg_count   db 'img_count',0
  314.         aimg_lock_bits db 'img_lock_bits',0
  315.         aimg_unlock_bits db 'img_unlock_bits',0
  316.         aimg_flip    db 'img_flip',0
  317.         aimg_flip_layer db 'img_flip_layer',0
  318.         aimg_rotate  db 'img_rotate',0
  319.         aimg_rotate_layer db 'img_rotate_layer',0
  320.         aimg_draw    db 'img_draw',0
  321. ;---------------------------------------------------------------------
  322. ;width,left,top,color,shift_color,focus_border_color,\
  323. ;       blur_border_color,text_color,max,text,mouse_variable,flags,size,pos
  324.  
  325. rect_input:
  326. .left   edit_box 35,95,5, cl_white,0,0,0,5,rect_input_buffer.left,  mouse_dd1,ed_figure_only+ed_focus
  327. .top    edit_box 35,95,25,cl_white,0,0,0,5,rect_input_buffer.top,   mouse_dd1,ed_figure_only
  328. .width  edit_box 35,95,45,cl_white,0,0,0,5,rect_input_buffer.width, mouse_dd1,ed_figure_only
  329. .height edit_box 35,95,65,cl_white,0,0,0,5,rect_input_buffer.height,mouse_dd1,ed_figure_only
  330. rect_input_end:
  331. mouse_dd1       rd 1
  332. rect_input_labels:
  333. .left   label 10,10,0,rect_input_labels_text.left
  334. .top    label 10,30,0,rect_input_labels_text.top
  335. .width  label 10,50,0,rect_input_labels_text.width
  336. .height label 10,70,0,rect_input_labels_text.height
  337. rect_input_labels_end:
  338.  
  339. rect_input_labels_text:
  340. if lang eq ru
  341. .left db 'Žâáâ㯠᫥¢ :',0
  342. .top  db 'Žâáâ㯠ᢥàåã:',0
  343. .width  db '˜¨à¨­ :',0
  344. .height db '‚ëá®â :',0
  345. else
  346. .left db 'Left:',0
  347. .top  db 'Top:',0
  348. .width  db 'Width:',0
  349. .height db 'Height:',0
  350. end if
  351.  
  352. riw_check_boxes:
  353. use_rect_active_window check_box2 (10 shl 16)+10,(85 shl 16) +10,5,cl_white,0,0,\
  354. riw_check_boxes_text, ch_flag_bottom
  355. riw_check_boxes_end:
  356.  
  357. if lang eq ru
  358. riw_check_boxes_text db 'ˆá¯®«ì§®¢ âì ®¡« áâì  ªâ¨¢­®£® ®ª­ ',0
  359. riw_grab_text db 'Š®®à¤¨­ âë ¨ à §¬¥àë ®¡« áâ¨:',0
  360. else
  361. riw_check_boxes_text db 'Use area of the active window',0
  362. riw_grab_text db 'Coordinates and size of the field:',0
  363. end if