Subversion Repositories Kolibri OS

Rev

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

  1. use32
  2.         org 0
  3.         db 'MENUET01'
  4.         dd 1,start,i_end,mem,stacktop,0,sys_path
  5.  
  6. include '../../macros.inc'
  7. include '../../proc32.inc'
  8. include '../../KOSfuncs.inc'
  9. include '../../load_img.inc'
  10. include '../../develop/libraries/libs-dev/libimg/libimg.inc'
  11. include '../../develop/libraries/box_lib/trunk/box_lib.mac'
  12. include 'lang.inc'
  13. include 'cnc_editor.inc'
  14. include '../../develop/info3ds/info_fun_float.inc'
  15.  
  16. @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
  17. caption db 'CNC editor 24.09.18',0 ;¯®¤¯¨áì ®ª­ 
  18.  
  19. run_file_70 FileInfoBlock
  20.  
  21. offs_last_timer dd 0 ;¯®á«¥¤­¨© ᤢ¨£ ¯®ª § ­ë© ¢ ä㭪樨 â ©¬¥à 
  22.  
  23. IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
  24. image_data_toolbar dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  25. icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
  26. icon_toolbar dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï ¨ª®­®ª ®¡ê¥ªâ®¢
  27.  
  28. include 'wnd_point_coords.inc'
  29. include 'wnd_scale.inc'
  30. include 'wnd_new_file.inc'
  31.  
  32. align 4
  33. start:
  34.         load_libraries l_libs_start,l_libs_end
  35.         ;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
  36.         mov     ebp,lib_0
  37.         cmp     dword [ebp+ll_struc_size-4],0
  38.         jz      @f
  39.                 mcall SF_TERMINATE_PROCESS
  40.         @@:
  41.         mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
  42.         mcall SF_SET_EVENTS_MASK,0xC0000027
  43.         stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
  44.  
  45.         stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
  46.  
  47.         ;èà¨äâ ¤¥« ¥¬ ¤® ᮧ¤ ­¨ï ¯ ­¥«¨ (¤«ï íª®­®¬¨¨ 㪠§ â¥«ï image_data_toolbar)
  48.         include_image_file '..\..\fs\kfar\trunk\font6x9.bmp', image_data_toolbar, buf_1.w,buf_1.h
  49.         stdcall [buf2d_create_f_img], buf_1,[image_data_toolbar] ;ᮧ¤ ¥¬ ¡ãä¥à
  50.         stdcall mem.Free,[image_data_toolbar] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
  51.         stdcall [buf2d_conv_24_to_8], buf_1,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8 ¡¨â
  52.         stdcall [buf2d_convert_text_matrix], buf_1
  53.         mov eax,[buf_1.h]
  54.         shr eax,8
  55.         mov [font_h],eax
  56.  
  57.         include_image_file 'toolbar.png', image_data_toolbar
  58.  
  59.         mov dword[w_scr_t1.type],1
  60.         stdcall dword[tl_data_init], tree1
  61.         ;á¨á⥬­ë¥ ¨ª®­ª¨ 16*16 ¤«ï tree_list
  62.         include_image_file 'tl_sys_16.png', icon_tl_sys
  63.         mov eax,dword[icon_tl_sys]
  64.         mov dword[tree1.data_img_sys],eax
  65.  
  66.         include_image_file 'objects.png', icon_toolbar
  67.         mov eax,dword[icon_toolbar]
  68.         mov dword[tree1.data_img],eax
  69.  
  70.         ;*** ãáâ ­®¢ª  ¢à¥¬¥­¨ ¤«ï â ©¬¥à 
  71.         mcall SF_SYSTEM_GET,SSF_TIME_COUNT
  72.         mov [last_time],eax
  73.  
  74.         ;call but_new_file
  75.  
  76. align 4
  77. red_win:
  78.         call draw_window
  79.  
  80. align 4
  81. still:
  82.         mcall SF_SYSTEM_GET,SSF_TIME_COUNT
  83.         mov ebx,[last_time]
  84.         add ebx,10 ;§ ¤¥à¦ª 
  85.         cmp ebx,eax
  86.         jge @f
  87.                 mov ebx,eax
  88.         @@:
  89.         sub ebx,eax
  90.         mcall SF_WAIT_EVENT_TIMEOUT
  91.         cmp eax,0
  92.         jne @f
  93.                 call timer_funct
  94.                 jmp still
  95.         @@:
  96.  
  97.         cmp al,1
  98.         jz red_win
  99.         cmp al,2
  100.         jz key
  101.         cmp al,3
  102.         jz button
  103.         cmp al,6
  104.         jne @f
  105.                 mcall SF_THREAD_INFO,procinfo,-1
  106.                 cmp ax,word[procinfo.window_stack_position]
  107.                 jne @f ;®ª­® ­¥  ªâ¨¢­®
  108.                 call mouse
  109.         @@:
  110.         jmp still
  111.  
  112. align 4
  113. mouse:
  114.         push eax ebx ecx
  115.         mcall SF_MOUSE_GET,SSF_BUTTON_EXT
  116.         bt eax,8
  117.         jnc @f
  118.                 ;mouse l. but. press
  119.                 call mouse_left_d
  120.                 jmp .end_l
  121.         @@:
  122.         ;bt eax,0
  123.         ;jnc @f
  124.                 ;mouse l. but. move
  125.                 ;call mouse_left_m
  126.                 ;jmp .end_l
  127.         ;@@:
  128.         bt eax,16
  129.         jnc .end_l
  130.                 ;mouse l. but. up
  131.                 call mouse_left_u
  132.                 ;jmp .end_l
  133.         .end_l:
  134.         bt eax,9
  135.         jnc @f
  136.                 ;mouse r. but. press
  137.                 call mouse_right_d
  138.                 ;jmp .end_r
  139.         @@:
  140.         ;bt eax,1
  141.         ;jnc @f
  142.                 ;mouse r. but. move
  143.                 ;call mouse_right_m
  144.                 ;jmp .end_r
  145.         ;@@:
  146.         ;.end_r:
  147.  
  148.         call buf_get_mouse_coord
  149.         cmp eax,-1
  150.         je .end0
  151.                 shl eax,1
  152.                 sub eax,[buf_0.w]
  153.                 sar eax,1
  154.                 mov [mouse_prop_x],eax
  155.                 stdcall [tl_node_get_data],tree1
  156.                 or eax,eax
  157.                 jz .end0
  158.                 cmp [eax+Figure.OType],'Fig'
  159.                 je @f
  160.                 cmp [eax+Figure.OType],'Obj'
  161.                 je .end1
  162.                         jmp .end0
  163.                 .end1:
  164.                         mov eax,ObjData
  165.                 @@:
  166.                 mov ecx,eax
  167.                 shl ebx,1
  168.                 sub ebx,[buf_0.h]
  169.                 sar ebx,1
  170.                 mov [mouse_prop_y],ebx
  171.  
  172.                 mcall SF_MOUSE_GET,SSF_SCROLL_DATA
  173.                 test ax,ax
  174.                 jz .end0
  175.                 finit
  176.                 fld qword[zoom_plus]
  177.                 fld1
  178.                 fsubp
  179.                 fld st0 ;for Y coord
  180.  
  181.                 ;for X coord
  182.                 fild dword[mouse_prop_x]
  183.                 fmulp st1,st0
  184.  
  185.                 mov ebx,eax
  186.                 test ax,0x8000
  187.                 jnz .decr
  188.                         ;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
  189.                         fchs
  190.                         fild dword[ecx+Figure.MCentrX] ;add old value
  191.                         fmul qword[zoom_plus]
  192.                         faddp
  193.  
  194.                         fld qword[ecx+Figure.MScale]
  195.                         fmul qword[zoom_plus]
  196.                         ;if (Figure.MScale>16.0)
  197.                         ;...
  198.                         jmp @f
  199.                 .decr:
  200.                         ;㬥­ì襭¨¥ ¬ áèâ ¡ 
  201.                         fild dword[ecx+Figure.MCentrX] ;add old value
  202.                         fdiv qword[zoom_plus]
  203.                         faddp
  204.  
  205.                         fld qword[ecx+Figure.MScale]
  206.                         fdiv qword[zoom_plus]
  207.                         fld1
  208.                         fcomp
  209.                         fstsw ax
  210.                         sahf
  211.                         jbe @f
  212.                                 ;if (Figure.MScale<1.0)
  213.                                 ffree st0
  214.                                 fincstp
  215.                                 ffree st0
  216.                                 fincstp
  217.                                 fldz ;default Figure.MCentrX
  218.                                 fld1 ;default Figure.MScale
  219.                                 mov dword[ecx+Figure.MCentrY],0
  220.                 @@:
  221.                 fstp qword[ecx+Figure.MScale]
  222.                 fistp dword[ecx+Figure.MCentrX]
  223.  
  224.                 ;for Y coord
  225.                 fild dword[mouse_prop_y]
  226.                 fmulp st1,st0
  227.                 test bx,0x8000
  228.                 jnz .decr_y
  229.                         ;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
  230.                         fild dword[ecx+Figure.MCentrY] ;add old value
  231.                         fmul qword[zoom_plus]
  232.                         faddp
  233.                         jmp @f
  234.                 .decr_y:
  235.                         ;㬥­ì襭¨¥ ¬ áèâ ¡ 
  236.                         fchs
  237.                         fild dword[ecx+Figure.MCentrY] ;add old value
  238.                         fdiv qword[zoom_plus]
  239.                         faddp
  240.                 @@:
  241.                 fistp dword[ecx+Figure.MCentrY]
  242.  
  243.                 mov dword[offs_last_timer],0
  244.         .end0:
  245.  
  246.         stdcall [tl_mouse], tree1
  247.         pop ecx ebx eax
  248.         ret
  249.  
  250. ;output:
  251. ; eax - buffer coord X (¥á«¨ ªãàá®à §  ¡ãä¥à®¬ -1)
  252. ; ebx - buffer coord Y (¥á«¨ ªãàá®à §  ¡ãä¥à®¬ -1)
  253. align 4
  254. proc buf_get_mouse_coord
  255.         mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
  256.         cmp ax,word[buf_0.t]
  257.         jl .no_buf ;­¥ ¯®¯ «¨ ¢ ®ª­® ¡ãä¥à  ¯® ®á¨ y
  258.         mov ebx,eax
  259.         shr ebx,16
  260.         cmp bx,word[buf_0.l]
  261.         jl .no_buf ;­¥ ¯®¯ «¨ ¢ ®ª­® ¡ãä¥à  ¯® ®á¨ x
  262.  
  263.         and eax,0xffff ;®áâ ¢«ï¥¬ ª®®à¤¨­ âã y
  264.         sub ax,word[buf_0.t]
  265.         cmp eax,[buf_0.h]
  266.         jg .no_buf
  267.         sub bx,word[buf_0.l]
  268.         cmp ebx,[buf_0.w]
  269.         jg .no_buf
  270.         xchg eax,ebx
  271.         jmp .end_f
  272.         .no_buf:
  273.                 xor eax,eax
  274.                 not eax
  275.                 xor ebx,ebx
  276.                 not ebx
  277.         .end_f:
  278.         ret
  279. endp
  280.  
  281. align 4
  282. proc timer_funct
  283.         pushad
  284.         mcall SF_SYSTEM_GET,SSF_TIME_COUNT
  285.         mov [last_time],eax
  286.  
  287.         ;¯à®á¬ âਢ ¥¬ ¢ë¤¥«¥­­ë© ¡«®ª ¤ ­­ëå
  288.         stdcall [tl_node_get_data],tree1
  289.         or eax,eax
  290.         jz .end_f
  291.         cmp dword[offs_last_timer],eax
  292.         je .end_f
  293.                 ;¥á«¨ ¢ë¤¥«¥­­ë© ¡«®ª ¤ ­­ëå ­¥ ᮢ¯ ¤ ¥â á ¯®á«¥¤­¨¬ § ¯®¬­¥­­ë¬
  294.                 mov dword[offs_last_timer],eax
  295.  
  296.                 stdcall get_object_data,eax
  297.                 or ecx,ecx
  298.                 jz .end_oblo
  299.                         stdcall draw_obj2d,ecx
  300.                         stdcall [buf2d_draw], buf_0
  301.                         jmp .end_f
  302.                 .end_oblo:
  303.  
  304.                 cmp [eax+Figure.OType],'Fig'
  305.                 jne .end_fblo
  306.                         stdcall draw_fig2d,eax
  307.                         stdcall [buf2d_draw], buf_0
  308.                         jmp .end_f
  309.                 .end_fblo:
  310.  
  311.         .end_f:
  312.  
  313.         popad
  314.         ret
  315. endp
  316.  
  317. align 4
  318. draw_window:
  319. pushad
  320.         mcall SF_REDRAW,SSF_BEGIN_DRAW
  321.  
  322.         ; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
  323.         mov edx,[sc.work]
  324.         or  edx,(3 shl 24)+0x10000000+0x20000000
  325.         mov edi,caption
  326.         mcall SF_CREATE_WINDOW,(20 shl 16)+599,(20 shl 16)+415
  327.  
  328.         mcall SF_THREAD_INFO,procinfo,-1
  329.         mov eax,dword[procinfo.box.height]
  330.         cmp eax,120
  331.         jge @f
  332.                 mov eax,120 ;min size
  333.         @@:
  334.         sub eax,65
  335.         mov dword[tree1.box_height],eax
  336.         mov word[w_scr_t1.y_size],ax ;­®¢ë¥ à §¬¥àë áªà®««¨­£ 
  337.         mov ebx,dword[procinfo.box.width]
  338.         cmp ebx,270
  339.         jge @f
  340.                 mov ebx,270
  341.         @@:
  342.         sub ebx,215
  343.         cmp eax,dword[buf_0.h] ;ᬮâਬ à §¬¥à ¡ãä¥à 
  344.         jne @f
  345.         cmp ebx,dword[buf_0.w]
  346.         jne @f
  347.                 jmp .end0
  348.         @@:
  349.                 stdcall [buf2d_resize],buf_0,ebx,eax,1
  350.                 mov eax,ObjData
  351.                 mov ecx,[eax+Object.FigCount]
  352.                 or ecx,ecx
  353.                 jz .end0
  354.                 mov eax,[eax+Object.FigData]
  355.                 xor edx,edx
  356.                 .cycle0:
  357.                         stdcall FigCalculateSizes,[eax+4*edx],0
  358.                         inc edx
  359.                         loop .cycle0
  360.                 stdcall ObjCalculateScale,ObjData
  361.                 mov dword[offs_last_timer],0
  362.                 call timer_funct
  363.         .end0:
  364.  
  365.         ; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
  366.         mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3,, [sc.work_button]
  367.  
  368.         mov ebx,(30 shl 16)+20
  369.         mov edx,4 ;0x4000000?
  370.         int 0x40 ;open
  371.  
  372.         add ebx,25 shl 16
  373.         mov edx,5
  374.         int 0x40 ;save
  375.  
  376.         add ebx,30 shl 16
  377.         mov edx,6
  378.         int 0x40 ;captions on off
  379.  
  380.         add ebx,25 shl 16
  381.         mov edx,7
  382.         int 0x40 ;figure move up
  383.         add ebx,25 shl 16
  384.         mov edx,8
  385.         int 0x40 ;figure move down
  386.  
  387.         add ebx,25 shl 16
  388.         mov edx,9
  389.         int 0x40 ;sel points dlg
  390.  
  391.         add ebx,25 shl 16
  392.         mov edx,10
  393.         int 0x40 ;sel points move up
  394.         add ebx,25 shl 16
  395.         mov edx,11
  396.         int 0x40 ;sel points move down
  397.  
  398.         add ebx,25 shl 16
  399.         mov edx,12
  400.         int 0x40 ;align sel points left
  401.         add ebx,25 shl 16
  402.         mov edx,13
  403.         int 0x40 ;align sel points right
  404.         add ebx,25 shl 16
  405.         mov edx,14
  406.         int 0x40 ;align sel points top
  407.         add ebx,25 shl 16
  408.         mov edx,15
  409.         int 0x40 ;align sel points bottom
  410.  
  411.         add ebx,25 shl 16
  412.         mov edx,16
  413.         int 0x40 ;copy to clipboard
  414.         add ebx,25 shl 16
  415.         mov edx,17
  416.         int 0x40 ;paste from clipboard
  417.  
  418.         add ebx,25 shl 16
  419.         mov edx,18
  420.         int 0x40 ;sel points del
  421.  
  422.         add ebx,30 shl 16
  423.         mov edx,19
  424.         int 0x40 ;restore zoom
  425.  
  426.         add ebx,30 shl 16
  427.         mov edx,20
  428.         int 0x40 ;.png
  429.  
  430.         add ebx,25 shl 16
  431.         mov edx,21
  432.         int 0x40 ;options scale
  433.  
  434.         ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
  435.         mcall SF_PUT_IMAGE,[image_data_toolbar],(16 shl 16)+16,(7 shl 16)+7 ;icon new
  436.  
  437.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  438.         add edx,(25 shl 16) ;icon open
  439.         int 0x40
  440.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  441.         add edx,(25 shl 16) ;icon save
  442.         int 0x40
  443.  
  444.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  445.         add edx,(30 shl 16) ;captions on off
  446.         int 0x40
  447.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  448.         add edx,(25 shl 16) ;figure move up
  449.         int 0x40
  450.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  451.         add edx,(25 shl 16) ;figure move down
  452.         int 0x40
  453.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  454.         add edx,(25 shl 16) ;sel points dlg
  455.         int 0x40
  456.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  457.         add edx,(25 shl 16) ;sel points move up
  458.         int 0x40
  459.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  460.         add edx,(25 shl 16) ;sel points move down
  461.         int 0x40
  462.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  463.         add edx,(25 shl 16) ;aling sel points left
  464.         int 0x40
  465.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  466.         add edx,(25 shl 16) ;aling sel points right
  467.         int 0x40
  468.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  469.         add edx,(25 shl 16) ;aling sel points top
  470.         int 0x40
  471.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  472.         add edx,(25 shl 16) ;aling sel points bottom
  473.         int 0x40
  474.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  475.         add edx,(25 shl 16) ;copy to clipboard
  476.         int 0x40
  477.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  478.         add edx,(25 shl 16) ;paste from clipboard
  479.         int 0x40
  480.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  481.         add edx,(25 shl 16) ;sel points del
  482.         int 0x40
  483.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  484.         add edx,(30 shl 16) ;restore zoom
  485.         int 0x40
  486.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  487.         add edx,(30 shl 16) ;.png
  488.         int 0x40
  489.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  490.         add edx,(25 shl 16) ;options scale
  491.         int 0x40
  492.  
  493.         mov dword[w_scr_t1.all_redraw],1
  494.         stdcall [tl_draw], tree1
  495.         stdcall [buf2d_draw], buf_0
  496.  
  497.         mcall SF_REDRAW,SSF_END_DRAW
  498. popad
  499.         ret
  500.  
  501. align 4
  502. key:
  503.         mcall SF_GET_KEY
  504.         cmp dword[el_focus], tree1
  505.         jne @f
  506.                 stdcall [tl_key], tree1
  507.                 jmp .end0
  508.         @@:
  509.        
  510.         cmp ah,178 ;Up
  511.         jne @f
  512.                 call but_selection_move_up
  513.                 jmp .end0
  514.         @@:
  515.         cmp ah,177 ;Down
  516.         jne @f
  517.                 call but_selection_move_down
  518.                 jmp .end0
  519.         @@:
  520.         cmp ah,176 ;Left
  521.         jne @f
  522.                 call but_selection_move_up
  523.                 jmp .end0
  524.         @@:
  525.         cmp ah,179 ;Right
  526.         jne @f
  527.                 call but_selection_move_down
  528.                 jmp .end0
  529.         @@:
  530.         cmp ah,182 ;Delete
  531.         jne @f
  532.                 call but_sel_points_del
  533.                 jmp .end0
  534.         @@:
  535.  
  536.         mov ecx,eax
  537.         mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS
  538.         bt eax,2 ;left Ctrl
  539.         jc .key_Ctrl
  540.         bt eax,3 ;right Ctrl
  541.         jc .key_Ctrl
  542.         jmp .end0
  543.         .key_Ctrl:
  544.                 cmp ch,15 ;111 ;Ctrl+O
  545.                 jne @f
  546.                         call but_open_file
  547.                 @@:
  548.                 cmp ch,19 ;115 ;Ctrl+S
  549.                 jne @f
  550.                         call but_save_file
  551.                 @@:
  552.                 cmp ch,14 ;110 ;Ctrl+N
  553.                 jne @f
  554.                         call but_new_file
  555.                 @@:
  556.                 cmp ch,1 ;97 ;Ctrl+A
  557.                 jne @f
  558.                         call but_sel_points_all
  559.                 @@:
  560.         .end0:
  561.         jmp still
  562.  
  563.  
  564. align 4
  565. button:
  566.         mcall SF_GET_BUTTON
  567.         cmp ah,3
  568.         jne @f
  569.                 call but_new_file
  570.                 jmp still
  571.         @@:
  572.         cmp ah,4
  573.         jne @f
  574.                 call but_open_file
  575.                 jmp still
  576.         @@:
  577.         cmp ah,5
  578.         jne @f
  579.                 call but_save_file
  580.                 jmp still
  581.         @@:
  582.         cmp ah,6
  583.         jne @f
  584.                 call but_captions_on_off
  585.                 jmp still
  586.         @@:
  587.         cmp ah,7
  588.         jne @f
  589.                 call but_sel_figure_move_up
  590.                 jmp still
  591.         @@:
  592.         cmp ah,8
  593.         jne @f
  594.                 call but_sel_figure_move_down
  595.                 jmp still
  596.         @@:
  597.         cmp ah,9
  598.         jne @f
  599.                 call but_dlg_point_coords
  600.                 jmp still
  601.         @@:
  602.         cmp ah,10
  603.         jne @f
  604.                 call but_sel_points_move_up
  605.                 jmp still
  606.         @@:
  607.         cmp ah,11
  608.         jne @f
  609.                 call but_sel_points_move_down
  610.                 jmp still
  611.         @@:
  612.         cmp ah,12
  613.         jne @f
  614.                 call but_sel_points_align_coord_xmin
  615.                 jmp still
  616.         @@:
  617.         cmp ah,13
  618.         jne @f
  619.                 call but_sel_points_align_coord_xmax
  620.                 jmp still
  621.         @@:
  622.         cmp ah,14
  623.         jne @f
  624.                 call but_sel_points_align_coord_ymax
  625.                 jmp still
  626.         @@:
  627.         cmp ah,15
  628.         jne @f
  629.                 call but_sel_points_align_coord_ymin
  630.         @@:
  631.         cmp ah,16
  632.         jne @f
  633.                 call but_clipboard_copy_points
  634.                 jmp still
  635.         @@:
  636.         cmp ah,17
  637.         jne @f
  638.                 call but_clipboard_paste_points
  639.                 jmp still
  640.         @@:
  641.         cmp ah,18
  642.         jne @f
  643.                 call but_sel_points_del
  644.                 jmp still
  645.         @@:
  646.         cmp ah,19
  647.         jne @f
  648.                 call but_restore_zoom
  649.                 jmp still
  650.         @@:
  651.         cmp ah,20
  652.         jne @f
  653.                 call but_save_png
  654.                 jmp still
  655.         @@:
  656.         cmp ah,21
  657.         jne @f
  658.                 call but_dlg_opt_scale
  659.                 jmp still
  660.         @@:
  661.  
  662.         ;cmp ah,22
  663.         ;jne @f
  664.                 ;call but_...
  665.                 ;jmp still
  666.         ;@@:
  667.         cmp ah,1
  668.         jne still
  669. .exit:
  670.         stdcall [buf2d_delete],buf_0
  671.         stdcall mem.Free,[image_data_toolbar]
  672.         stdcall mem.Free,[open_file_data]
  673.         mcall SF_TERMINATE_PROCESS
  674.  
  675.  
  676. align 4
  677. but_new_file:
  678.         cmp byte[wnd_n_file],0
  679.         jne .end_f
  680. pushad
  681.         mcall SF_CREATE_THREAD,1,start_n_file,thread_n_file
  682. popad
  683.         .end_f:
  684.         ret
  685.  
  686. align 4
  687. open_file_data dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢
  688. open_file_size dd 0 ;à §¬¥à ®âªàë⮣® ä ©« 
  689.  
  690. align 4
  691. but_open_file:
  692.         pushad
  693.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  694.         mov [OpenDialog_data.type],0
  695.         stdcall [OpenDialog_Start],OpenDialog_data
  696.         cmp [OpenDialog_data.status],2
  697.         je .end_open_file
  698.         ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  699.  
  700.         mov [run_file_70.Function], SSF_GET_INFO
  701.         mov [run_file_70.Position], 0
  702.         mov [run_file_70.Flags], 0
  703.         mov dword[run_file_70.Count], 0
  704.         mov dword[run_file_70.Buffer], open_b
  705.         mov byte[run_file_70+20], 0
  706.         mov dword[run_file_70.FileName], openfile_path
  707.         mcall SF_FILE,run_file_70
  708.  
  709.         mov ecx,dword[open_b+32] ;+32 qword: à §¬¥à ä ©«  ¢ ¡ ©â å
  710.         inc ecx ;for text files
  711.         stdcall mem.ReAlloc,[open_file_data],ecx
  712.         mov [open_file_data],eax
  713.         dec ecx ;for text files
  714.         mov byte[eax+ecx],0 ;for text files
  715.  
  716.         mov [run_file_70.Function], SSF_READ_FILE
  717.         mov [run_file_70.Position], 0
  718.         mov [run_file_70.Flags], 0
  719.         mov dword[run_file_70.Count], ecx
  720.         m2m dword[run_file_70.Buffer], dword[open_file_data]
  721.         mov byte[run_file_70+20], 0
  722.         mov dword[run_file_70.FileName], openfile_path
  723.         mcall SF_FILE,run_file_70 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  724.         test eax,eax
  725.         jnz .end_open_file
  726.         cmp ebx,0xffffffff
  727.         je .end_open_file
  728.  
  729.                 mov [open_file_size],ebx
  730.                 mcall SF_SET_CAPTION,1,openfile_path
  731.  
  732.                 ;---
  733.                 stdcall FileInit,[open_file_data],[open_file_size]
  734.                 stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  735.                 stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  736.         .end_open_file:
  737.         popad
  738.         ret
  739.  
  740. align 4
  741. proc but_save_file
  742. locals
  743.         pCou dd ?
  744.         pData dd ?
  745. endl
  746.         pushad
  747.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  748.         mov [OpenDialog_data.type],1
  749.         stdcall [OpenDialog_Start],OpenDialog_data
  750.         cmp [OpenDialog_data.status],2
  751.         je .end_save_file
  752.         ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  753.  
  754.         ;*** ®¯à¥¤¥«¥­¨¥ ¯à¨¬¥à­®£® à §¬¥à  ä ©« 
  755.         call get_file_save_size
  756.         stdcall mem.ReAlloc,[open_file_data],ecx
  757.         mov [open_file_data],eax
  758.         mov [open_file_size],ecx
  759.  
  760.         ;clear memory
  761.         mov edi,eax
  762.         xor eax,eax
  763.         shr ecx,2
  764.         rep stosd
  765.        
  766.         ;*** ¯¨è¥¬ ¨­ä®à¬ æ¨î ¢ ¯ ¬ïâì
  767.         mov edi,[open_file_data]
  768.         mov ebx,ObjData
  769.         mov edx,[ebx+Object.FigCount]
  770.         or edx,edx
  771.         jz .cycle1end
  772.         mov esi,[ebx+Object.FigData]
  773. align 4
  774.         .cycle1: ;横« ¯® 䨣ãà ¬
  775.                 ;param 1
  776.                 mov eax,[esi]
  777.                 or eax,eax
  778.                 jz .err_save
  779.                 mov eax,[eax+Figure.PoiCount]
  780.                 mov [pCou],eax
  781.                 or eax,eax
  782.                 jnz @f
  783.                         mov eax,[esi]
  784.                         lea eax,[eax+Figure.Caption]
  785.                         stdcall str_cat,edi,eax
  786.                         stdcall str_len,edi
  787.                         add edi,eax
  788.                         stdcall str_cat,edi,txt_nl
  789.                 @@:
  790.                 cmp dword[pCou],0
  791.                 je .cycle2end
  792.                 mov eax,[esi]
  793.                 mov eax,[eax+Figure.PoiData]
  794.                 mov [pData],eax
  795.                 mov word[NumberSymbolsAD],8
  796. align 4
  797.                 .cycle2: ;横« ¯® â®çª ¬
  798.                         stdcall str_cat,edi,txt_s_poi
  799.                         ;param 1
  800.                         push edi esi
  801.                         mov esi,[pData]
  802.                         lea esi,[esi+Point.CoordX]
  803.                         mov edi,Data_Double
  804.                         movsd
  805.                         movsd
  806.                         pop esi edi
  807.                         call DoubleFloat_to_String
  808.                         call String_crop_0
  809.                         stdcall str_cat,edi,Data_String
  810.                         stdcall str_cat,edi,txt_s_poi_Y
  811.                         ;param 2
  812.                         push edi esi
  813.                         mov esi,[pData]
  814.                         lea esi,[esi+Point.CoordY]
  815.                         mov edi,Data_Double
  816.                         movsd
  817.                         movsd
  818.                         pop esi edi
  819.                         call DoubleFloat_to_String
  820.                         call String_crop_0
  821.                         stdcall str_cat,edi,Data_String
  822.                         ;
  823.                         stdcall str_cat,edi,txt_nl
  824.                         add dword[pData],sizeof.Point
  825.                         dec dword[pCou]
  826.                         jnz .cycle2
  827.                 .cycle2end:
  828.                 add esi,4
  829.                 dec edx
  830.                 jnz .cycle1
  831.         .cycle1end:
  832.        
  833.         jmp @f
  834.         .err_save:
  835.                 notify_window_run txt_err_save_txt_file_1
  836.         @@:
  837.  
  838.         ;*** ®¯à¥¤¥«¥­¨¥ ¯ à ¬¥â஢ ä ©« 
  839.         mov edi,[open_file_data]
  840.         stdcall str_len,edi
  841.         ;;cmp eax,[open_file_size]
  842.         mov [run_file_70.Count],eax ;à §¬¥à ä ©« 
  843.  
  844.         ;*** á®å࠭塞 ä ©«
  845.         mov [run_file_70.Function], SSF_CREATE_FILE
  846.         mov [run_file_70.Position], 0
  847.         mov [run_file_70.Flags], 0
  848.         mov ebx, dword[open_file_data]
  849.         mov [run_file_70.Buffer], ebx
  850.         mov byte[run_file_70+20], 0
  851.         mov dword[run_file_70.FileName], openfile_path
  852.         mcall SF_FILE,run_file_70
  853.         or eax,eax
  854.         jz .end_save_file
  855.         or ebx,ebx
  856.         jnz .end_save_file
  857.                 ;á®®¡é¥­¨¥ ® ­¥ã¤ ç­®¬ á®åà ­¥­¨¨
  858.                 notify_window_run txt_err_save_txt_file_0
  859.         .end_save_file:
  860.         popad
  861.         ret
  862. endp
  863.  
  864. ;output:
  865. ; ecx - memory size for save file
  866. align 4
  867. proc get_file_save_size uses eax ebx edx esi
  868.         mov ecx,100 ;title
  869.         mov ebx,ObjData
  870.         add ecx,50 ;object
  871.         mov edx,[ebx+Object.FigCount]
  872.         or edx,edx
  873.         jz .cycle1end
  874.         mov esi,[ebx+Object.FigData]
  875. align 4
  876.         .cycle1: ; 横« ¯® 䨣ãà ¬
  877.                 add ecx,80 ;figure
  878.                 mov eax,[esi]
  879.                 or eax,eax
  880.                 jz @f
  881.                         mov eax,[eax+Figure.PoiCount]
  882.                         imul eax,70
  883.                         add ecx,eax ;points
  884.                 @@:
  885.                 add esi,4
  886.                 dec edx
  887.                 jnz .cycle1
  888.         .cycle1end:
  889.         ret
  890. endp
  891.  
  892. align 4
  893. but_captions_on_off:
  894.         xor dword[opt_draw],1
  895.         mov dword[offs_last_timer],0 ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
  896.         ret
  897.  
  898. align 4
  899. but_sel_figure_move_up:
  900.         pushad
  901.         stdcall [tl_node_get_data],tree1
  902.         or eax,eax
  903.         jz .end_fblo
  904.         cmp [eax+Figure.OType],'Fig'
  905.         jne .end_fblo
  906.                 stdcall found_parent_obj,eax
  907.                 or eax,eax
  908.                 jz .end_f ;if not found
  909.                 or ecx,ecx
  910.                 jz .fig_is_0 ;¥á«¨ 䨣ãà  ¢ ­ ç «¥ ᯨ᪠
  911.                 mov ebx,[eax+Object.FigData]
  912.                 mov edx,[ebx+4*ecx] ;¯¥à¥¤¢¨£ ¥¬ ï 䨣ãà 
  913.                 mov edi,[ebx+4*ecx-4]
  914.                 ;¬¥­ï¥¬ 䨣ãàë ¬¥áâ ¬¨
  915.                 mov [ebx+4*ecx],edi
  916.                 mov [ebx+4*ecx-4],edx
  917.                 ;¬¥­ï¥¬ 䨣ãàë ¢ ᯨ᪥
  918.                 stdcall [tl_node_move_up],tree1
  919.                 jmp .end_f
  920.         .fig_is_0:
  921.                 notify_window_run txt_err_figure_is_0
  922.                 jmp .end_f
  923.         .end_fblo:
  924.                 notify_window_run txt_err_no_figure_select
  925.         .end_f:
  926.         popad
  927.         ret
  928.  
  929. align 4
  930. but_save_png:
  931.         pushad
  932.         stdcall [tl_node_get_data],tree1
  933.         or eax,eax
  934.         jz .end_save_file
  935.  
  936.         stdcall get_object_data,eax
  937.         or ecx,ecx
  938.         jz .end_oblo
  939.                 stdcall draw_obj2d_png,ecx
  940.                 jmp .beg0
  941.         .end_oblo:
  942.  
  943. ;       cmp [eax+Figure.OType],'Fig'
  944. ;       jne .end_fblo
  945. ;               stdcall draw_fig2d_png,eax
  946. ;               jmp .beg0
  947. ;       .end_fblo:
  948.  
  949.         jmp .end_save_file
  950.         .beg0:
  951.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  952.         mov [OpenDialog_data.type],1
  953.         stdcall [OpenDialog_Start],OpenDialog_data
  954.         cmp [OpenDialog_data.status],2
  955.         je .end_save_file
  956.                 ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  957.                 mov dword[png_data],0
  958.  
  959.                 ;create image struct
  960.                 stdcall [img_create], [buf_png.w], [buf_png.h], Image.bpp24
  961.                 mov ebx,eax
  962.                 test eax,eax
  963.                 jz @f
  964.                         ;copy foto to image buffer
  965.                         mov edi,[eax+Image.Data]
  966.                         mov esi,[buf_png]
  967.                         mov ecx,[buf_png.w]
  968.                         mov edx,[buf_png.h]
  969.                         imul ecx,edx
  970.                         imul ecx,3
  971.                         shr ecx,2 ;OpenGL buffer align to 4
  972.                         rep movsd
  973.  
  974.                         ;encode image
  975.                         stdcall [img_encode], eax, LIBIMG_FORMAT_PNG, 0
  976.                         test eax,eax
  977.                         jz @f
  978.                                 mov [png_data],eax
  979.                                 mov [png_size],ecx
  980.                 @@:
  981.                 stdcall [img_destroy],ebx
  982.  
  983.         ; § ¯®«­ï¥¬ áâàãªâãàã ¤«ï á®åà ­¥­¨ï ä ©« 
  984.         mov ebx,run_file_70
  985.         mov dword[ebx],SSF_CREATE_FILE
  986.         mov eax,[png_size]
  987.         mov [ebx+12],eax ;file size
  988.         mov eax,[png_data]
  989.         mov [ebx+16],eax
  990.         mov dword[ebx+FileInfoBlock.FileName], openfile_path
  991.  
  992.         mcall SF_FILE,run_file_70
  993.         test eax,eax
  994.         jnz .save_error
  995.                         ;notify_window_run openfile_path
  996.                         jmp @f
  997.                 .save_error:
  998.                         ;á®®¡é¥­¨¥ ® ­¥ã¤ ç­®¬ á®åà ­¥­¨¨
  999.                         notify_window_run txt_err_save_img_file
  1000.                 @@:
  1001.                 mcall SF_SYS_MISC, SSF_MEM_FREE, [png_data]
  1002.         .end_save_file:
  1003.         popad
  1004.         ret
  1005.  
  1006. ;description:
  1007. ; ¢ë¤¥«¥­­ë¥ â®çª¨ ᤢ¨£ îâáï ¢¢¥àå
  1008. align 4
  1009. proc but_sel_points_move_up
  1010. locals
  1011.         pObj dd ?
  1012.         pFig dd ?
  1013.         idFig dd ?
  1014. endl
  1015.         pushad
  1016.         stdcall [tl_node_get_data],tree1
  1017.         or eax,eax
  1018.         jz .no_point
  1019.         cmp [eax+Figure.OType],'Fig'
  1020.         jne .no_point
  1021.  
  1022.         mov [pFig],eax
  1023.         stdcall sel_points_get_count,eax
  1024.         or eax,eax
  1025.         jz .no_point
  1026.  
  1027.         stdcall found_parent_obj,[pFig]
  1028.         or eax,eax
  1029.         jz .end_f ;if not found
  1030.         mov [pObj],eax
  1031.         mov [idFig],ecx
  1032.  
  1033.         ;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
  1034.         mov eax,[pFig]
  1035.         mov ecx,[eax+Figure.PoiCount]
  1036.         or ecx,ecx
  1037.         jz .no_point
  1038.         mov ebx,[eax+Figure.PoiData]
  1039.         xor eax,eax
  1040.         .cycle0:
  1041.                 bt dword[ebx+Point.Prop],PROP_BIT_SELECT
  1042.                 jnc @f
  1043.                         or eax,eax
  1044.                         jz .point_is_0
  1045.                         stdcall point_move_up, [pObj],[pFig],[idFig],ebx;,eax
  1046.                 @@:
  1047.                 inc eax
  1048.                 add ebx,sizeof.Point
  1049.                 loop .cycle0
  1050.  
  1051.                 ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
  1052.                 mov dword[offs_last_timer],0
  1053.                 jmp .end_f
  1054.         .point_is_0:
  1055.                 notify_window_run txt_err_poi_is_0
  1056.                 jmp .end_f
  1057.         .no_point:
  1058.                 notify_window_run txt_err_no_point_sel
  1059.         .end_f:
  1060.         popad
  1061.         ret
  1062. endp
  1063.  
  1064. ;description:
  1065. ; ¢ë¤¥«¥­­ë¥ â®çª¨ ᤢ¨£ îâáï ¢­¨§
  1066. align 4
  1067. proc but_sel_points_move_down
  1068. locals
  1069.         pObj dd ?
  1070.         pFig dd ?
  1071.         idFig dd ?
  1072. endl
  1073.         pushad
  1074.         stdcall [tl_node_get_data],tree1
  1075.         or eax,eax
  1076.         jz .no_point
  1077.         cmp [eax+Figure.OType],'Fig'
  1078.         jne .no_point
  1079.  
  1080.         mov [pFig],eax
  1081.         stdcall sel_points_get_count,eax
  1082.         or eax,eax
  1083.         jz .no_point
  1084.  
  1085.         stdcall found_parent_obj,[pFig]
  1086.         or eax,eax
  1087.         jz .end_f ;if not found
  1088.         mov [pObj],eax
  1089.         mov [idFig],ecx
  1090.  
  1091.         ;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
  1092.         mov eax,[pFig]
  1093.         mov ecx,[eax+Figure.PoiCount]
  1094.         or ecx,ecx
  1095.         jz .no_point
  1096.         mov ebx,ecx
  1097.         dec ebx
  1098.         imul ebx,sizeof.Point
  1099.         add ebx,[eax+Figure.PoiData]
  1100.         .cycle0:
  1101.                 bt dword[ebx+Point.Prop],PROP_BIT_SELECT
  1102.                 jnc @f
  1103.                         cmp ecx,[eax+Figure.PoiCount]
  1104.                         je .point_is_last
  1105.                         mov edi,ebx
  1106.                         add edi,sizeof.Point
  1107.                         stdcall point_move_up, [pObj],[pFig],[idFig],edi;,ecx
  1108.                 @@:
  1109.                 sub ebx,sizeof.Point
  1110.                 loop .cycle0
  1111.  
  1112.                 ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
  1113.                 mov dword[offs_last_timer],0
  1114.                 jmp .end_f
  1115.         .point_is_last:
  1116.                 notify_window_run txt_err_poi_is_last
  1117.                 jmp .end_f
  1118.         .no_point:
  1119.                 notify_window_run txt_err_no_point_sel
  1120.         .end_f:
  1121.         popad
  1122.         ret
  1123. endp
  1124.  
  1125. ;description:
  1126. ; ¢ë¤¥«¥­¨¥ ¢ë¡à ­­®© â®çª¨ ᤢ¨£ ¥âáï ¢¢¥àå
  1127. align 4
  1128. proc but_selection_move_up
  1129. locals
  1130.         pFig dd ?
  1131. endl
  1132.         pushad
  1133.         stdcall [tl_node_get_data],tree1
  1134.         or eax,eax
  1135.         jz .end_fblo
  1136.         cmp [eax+Figure.OType],'Fig'
  1137.         jne .end_fblo
  1138.  
  1139.         mov [pFig],eax
  1140.         stdcall sel_points_get_count,eax
  1141.         cmp eax,1
  1142.         jne .no_point
  1143.  
  1144.         ;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
  1145.         mov eax,[pFig]
  1146.         mov ecx,[eax+Figure.PoiCount]
  1147.         or ecx,ecx
  1148.         jz .no_point
  1149.         dec ecx
  1150.         jecxz .end_f
  1151.         mov ebx,[eax+Figure.PoiData]
  1152.         .cycle0:
  1153.                 add ebx,sizeof.Point
  1154.                 bt dword[ebx+Point.Prop],PROP_BIT_SELECT
  1155.                 jnc @f
  1156.                         btr dword[ebx+Point.Prop],PROP_BIT_SELECT
  1157.                         bts dword[ebx+Point.Prop-sizeof.Point],PROP_BIT_SELECT
  1158.                         xor ecx,ecx
  1159.                         inc ecx ;ecx = 1 - for exit from cycle
  1160.                 @@:
  1161.                 loop .cycle0
  1162.  
  1163.                 ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
  1164.                 mov dword[offs_last_timer],0
  1165.                 jmp .end_f
  1166.         .no_point:
  1167.                 notify_window_run txt_err_no_point_sel_1
  1168.                 jmp .end_f
  1169.         .end_fblo:
  1170.                 ;notify_window_run txt_err_no_figure_select
  1171.         .end_f:
  1172.         popad
  1173.         ret
  1174. endp
  1175.  
  1176. ;description:
  1177. ; ¢ë¤¥«¥­¨¥ ¢ë¡à ­­®© â®çª¨ ᤢ¨£ ¥âáï ¢­¨§
  1178. align 4
  1179. proc but_selection_move_down
  1180. locals
  1181.         pFig dd ?
  1182. endl
  1183.         pushad
  1184.         stdcall [tl_node_get_data],tree1
  1185.         or eax,eax
  1186.         jz .end_fblo
  1187.         cmp [eax+Figure.OType],'Fig'
  1188.         jne .end_fblo
  1189.  
  1190.         mov [pFig],eax
  1191.         stdcall sel_points_get_count,eax
  1192.         cmp eax,1
  1193.         jne .no_point
  1194.  
  1195.         ;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
  1196.         mov eax,[pFig]
  1197.         mov ecx,[eax+Figure.PoiCount]
  1198.         or ecx,ecx
  1199.         jz .no_point
  1200.         dec ecx
  1201.         jecxz .end_f
  1202.         mov ebx,[eax+Figure.PoiData]
  1203.         .cycle0:
  1204.                 bt dword[ebx+Point.Prop],PROP_BIT_SELECT
  1205.                 jnc @f
  1206.                         btr dword[ebx+Point.Prop],PROP_BIT_SELECT
  1207.                         bts dword[ebx+Point.Prop+sizeof.Point],PROP_BIT_SELECT
  1208.                         xor ecx,ecx
  1209.                         inc ecx ;ecx = 1 - for exit from cycle
  1210.                 @@:
  1211.                 add ebx,sizeof.Point
  1212.                 loop .cycle0
  1213.  
  1214.                 ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
  1215.                 mov dword[offs_last_timer],0
  1216.                 jmp .end_f
  1217.         .no_point:
  1218.                 notify_window_run txt_err_no_point_sel_1
  1219.                 jmp .end_f
  1220.         .end_fblo:
  1221.                 ;notify_window_run txt_err_no_figure_select
  1222.         .end_f:
  1223.         popad
  1224.         ret
  1225. endp
  1226.  
  1227. ;output:
  1228. ; eax - couunt new points
  1229. align 4
  1230. proc but_clipboard_copy_points uses ebx ecx edx edi esi
  1231. locals
  1232.         pData dd 0
  1233.         pBuf dd 0
  1234. endl
  1235.         stdcall [tl_node_get_data],tree1
  1236.         or eax,eax
  1237.         jz .no_point
  1238.         cmp [eax+Figure.OType],'Fig'
  1239.         jne .no_point
  1240.  
  1241.         mov ecx,[eax+Figure.PoiData]
  1242.         mov [pData],ecx
  1243.         mov ecx,[eax+Figure.PoiCount]
  1244.         stdcall sel_points_get_count,eax
  1245.         or eax,eax
  1246.         jz .no_point
  1247.         push eax
  1248.                 imul eax,32 ;for string 'X___.________ Y___.________^^'
  1249.                 stdcall mem.Alloc,eax
  1250.                 mov [pBuf],eax
  1251.  
  1252.                 mov edx,eax
  1253.                 mov dword[edx+4],0 ;text data
  1254.                 mov dword[edx+8],1 ;code 866
  1255.                 add edx,12 ;system buffer header size
  1256.                 mov dword[edx],0
  1257.                 mov word[NumberSymbolsAD],8
  1258. align 4
  1259.                 .cycle2: ;横« ¯® â®çª ¬
  1260.                         mov esi,[pData]
  1261.                         bt dword[esi+Point.Prop],PROP_BIT_SELECT
  1262.                         jnc .end0
  1263.                         stdcall str_cat,edx,txt_s_poi
  1264.                         ;param 1
  1265.                         add esi,Point.CoordX
  1266.                         mov edi,Data_Double
  1267.                         movsd
  1268.                         movsd
  1269.                         call DoubleFloat_to_String
  1270.                         call String_crop_0
  1271.                         stdcall str_cat,edx,Data_String
  1272.                         stdcall str_cat,edx,txt_s_poi_Y
  1273.                         ;param 2
  1274.                         ;;mov esi,[pData]
  1275.                         ;;lea esi,[esi+Point.CoordY]
  1276.                         mov edi,Data_Double
  1277.                         movsd
  1278.                         movsd
  1279.                         call DoubleFloat_to_String
  1280.                         call String_crop_0
  1281.                         stdcall str_cat,edx,Data_String
  1282.                         ;
  1283.                         stdcall str_cat,edx,txt_nl
  1284.                         .end0:
  1285.                         add dword[pData],sizeof.Point
  1286.                         loop .cycle2
  1287.                 .cycle2end:
  1288.  
  1289.                 mov edx,[pBuf]
  1290.                 add edx,12
  1291.                 stdcall str_len,edx
  1292.                 sub edx,12
  1293.                 mov [edx],eax
  1294.                 add eax,12
  1295.                 mov ecx,eax
  1296.                 mcall SF_CLIPBOARD,SSF_WRITE_CB ;,ecx,edx
  1297.                 stdcall mem.Free,[pBuf]
  1298.         pop eax
  1299.  
  1300.         .no_point:
  1301.         ret
  1302. endp
  1303.  
  1304. ;output:
  1305. ; eax - couunt new points
  1306. align 4
  1307. proc but_clipboard_paste_points uses ebx ecx edx esi edi
  1308. locals
  1309.         pFig dd ?
  1310.         nCount dd ?
  1311. endl
  1312.         stdcall [tl_node_get_data],tree1
  1313.         or eax,eax
  1314.         jz .end0
  1315.         cmp [eax+Figure.OType],'Fig'
  1316.         jne .end0
  1317.  
  1318.         mov [pFig],eax
  1319.  
  1320.         mcall SF_CLIPBOARD,SSF_GET_SLOT_COUNT
  1321.         cmp eax,1
  1322.         jl .end0
  1323.  
  1324.         mov esi,eax
  1325.         .cycle0: ;®¡à â­ë© 横« ¯® ᫮⠬
  1326.         dec esi ;­®¬¥à ⥪ã饣®, ¯à®¢¥à塞®£® á«®â 
  1327.         mcall SF_CLIPBOARD,SSF_READ_CB,esi
  1328.         cmp eax,1
  1329.         je .end0
  1330.         cmp eax,-1
  1331.         je .end0
  1332.                 mov ecx,dword[eax]
  1333.                 cmp ecx,5 ;min text size
  1334.                 jl .end0
  1335.                 cmp dword[eax+4],0 ;text
  1336.                 je @f
  1337.                         cmp esi,1
  1338.                         jge .cycle0 ;¥á«¨ ¢ ¡ãä¥à¥ ­¥ ⥪áâ,   ᫮⮢ ¢ ¡ãä¥à¥ ­¥áª®«ìª®, ¯à®¡ã¥¬ ¯¥à¥©â¨ ª ¢¥àå­¥¬ã á«®âã
  1339.                         jmp .end0
  1340.                 @@:
  1341.  
  1342.         mov esi,eax
  1343.         add esi,12 ;ᬥ饭¨¥ ­ ç «  ⥪áâ  ¢ ¡ãä¥à¥
  1344.         stdcall get_max_points
  1345.         or eax,eax
  1346.         jz .end_f
  1347.                 mov [nCount],eax
  1348.                 mov ebx,[pFig]
  1349.                 mov edi,[ebx+Figure.PoiCount]
  1350.                 add [ebx+Figure.PoiCount],eax
  1351.                 add eax,edi
  1352.                 imul eax,sizeof.Point
  1353.                 stdcall mem.ReAlloc,[ebx+Figure.PoiData],eax
  1354.                 mov [ebx+Figure.PoiData],eax
  1355.  
  1356.                 mov ecx,edi
  1357.                 mov edx,eax
  1358. align 4
  1359.                 .cycle1: ;横« ¤«ï á­ïâ¨ï ¢ë¤¥«¥­¨ï á® áâ àëå â®ç¥ª
  1360.                         btr dword[edx+Point.Prop],PROP_BIT_SELECT
  1361.                         add edx,sizeof.Point
  1362.                         loop .cycle1
  1363.  
  1364.                 mov ecx,[nCount]
  1365.                 imul edi,sizeof.Point
  1366.                 add edi,eax
  1367.                 finit
  1368. align 4
  1369.                 .cycle2: ;横« ¤«ï ¤®¡ ¢«¥­¨ï ­®¢ëå â®ç¥ª
  1370.                         stdcall PointInit,edi
  1371.                         or eax,eax
  1372.                         jz .cycle2end
  1373.                         bts dword[edi+Point.Prop],PROP_BIT_SELECT
  1374.                         add edi,sizeof.Point
  1375.                         loop .cycle2
  1376.                 .cycle2end:
  1377.                 or ecx,ecx
  1378.                 jz .end1
  1379.                         ;㬥­ìè ¥¬ ®¡ê¥¬ ¯ ¬ï⨠¢ë¤¥«¥­­ë© ¤«ï â®ç¥ª
  1380.                         sub [ebx+Figure.PoiCount],ecx
  1381.                         mov eax,[ebx+Figure.PoiCount]
  1382.                         imul eax,sizeof.Point
  1383.                         stdcall mem.ReAlloc,[ebx+Figure.PoiData],eax
  1384.                         mov [ebx+Figure.PoiData],eax
  1385.                 .end1:
  1386.                 stdcall found_parent_obj,ebx ;get figure number in ecx
  1387.                 stdcall figure_update_coords,ObjData,ecx
  1388.                
  1389.                 mov eax,[nCount]
  1390.                 mov dword[offs_last_timer],0
  1391.                 jmp .end_f
  1392.         .end0:
  1393.                 xor eax,eax
  1394.         .end_f:
  1395.         ret
  1396. endp
  1397.  
  1398. align 4
  1399. proc but_sel_points_del
  1400. locals
  1401.         pFig dd ?
  1402.         nDel dd ? ;need delete
  1403. endl
  1404.         pushad
  1405.         stdcall [tl_node_get_data],tree1
  1406.         or eax,eax
  1407.         jz .no_point
  1408.         cmp [eax+Figure.OType],'Fig'
  1409.         jne .no_point
  1410.  
  1411.         mov [pFig],eax
  1412.         stdcall sel_points_get_count,eax
  1413.         or eax,eax
  1414.         jz .no_point
  1415.         mov [nDel],eax
  1416.  
  1417.         ;¯à®¢¥à塞 ¢ë¤¥«¥­­ë¥ â®çª¨
  1418.         mov ebx,[pFig]
  1419.         mov ecx,[ebx+Figure.PoiCount]
  1420.         or ecx,ecx
  1421.         jz .no_point
  1422.  
  1423.         cmp ecx,eax
  1424.         jle .no_all
  1425.  
  1426.         stdcall found_parent_obj,[pFig]
  1427.         or eax,eax
  1428.         jz .end_f ;if not found
  1429.                 mov edi,[ebx+Figure.PoiData]
  1430.                 mov edx,[ebx+Figure.PoiCount]
  1431.                 imul edx,sizeof.Point
  1432.                 add edx,edi
  1433.  
  1434.                 .cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
  1435.                         cmp edi,edx
  1436.                         jge .end0
  1437.                         bt dword[edi+Point.Prop],PROP_BIT_SELECT
  1438.                         jc .cycle0end
  1439.                                 add edi,sizeof.Point
  1440.                                 jmp .cycle0
  1441.                 .cycle0end:
  1442.  
  1443.                 mov esi,edi ;á«¥¤ãé ï 1-ï ­¥ ¢ë¤¥«¥­­ ï â®çª 
  1444.                 add esi,sizeof.Point
  1445.                 .cycle1:
  1446.                         cmp esi,edx
  1447.                         jge .end0
  1448.                         bt dword[esi+Point.Prop],PROP_BIT_SELECT
  1449.                         jnc .cycle1end
  1450.                                 add esi,sizeof.Point
  1451.                                 jmp .cycle1
  1452.                 .cycle1end:
  1453.  
  1454.                 mov ecx,sizeof.Point
  1455.                 rep movsb ;§ ¬¥­  ¢ë¤¥«¥­­®© â®çª¨
  1456.                 bts dword[esi+Point.Prop-sizeof.Point],PROP_BIT_SELECT ;áâ ¢¨¬ ¢ë¤¥«¥­¨¥ ­  â®çªã, çâ®-¡ë ¯®â®¬ ¥¥ 㤠«¨âì
  1457.  
  1458.                 jmp .cycle0
  1459.                 .end0:
  1460.  
  1461.                 ;®¡­®¢«¥­¨¥ ¯ ¬ïâ¨
  1462.                 mov eax,[ebx+Figure.PoiCount]
  1463.                 sub eax,[nDel]
  1464.                 mov [ebx+Figure.PoiCount],eax
  1465.                 imul eax,sizeof.Point
  1466.                 stdcall mem.ReAlloc,[ebx+Figure.PoiData],eax
  1467.                 mov [ebx+Figure.PoiData],eax
  1468.  
  1469.                 ;¯¥à¥à áç¥â à §¬¥à®¢ 䨣ãàë
  1470.                 stdcall found_parent_obj,ebx ;get figure number in ecx
  1471.                 stdcall figure_update_coords,ObjData,ecx
  1472.  
  1473.                 ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
  1474.                 mov dword[offs_last_timer],0
  1475.                 jmp .end_f
  1476.  
  1477.         .no_all:
  1478.                 notify_window_run txt_err_no_point_del
  1479.                 jmp .end_f
  1480.         .no_point:
  1481.                 notify_window_run txt_err_no_point_sel
  1482.         .end_f:
  1483.         popad
  1484.         ret
  1485. endp
  1486.  
  1487. align 4
  1488. proc but_sel_points_all uses eax ecx
  1489.         stdcall [tl_node_get_data],tree1
  1490.         or eax,eax
  1491.         jz .no_point
  1492.         cmp [eax+Figure.OType],'Fig'
  1493.         jne .no_point
  1494.  
  1495.         mov ecx,[eax+Figure.PoiCount]
  1496.         or ecx,ecx
  1497.         jz .no_point
  1498.         mov eax,[eax+Figure.PoiData]
  1499.         .cycle0: ;横« ¤«ï ¢ë¤¥«¥­­¨ï â®ç¥ª
  1500.                 bts dword[eax+Point.Prop],PROP_BIT_SELECT
  1501.                 add eax,sizeof.Point
  1502.                 loop .cycle0
  1503.         ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
  1504.         mov dword[offs_last_timer],0
  1505.         .no_point:
  1506.         ret
  1507. endp
  1508.  
  1509. align 4
  1510. proc but_sel_points_align_coord_xmin
  1511. pushad
  1512.         stdcall [tl_node_get_data],tree1
  1513.         or eax,eax
  1514.         jz .no_point
  1515.         cmp [eax+Figure.OType],'Fig'
  1516.         jne .no_point
  1517.  
  1518.         mov ebx,eax
  1519.         stdcall sel_points_get_count,eax
  1520.         cmp eax,1
  1521.         jle .no_point
  1522.         mov ecx,[ebx+Figure.PoiCount]
  1523.         or ecx,ecx
  1524.         jz .no_point
  1525.         cmp eax,ecx
  1526.         je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
  1527.  
  1528.         mov edx,ecx
  1529.         imul edx,sizeof.Point
  1530.         mov ebx,[ebx+Figure.PoiData]
  1531.         add edx,ebx
  1532. align 4
  1533.         .cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
  1534.                 cmp ebx,edx
  1535.                 jge .no_point
  1536.                 bt dword[ebx+Point.Prop],PROP_BIT_SELECT
  1537.                 jc .cycle0end
  1538.                 add ebx,sizeof.Point
  1539.                 jmp .cycle0
  1540.         .cycle0end:
  1541.         lea esi,[ebx+Point.CoordX]
  1542.         mov edi,Data_Double
  1543.         movsd
  1544.         movsd
  1545.         finit
  1546.         fld qword[Data_Double]
  1547. align 4
  1548.         .cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï min(Point.CoordX)
  1549.                 bt dword[ebx+Point.Prop],PROP_BIT_SELECT
  1550.                 jnc .no_sel
  1551.                         fcom qword[ebx+Point.CoordX]
  1552.                         fstsw ax
  1553.                         sahf
  1554.                         jbe .no_sel
  1555.                                 ;if (st0>Point.CoordX)
  1556.                                 ffree st0
  1557.                                 fincstp
  1558.                                 fld qword[ebx+Point.CoordX]
  1559.                 .no_sel:
  1560.                 add ebx,sizeof.Point
  1561.                 cmp ebx,edx
  1562.                 jl .cycle1
  1563.         fstp qword[Data_Double]
  1564. align 4
  1565.         .cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordX = min(Point.CoordX)
  1566.                 sub edx,sizeof.Point
  1567.                 bt dword[edx+Point.Prop],PROP_BIT_SELECT
  1568.                 jnc @f
  1569.                         mov esi,Data_Double
  1570.                         lea edi,[edx+Point.CoordX]
  1571.                         movsd
  1572.                         movsd
  1573.                 @@:
  1574.                 loop .cycle2
  1575.         ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
  1576.         mov dword[offs_last_timer],0
  1577.         .no_point:
  1578. popad
  1579.         ret
  1580. endp
  1581.  
  1582. align 4
  1583. proc but_sel_points_align_coord_ymin
  1584. pushad
  1585.         stdcall [tl_node_get_data],tree1
  1586.         or eax,eax
  1587.         jz .no_point
  1588.         cmp [eax+Figure.OType],'Fig'
  1589.         jne .no_point
  1590.  
  1591.         mov ebx,eax
  1592.         stdcall sel_points_get_count,eax
  1593.         cmp eax,1
  1594.         jle .no_point
  1595.         mov ecx,[ebx+Figure.PoiCount]
  1596.         or ecx,ecx
  1597.         jz .no_point
  1598.         cmp eax,ecx
  1599.         je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
  1600.  
  1601.         mov edx,ecx
  1602.         imul edx,sizeof.Point
  1603.         mov ebx,[ebx+Figure.PoiData]
  1604.         add edx,ebx
  1605. align 4
  1606.         .cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
  1607.                 cmp ebx,edx
  1608.                 jge .no_point
  1609.                 bt dword[ebx+Point.Prop],PROP_BIT_SELECT
  1610.                 jc .cycle0end
  1611.                 add ebx,sizeof.Point
  1612.                 jmp .cycle0
  1613.         .cycle0end:
  1614.         lea esi,[ebx+Point.CoordY]
  1615.         mov edi,Data_Double
  1616.         movsd
  1617.         movsd
  1618.         finit
  1619.         fld qword[Data_Double]
  1620. align 4
  1621.         .cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï min(Point.CoordY)
  1622.                 bt dword[ebx+Point.Prop],PROP_BIT_SELECT
  1623.                 jnc .no_sel
  1624.                         fcom qword[ebx+Point.CoordY]
  1625.                         fstsw ax
  1626.                         sahf
  1627.                         jbe .no_sel
  1628.                                 ;if (st0>Point.CoordY)
  1629.                                 ffree st0
  1630.                                 fincstp
  1631.                                 fld qword[ebx+Point.CoordY]
  1632.                 .no_sel:
  1633.                 add ebx,sizeof.Point
  1634.                 cmp ebx,edx
  1635.                 jl .cycle1
  1636.         fstp qword[Data_Double]
  1637. align 4
  1638.         .cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordY = min(Point.CoordY)
  1639.                 sub edx,sizeof.Point
  1640.                 bt dword[edx+Point.Prop],PROP_BIT_SELECT
  1641.                 jnc @f
  1642.                         mov esi,Data_Double
  1643.                         lea edi,[edx+Point.CoordY]
  1644.                         movsd
  1645.                         movsd
  1646.                 @@:
  1647.                 loop .cycle2
  1648.         ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
  1649.         mov dword[offs_last_timer],0
  1650.         .no_point:
  1651. popad
  1652.         ret
  1653. endp
  1654.  
  1655. align 4
  1656. proc but_sel_points_align_coord_xmax
  1657. pushad
  1658.         stdcall [tl_node_get_data],tree1
  1659.         or eax,eax
  1660.         jz .no_point
  1661.         cmp [eax+Figure.OType],'Fig'
  1662.         jne .no_point
  1663.  
  1664.         mov ebx,eax
  1665.         stdcall sel_points_get_count,eax
  1666.         cmp eax,1
  1667.         jle .no_point
  1668.         mov ecx,[ebx+Figure.PoiCount]
  1669.         or ecx,ecx
  1670.         jz .no_point
  1671.         cmp eax,ecx
  1672.         je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
  1673.  
  1674.         mov edx,ecx
  1675.         imul edx,sizeof.Point
  1676.         mov ebx,[ebx+Figure.PoiData]
  1677.         add edx,ebx
  1678. align 4
  1679.         .cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
  1680.                 cmp ebx,edx
  1681.                 jge .no_point
  1682.                 bt dword[ebx+Point.Prop],PROP_BIT_SELECT
  1683.                 jc .cycle0end
  1684.                 add ebx,sizeof.Point
  1685.                 jmp .cycle0
  1686.         .cycle0end:
  1687.         lea esi,[ebx+Point.CoordX]
  1688.         mov edi,Data_Double
  1689.         movsd
  1690.         movsd
  1691.         finit
  1692.         fld qword[Data_Double]
  1693. align 4
  1694.         .cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï max(Point.CoordX)
  1695.                 bt dword[ebx+Point.Prop],PROP_BIT_SELECT
  1696.                 jnc .no_sel
  1697.                         fcom qword[ebx+Point.CoordX]
  1698.                         fstsw ax
  1699.                         sahf
  1700.                         jae .no_sel
  1701.                                 ;if (st0<Point.CoordX)
  1702.                                 ffree st0
  1703.                                 fincstp
  1704.                                 fld qword[ebx+Point.CoordX]
  1705.                 .no_sel:
  1706.                 add ebx,sizeof.Point
  1707.                 cmp ebx,edx
  1708.                 jl .cycle1
  1709.         fstp qword[Data_Double]
  1710. align 4
  1711.         .cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordX = max(Point.CoordX)
  1712.                 sub edx,sizeof.Point
  1713.                 bt dword[edx+Point.Prop],PROP_BIT_SELECT
  1714.                 jnc @f
  1715.                         mov esi,Data_Double
  1716.                         lea edi,[edx+Point.CoordX]
  1717.                         movsd
  1718.                         movsd
  1719.                 @@:
  1720.                 loop .cycle2
  1721.         ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
  1722.         mov dword[offs_last_timer],0
  1723.         .no_point:
  1724. popad
  1725.         ret
  1726. endp
  1727.  
  1728. align 4
  1729. proc but_sel_points_align_coord_ymax
  1730. pushad
  1731.         stdcall [tl_node_get_data],tree1
  1732.         or eax,eax
  1733.         jz .no_point
  1734.         cmp [eax+Figure.OType],'Fig'
  1735.         jne .no_point
  1736.  
  1737.         mov ebx,eax
  1738.         stdcall sel_points_get_count,eax
  1739.         cmp eax,1
  1740.         jle .no_point
  1741.         mov ecx,[ebx+Figure.PoiCount]
  1742.         or ecx,ecx
  1743.         jz .no_point
  1744.         cmp eax,ecx
  1745.         je .no_point ;¥á«¨ ¢ë¤¥«¥­­ë ¢á¥ â®çª¨, çâ®-¡ë ­¥ ¯®àâ¨âì ª®­âãà
  1746.  
  1747.         mov edx,ecx
  1748.         imul edx,sizeof.Point
  1749.         mov ebx,[ebx+Figure.PoiData]
  1750.         add edx,ebx
  1751. align 4
  1752.         .cycle0: ;1-ï ¢ë¤¥«¥­­ ï â®çª 
  1753.                 cmp ebx,edx
  1754.                 jge .no_point
  1755.                 bt dword[ebx+Point.Prop],PROP_BIT_SELECT
  1756.                 jc .cycle0end
  1757.                 add ebx,sizeof.Point
  1758.                 jmp .cycle0
  1759.         .cycle0end:
  1760.         lea esi,[ebx+Point.CoordY]
  1761.         mov edi,Data_Double
  1762.         movsd
  1763.         movsd
  1764.         finit
  1765.         fld qword[Data_Double]
  1766. align 4
  1767.         .cycle1: ;横« ¤«ï ­ å®¦¤¥­¨ï max(Point.CoordY)
  1768.                 bt dword[ebx+Point.Prop],PROP_BIT_SELECT
  1769.                 jnc .no_sel
  1770.                         fcom qword[ebx+Point.CoordY]
  1771.                         fstsw ax
  1772.                         sahf
  1773.                         jae .no_sel
  1774.                                 ;if (st0<Point.CoordY)
  1775.                                 ffree st0
  1776.                                 fincstp
  1777.                                 fld qword[ebx+Point.CoordY]
  1778.                 .no_sel:
  1779.                 add ebx,sizeof.Point
  1780.                 cmp ebx,edx
  1781.                 jl .cycle1
  1782.         fstp qword[Data_Double]
  1783. align 4
  1784.         .cycle2: ;横« ¤«ï ¯à¨á¢ ¨¢ ­¨ï ¢á¥¬ Point.CoordY = max(Point.CoordY)
  1785.                 sub edx,sizeof.Point
  1786.                 bt dword[edx+Point.Prop],PROP_BIT_SELECT
  1787.                 jnc @f
  1788.                         mov esi,Data_Double
  1789.                         lea edi,[edx+Point.CoordY]
  1790.                         movsd
  1791.                         movsd
  1792.                 @@:
  1793.                 loop .cycle2
  1794.         ;¤«ï ®¡­®¢«¥­¨ï ¯® â ©¬¥àã
  1795.         mov dword[offs_last_timer],0
  1796.         .no_point:
  1797. popad
  1798.         ret
  1799. endp
  1800.  
  1801. align 4
  1802. proc but_restore_zoom uses eax
  1803.         stdcall [tl_node_get_data],tree1
  1804.         or eax,eax
  1805.         jz .end_f
  1806.         cmp [eax+Figure.OType],'Fig'
  1807.         je @f
  1808.         cmp [eax+Figure.OType],'Obj'
  1809.         je .end0
  1810.                 jmp .end_f
  1811.         .end0:
  1812.                 mov eax,ObjData
  1813.         @@:
  1814.                 finit
  1815.                 fld1
  1816.                 fstp qword[eax+Figure.MScale]
  1817.                 mov dword[eax+Figure.MCentrX],0
  1818.                 mov dword[eax+Figure.MCentrY],0
  1819.                 mov dword[offs_last_timer],0
  1820.         .end_f:
  1821.         ret
  1822. endp
  1823.  
  1824. align 4
  1825. but_sel_figure_move_down:
  1826.         pushad
  1827.         stdcall [tl_node_get_data],tree1
  1828.         or eax,eax
  1829.         jz .end_fblo
  1830.         cmp [eax+Figure.OType],'Fig'
  1831.         jne .end_fblo
  1832.                 stdcall found_parent_obj,eax
  1833.                 or eax,eax
  1834.                 jz .end_f ;if not found
  1835.                 inc ecx
  1836.                 cmp ecx,[eax+Object.FigCount]
  1837.                 jge .fig_is_last ;¥á«¨ 䨣ãà  ¢ ª®­æ¥ ᯨ᪠
  1838.                 mov ebx,[eax+Object.FigData]
  1839.                 mov edx,[ebx+4*ecx] ;¯¥à¥¤¢¨£ ¥¬ ï 䨣ãà 
  1840.                 mov edi,[ebx+4*ecx-4]
  1841.                 ;¬¥­ï¥¬ 䨣ãàë ¬¥áâ ¬¨
  1842.                 mov [ebx+4*ecx],edi
  1843.                 mov [ebx+4*ecx-4],edx
  1844.                 ;¬¥­ï¥¬ 䨣ãàë ¢ ᯨ᪥
  1845.                 stdcall [tl_node_move_down],tree1
  1846.                 jmp .end_f
  1847.         .fig_is_last:
  1848.                 notify_window_run txt_err_figure_is_last
  1849.                 jmp .end_f
  1850.         .end_fblo:
  1851.                 notify_window_run txt_err_no_figure_select
  1852.         .end_f:
  1853.         popad
  1854.         ret
  1855.  
  1856. ;description:
  1857. ; § ¯ã᪠®ª­  ᮧ¤ ­¨ï/। ªâ¨à®¢ ­¨ï â®çª¨
  1858. align 4
  1859. but_dlg_point_coords:
  1860.         cmp byte[wnd_run_prop],0
  1861.         jne .end_f
  1862. pushad
  1863.         stdcall [tl_node_get_data],tree1
  1864.         or eax,eax
  1865.         jz .end_fblo
  1866.         cmp [eax+Figure.OType],'Fig'
  1867.         jne .end_fblo
  1868.         mov [wnd_pFig],eax ;䨣ãà 
  1869.         stdcall sel_points_get_count,eax
  1870.         cmp eax,1
  1871.         jne .no_select_1
  1872.                 stdcall found_parent_obj,[wnd_pFig]
  1873.                 or eax,eax
  1874.                 jz .end0 ;if not found
  1875.  
  1876.                 mov [wnd_pObj],eax ;obj
  1877.                 mov [wnd_FigN],ecx ;fig number
  1878.                 stdcall sel_points_get_first,[wnd_pFig]
  1879.                 mov [wnd_pPoi],eax
  1880.                 mov edx,[wnd_pFig]
  1881.                 sub eax,[edx+Figure.PoiData]
  1882.                 xor edx,edx
  1883.                 mov ecx,sizeof.Point
  1884.                 div ecx
  1885.                 jmp .end1
  1886.         .no_select_1:
  1887.         or eax,eax
  1888.         jnz .end_fblo
  1889.                 stdcall found_parent_obj,[wnd_pFig]
  1890.                 or eax,eax
  1891.                 jz .end0 ;if not found
  1892.  
  1893.                 mov [wnd_pObj],eax ;obj
  1894.                 mov [wnd_FigN],ecx ;fig number
  1895.                 xor eax,eax
  1896.                 mov [wnd_pPoi],eax
  1897.                 mov edx,[wnd_pFig]
  1898.                 mov eax,[edx+Figure.PoiCount]
  1899.         .end1:
  1900.                 mov [wnd_PoiN],eax
  1901.                 mcall SF_CREATE_THREAD,1,start_prop,thread_coords
  1902.                 jmp .end0
  1903.         .end_fblo:
  1904.                 notify_window_run txt_err_no_1_point_sel
  1905.                 ;jmp @f
  1906.         ;.end_fblo:
  1907.                 ;notify_window_run txt_err_...
  1908.         .end0:
  1909. popad
  1910.         .end_f:
  1911.         ret
  1912.  
  1913. align 4
  1914. but_dlg_opt_scale:
  1915.         cmp byte[wnd_run_scale],0
  1916.         jne .end_f
  1917. pushad
  1918.         mcall SF_CREATE_THREAD,1,start_scale,thread_scale
  1919. popad
  1920.         .end_f:
  1921.         ret
  1922.  
  1923.  
  1924.  
  1925. ;input:
  1926. ; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
  1927. ;output:
  1928. ; eax - ç¨á«®
  1929. align 4
  1930. proc conv_str_to_int uses ebx ecx esi, buf:dword
  1931.         xor eax,eax
  1932.         xor ebx,ebx
  1933.         mov esi,[buf]
  1934.  
  1935.         ;­  á«ãç © ¥á«¨ ¯¥à¥¤ ç¨á«®¬ ­ å®¤ïâáï ¯à®¡¥«ë
  1936.         @@:
  1937.         cmp byte[esi],' '
  1938.         jne @f
  1939.                 inc esi
  1940.                 jmp @b
  1941.         @@:
  1942.  
  1943.         ;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
  1944.         xor ecx,ecx
  1945.         inc ecx
  1946.         cmp byte[esi],'-'
  1947.         jne @f
  1948.                 dec ecx
  1949.                 inc esi
  1950.         @@:
  1951.  
  1952.         cmp word[esi],'0x'
  1953.         je .load_digit_16
  1954.  
  1955.         .load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
  1956.                 mov bl,byte[esi]
  1957.                 cmp bl,'0'
  1958.                 jl @f
  1959.                 cmp bl,'9'
  1960.                 jg @f
  1961.                         sub bl,'0'
  1962.                         imul eax,10
  1963.                         add eax,ebx
  1964.                         inc esi
  1965.                         jmp .load_digit_10
  1966.         jmp @f
  1967.  
  1968.         .load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
  1969.                 add esi,2
  1970.         .cycle_16:
  1971.                 mov bl,byte[esi]
  1972.                 cmp bl,'0'
  1973.                 jl @f
  1974.                 cmp bl,'f'
  1975.                 jg @f
  1976.                 cmp bl,'9'
  1977.                 jle .us1
  1978.                         cmp bl,'A'
  1979.                         jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
  1980.                 .us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
  1981.                 cmp bl,'F'
  1982.                 jle .us2
  1983.                         cmp bl,'a'
  1984.                         jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
  1985.                         sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
  1986.                 .us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
  1987.                         sub bl,'0'
  1988.                         cmp bl,9
  1989.                         jle .cor1
  1990.                                 sub bl,7 ;convert 'A' to '10'
  1991.                         .cor1:
  1992.                         shl eax,4
  1993.                         add eax,ebx
  1994.                         inc esi
  1995.                         jmp .cycle_16
  1996.         @@:
  1997.         cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
  1998.         jne @f
  1999.                 sub ecx,eax
  2000.                 mov eax,ecx
  2001.         @@:
  2002.         ret
  2003. endp
  2004.  
  2005.  
  2006. ;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
  2007. align 4
  2008. OpenDialog_data:
  2009. .type                   dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
  2010. .procinfo               dd procinfo     ;+4
  2011. .com_area_name          dd communication_area_name      ;+8
  2012. .com_area               dd 0    ;+12
  2013. .opendir_path           dd plugin_path  ;+16
  2014. .dir_default_path       dd default_dir ;+20
  2015. .start_path             dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
  2016. .draw_window            dd draw_window  ;+28
  2017. .status                 dd 0    ;+32
  2018. .openfile_path          dd openfile_path        ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
  2019. .filename_area          dd filename_area        ;+40
  2020. .filter_area            dd Filter
  2021. .x:
  2022. .x_size                 dw 420 ;+48 ; Window X size
  2023. .x_start                dw 10 ;+50 ; Window X position
  2024. .y:
  2025. .y_size                 dw 320 ;+52 ; Window y size
  2026. .y_start                dw 10 ;+54 ; Window Y position
  2027.  
  2028. default_dir db '/rd/1',0
  2029.  
  2030. communication_area_name:
  2031.         db 'FFFFFFFF_open_dialog',0
  2032. open_dialog_name:
  2033.         db 'opendial',0
  2034. communication_area_default_path:
  2035.         db '/rd/1/File managers/',0
  2036.  
  2037. Filter:
  2038. dd Filter.end - Filter ;.1
  2039. .1:
  2040. db 'NC',0
  2041. db 'PNG',0
  2042. .end:
  2043. db 0
  2044.  
  2045.  
  2046.  
  2047. head_f_i:
  2048. head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
  2049.  
  2050. system_dir_0 db '/sys/lib/'
  2051. lib_name_0 db 'proc_lib.obj',0
  2052. err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
  2053. err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
  2054.  
  2055. system_dir_1 db '/sys/lib/'
  2056. lib_name_1 db 'libimg.obj',0
  2057. err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
  2058. err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
  2059.  
  2060. system_dir_2 db '/sys/lib/'
  2061. lib_name_2 db 'buf2d.obj',0
  2062. err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
  2063. err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
  2064.  
  2065. system_dir_3 db '/sys/lib/'
  2066. lib_name_3 db 'box_lib.obj',0
  2067. err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'box_lib.obj',39,0
  2068. err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib',39,0
  2069.  
  2070. l_libs_start:
  2071.         lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
  2072.                 err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
  2073.         lib_1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
  2074.                 err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
  2075.         lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
  2076.                 err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
  2077.         lib_3 l_libs lib_name_3, sys_path, file_name,  system_dir_3,\
  2078.                 err_msg_found_lib_3, head_f_l, import_box_lib,err_msg_import_3,head_f_i
  2079. l_libs_end:
  2080.  
  2081. align 4
  2082. import_libimg:
  2083.         dd alib_init1
  2084.         img_is_img  dd aimg_is_img
  2085.         img_info    dd aimg_info
  2086.         img_from_file dd aimg_from_file
  2087.         img_to_file dd aimg_to_file
  2088.         img_from_rgb dd aimg_from_rgb
  2089.         img_to_rgb  dd aimg_to_rgb
  2090.         img_to_rgb2 dd aimg_to_rgb2
  2091.         img_decode  dd aimg_decode
  2092.         img_encode  dd aimg_encode
  2093.         img_create  dd aimg_create
  2094.         img_destroy dd aimg_destroy
  2095.         img_destroy_layer dd aimg_destroy_layer
  2096.         img_count   dd aimg_count
  2097.         img_lock_bits dd aimg_lock_bits
  2098.         img_unlock_bits dd aimg_unlock_bits
  2099.         img_flip    dd aimg_flip
  2100.         img_flip_layer dd aimg_flip_layer
  2101.         img_rotate  dd aimg_rotate
  2102.         img_rotate_layer dd aimg_rotate_layer
  2103.         img_draw    dd aimg_draw
  2104.  
  2105.         dd 0,0
  2106.         alib_init1   db 'lib_init',0
  2107.         aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
  2108.         aimg_info    db 'img_info',0
  2109.         aimg_from_file db 'img_from_file',0
  2110.         aimg_to_file db 'img_to_file',0
  2111.         aimg_from_rgb db 'img_from_rgb',0
  2112.         aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
  2113.         aimg_to_rgb2 db 'img_to_rgb2',0
  2114.         aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
  2115.         aimg_encode  db 'img_encode',0
  2116.         aimg_create  db 'img_create',0
  2117.         aimg_destroy db 'img_destroy',0
  2118.         aimg_destroy_layer db 'img_destroy_layer',0
  2119.         aimg_count   db 'img_count',0
  2120.         aimg_lock_bits db 'img_lock_bits',0
  2121.         aimg_unlock_bits db 'img_unlock_bits',0
  2122.         aimg_flip    db 'img_flip',0
  2123.         aimg_flip_layer db 'img_flip_layer',0
  2124.         aimg_rotate  db 'img_rotate',0
  2125.         aimg_rotate_layer db 'img_rotate_layer',0
  2126.         aimg_draw    db 'img_draw',0
  2127.  
  2128. align 4
  2129. proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
  2130.         OpenDialog_Init dd aOpenDialog_Init
  2131.         OpenDialog_Start dd aOpenDialog_Start
  2132. dd 0,0
  2133.         aOpenDialog_Init db 'OpenDialog_init',0
  2134.         aOpenDialog_Start db 'OpenDialog_start',0
  2135.  
  2136. align 4
  2137. import_buf2d:
  2138.         init dd sz_init
  2139.         buf2d_create dd sz_buf2d_create
  2140.         buf2d_create_f_img dd sz_buf2d_create_f_img
  2141.         buf2d_clear dd sz_buf2d_clear
  2142.         buf2d_draw dd sz_buf2d_draw
  2143.         buf2d_delete dd sz_buf2d_delete
  2144.         buf2d_resize dd sz_buf2d_resize
  2145.         buf2d_line dd sz_buf2d_line
  2146.         buf2d_line_sm dd sz_buf2d_line_sm
  2147.         buf2d_rect_by_size dd sz_buf2d_rect_by_size
  2148.         buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
  2149.         buf2d_circle dd sz_buf2d_circle
  2150.         buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
  2151.         buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
  2152.         buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
  2153.         buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
  2154.         buf2d_bit_blt dd sz_buf2d_bit_blt
  2155.         buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
  2156.         buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
  2157.         buf2d_curve_bezier dd sz_buf2d_curve_bezier
  2158.         buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
  2159.         buf2d_draw_text dd sz_buf2d_draw_text
  2160.         buf2d_crop_color dd sz_buf2d_crop_color
  2161.         buf2d_flip_h dd sz_buf2d_flip_h
  2162.         buf2d_flip_v dd sz_buf2d_flip_v
  2163.         buf2d_offset_h dd sz_buf2d_offset_h
  2164.         buf2d_flood_fill dd sz_buf2d_flood_fill
  2165.         buf2d_set_pixel dd sz_buf2d_set_pixel
  2166.         dd 0,0
  2167.         sz_init db 'lib_init',0
  2168.         sz_buf2d_create db 'buf2d_create',0
  2169.         sz_buf2d_create_f_img db 'buf2d_create_f_img',0
  2170.         sz_buf2d_clear db 'buf2d_clear',0
  2171.         sz_buf2d_draw db 'buf2d_draw',0
  2172.         sz_buf2d_delete db 'buf2d_delete',0
  2173.         sz_buf2d_resize db 'buf2d_resize',0
  2174.         sz_buf2d_line db 'buf2d_line',0
  2175.         sz_buf2d_line_sm db 'buf2d_line_sm',0
  2176.         sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
  2177.         sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
  2178.         sz_buf2d_circle db 'buf2d_circle',0
  2179.         sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
  2180.         sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
  2181.         sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
  2182.         sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
  2183.         sz_buf2d_bit_blt db 'buf2d_bit_blt',0
  2184.         sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
  2185.         sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
  2186.         sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
  2187.         sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
  2188.         sz_buf2d_draw_text db 'buf2d_draw_text',0
  2189.         sz_buf2d_crop_color db 'buf2d_crop_color',0
  2190.         sz_buf2d_flip_h db 'buf2d_flip_h',0
  2191.         sz_buf2d_flip_v db 'buf2d_flip_v',0
  2192.         sz_buf2d_offset_h db 'buf2d_offset_h',0
  2193.         sz_buf2d_flood_fill db 'buf2d_flood_fill',0
  2194.         sz_buf2d_set_pixel db 'buf2d_set_pixel',0
  2195.  
  2196. align 4
  2197. import_box_lib:
  2198.         dd sz_init1
  2199.  
  2200.         init_checkbox   dd sz_Init_checkbox
  2201.         check_box_draw  dd sz_Check_box_draw
  2202.         check_box_mouse dd sz_Check_box_mouse
  2203.         ;version_ch     dd sz_Version_ch
  2204.  
  2205.         option_box_draw  dd sz_Option_box_draw
  2206.         option_box_mouse dd sz_Option_box_mouse
  2207.         ;version_op      dd sz_Version_op
  2208.  
  2209.         edit_box_draw      dd sz_edit_box_draw
  2210.         edit_box_key       dd sz_edit_box_key
  2211.         edit_box_mouse     dd sz_edit_box_mouse
  2212.         edit_box_set_text  dd sz_edit_box_set_text
  2213.         scrollbar_ver_draw dd sz_scrollbar_ver_draw
  2214.         scrollbar_hor_draw dd sz_scrollbar_hor_draw
  2215.  
  2216.         tl_data_init dd sz_tl_data_init
  2217.         tl_data_clear dd sz_tl_data_clear
  2218.         tl_info_clear dd sz_tl_info_clear
  2219.         tl_key dd sz_tl_key
  2220.         tl_mouse dd sz_tl_mouse
  2221.         tl_draw dd sz_tl_draw
  2222.         tl_info_undo dd sz_tl_info_undo
  2223.         tl_info_redo dd sz_tl_info_redo
  2224.         tl_node_add dd sz_tl_node_add
  2225.         tl_node_set_data dd sz_tl_node_set_data
  2226.         tl_node_get_data dd sz_tl_node_get_data
  2227.         tl_node_delete dd sz_tl_node_delete
  2228.         tl_node_move_up dd sz_tl_node_move_up
  2229.         tl_node_move_down dd sz_tl_node_move_down
  2230.         tl_cur_beg dd sz_tl_cur_beg
  2231.         tl_cur_next dd sz_tl_cur_next
  2232.         tl_cur_perv dd sz_tl_cur_perv
  2233.         tl_node_close_open dd sz_tl_node_close_open
  2234.         tl_node_lev_inc dd sz_tl_node_lev_inc
  2235.         tl_node_lev_dec dd sz_tl_node_lev_dec
  2236.         tl_node_poi_get_info dd sz_tl_node_poi_get_info
  2237.         tl_node_poi_get_next_info dd sz_tl_node_poi_get_next_info
  2238.         tl_node_poi_get_data dd sz_tl_node_poi_get_data
  2239.  
  2240.         dd 0,0
  2241.         sz_init1 db 'lib_init',0
  2242.  
  2243.         sz_Init_checkbox   db 'init_checkbox2',0
  2244.         sz_Check_box_draw  db 'check_box_draw2',0
  2245.         sz_Check_box_mouse db 'check_box_mouse2',0
  2246.         ;sz_Version_ch     db 'version_ch2',0
  2247.  
  2248.         sz_Option_box_draw      db 'option_box_draw',0
  2249.         sz_Option_box_mouse     db 'option_box_mouse',0
  2250.         ;sz_Version_op      db 'version_op',0
  2251.  
  2252.         sz_edit_box_draw      db 'edit_box',0
  2253.         sz_edit_box_key       db 'edit_box_key',0
  2254.         sz_edit_box_mouse     db 'edit_box_mouse',0
  2255.         sz_edit_box_set_text  db 'edit_box_set_text',0
  2256.         sz_scrollbar_ver_draw db 'scrollbar_v_draw',0
  2257.         sz_scrollbar_hor_draw db 'scrollbar_h_draw',0
  2258.  
  2259.         sz_tl_data_init db 'tl_data_init',0
  2260.         sz_tl_data_clear db 'tl_data_clear',0
  2261.         sz_tl_info_clear db 'tl_info_clear',0
  2262.         sz_tl_key db 'tl_key',0
  2263.         sz_tl_mouse db 'tl_mouse',0
  2264.         sz_tl_draw db 'tl_draw',0
  2265.         sz_tl_info_undo db 'tl_info_undo',0
  2266.         sz_tl_info_redo db 'tl_info_redo',0
  2267.         sz_tl_node_add db 'tl_node_add',0
  2268.         sz_tl_node_set_data db 'tl_node_set_data',0
  2269.         sz_tl_node_get_data db 'tl_node_get_data',0
  2270.         sz_tl_node_delete db 'tl_node_delete',0
  2271.         sz_tl_node_move_up db 'tl_node_move_up',0
  2272.         sz_tl_node_move_down db 'tl_node_move_down',0
  2273.         sz_tl_cur_beg db 'tl_cur_beg',0
  2274.         sz_tl_cur_next db 'tl_cur_next',0
  2275.         sz_tl_cur_perv db 'tl_cur_perv',0
  2276.         sz_tl_node_close_open db 'tl_node_close_open',0
  2277.         sz_tl_node_lev_inc db 'tl_node_lev_inc',0
  2278.         sz_tl_node_lev_dec db 'tl_node_lev_dec',0
  2279.         sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0
  2280.         sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0
  2281.         sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0
  2282.  
  2283. align 4
  2284. mouse_dd dd 0
  2285. last_time dd 0
  2286.  
  2287. align 16
  2288. sc system_colors
  2289.  
  2290. align 16
  2291. procinfo process_information
  2292.  
  2293. align 4
  2294. buf_0: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  2295. .l: dw 205 ;+4 left
  2296. .t: dw 35 ;+6 top
  2297. .w: dd 384 ;+8 w
  2298. .h: dd 350 ;+12 h
  2299. .color: dd 0xffffd0 ;+16 color
  2300.         db 24 ;+20 bit in pixel
  2301.  
  2302. align 4
  2303. buf_1:
  2304.         dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  2305.         dd 0 ;+4 left,top
  2306. .w: dd 0
  2307. .h: dd 0,0,24 ;+12 color,bit in pixel
  2308.  
  2309. font_h dd 0 ;¢ëá®â  èà¨äâ 
  2310.  
  2311. align 4
  2312. buf_png:
  2313.         dd 0,0
  2314. .w: dd 0
  2315. .h: dd 0,0xffffff,24
  2316.  
  2317. align 4
  2318. el_focus dd tree1
  2319. tree1 tree_list size_one_list,1000+2, tl_key_no_edit+tl_draw_par_line,\
  2320.         16,16, 0xffffff,0xb0d0ff,0x400040, 5,35,195-16,340, 16,Figure.Caption,0,\
  2321.         el_focus,w_scr_t1,0
  2322.  
  2323. align 4
  2324. w_scr_t1 scrollbar 16,0, 3,0, 15, 100, 0,0, 0,0,0, 1
  2325.  
  2326. ;input:
  2327. ; eax - ç¨á«®
  2328. ; edi - ¡ãä¥à ¤«ï áâப¨
  2329. ; len - ¤«¨­­  ¡ãä¥à 
  2330. ;output:
  2331. align 4
  2332. proc convert_int_to_str uses eax ecx edx edi esi, len:dword
  2333.         mov esi,[len]
  2334.         add esi,edi
  2335.         dec esi
  2336.         call .str
  2337.         ret
  2338. endp
  2339.  
  2340. align 4
  2341. .str:
  2342.         mov ecx,10
  2343.         cmp eax,ecx
  2344.         jb @f
  2345.                 xor edx,edx
  2346.                 div ecx
  2347.                 push edx
  2348.                 ;dec edi  ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
  2349.                 call .str
  2350.                 pop eax
  2351.         @@:
  2352.         cmp edi,esi
  2353.         jge @f
  2354.                 or al,0x30
  2355.                 stosb
  2356.                 mov byte[edi],0 ;¢ ª®­¥æ áâப¨ áâ ¢¨¬ 0, çâ®-¡ë ­¥ ¢ë« §¨« ¬ãá®à
  2357.         @@:
  2358.         ret
  2359.  
  2360. align 4
  2361. proc mem_copy uses ecx esi edi, destination:dword, source:dword, len:dword
  2362.         cld
  2363.         mov esi, dword[source]
  2364.         mov edi, dword[destination]
  2365.         mov ecx, dword[len]
  2366.         rep movsb
  2367.         ret
  2368. endp
  2369.  
  2370. align 16
  2371. i_end:
  2372.         rb 2048
  2373. thread_coords:
  2374.         rb 2048
  2375. thread_scale:
  2376.         rb 2048
  2377. thread_n_file:
  2378.         rb 2048
  2379. stacktop:
  2380.         sys_path rb 1024
  2381.         file_name:
  2382.                 rb 1024 ;4096
  2383.         library_path rb 1024
  2384.         plugin_path rb 4096
  2385.         openfile_path rb 4096
  2386.         filename_area rb 256
  2387. mem:
  2388.  
  2389.