Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. ;
  2. ; ¢ í⮬ ä ©«¥ ᮡ࠭ë ä㭪樨 ­ã¦­ë¥ ¤«ï ᮧ¤ ­¨ï ¨
  3. ; à ¡®âë ®ª­  á ­ áâனª ¬¨
  4. ;
  5.  
  6. wnd_scale_width  equ 320 ;è¨à¨­  ®ª­  á ­ áâனª ¬¨
  7. wnd_scale_height equ 150 ;¢ëá®â  ®ª­  á ­ áâனª ¬¨
  8.  
  9. align 4
  10. wnd_run_scale db 0 ;¯¥à¥¬¥­­ ï á«¥¤ïé ï §  ⥬ çâ®-¡ë ­¥ § ¯ã᪠âì ¡®«ìè¥ 1-£® ®ª­  ᮠ᢮©á⢠¬¨ ®¤­®¢à¥¬¥­­®
  11.  
  12. ;¤ ­®¥ ®ª­® (¯à®æ¥áá) ¢ë§ë¢ ¥âìáï ä㭪樥© but_wnd_coords
  13. align 4
  14. start_scale:
  15. pushad
  16.         mcall SF_SET_EVENTS_MASK,0x27 ;¬ áª  ®¦¨¤ ¥¬ëå ᮡë⨩
  17.         inc byte[wnd_run_scale]
  18.  
  19.         edit_boxes_set_sys_color edit3,editboxes_end_sc,sc ;ãáâ ­®¢ª  á¨á⥬­ëå 梥⮢
  20.         call get_scale
  21. popad
  22.         call red_win_scale
  23.  
  24. ;­¥ ®âà뢠âì íâã äã­ªæ¨î ®â ¯à¥¤ë¤ã饩
  25. align 4
  26. still_scale:
  27.         pushad
  28.  
  29.         mcall SF_WAIT_EVENT_TIMEOUT,10
  30.         or eax,eax
  31.         jnz @f
  32.                 call timer_funct_scale
  33.                 jmp .end
  34.         @@:
  35.  
  36.         cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
  37.         jne @f
  38.                 call red_win_scale
  39.                 jmp .end
  40.         @@:
  41.         cmp al,2
  42.         jne @f
  43.                 call key_scale
  44.                 jmp .end
  45.         @@:
  46.         cmp al,3
  47.         jz button_scale
  48.         cmp al,6
  49.         jne @f
  50.                 call mouse_scale
  51.         @@:
  52. .end:
  53.         popad
  54.         jmp still_scale
  55.  
  56. align 4
  57. red_win_scale:
  58. pushad
  59.         mcall SF_REDRAW,SSF_BEGIN_DRAW
  60.  
  61.         mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
  62.         mov edi,capt_opt ;children window caption
  63.         mov bx,word[procinfo.box.left]
  64.         add bx,word[buf_0.l]
  65.         add bx,5 ;è¨à¨­  ¡®ª®¢®© à ¬ª¨
  66.         shl ebx,16
  67.         mov bx,wnd_scale_width
  68.         mov cx,word[procinfo.box.top]
  69.         add cx,ax ;add skin height
  70.         add cx,word[buf_0.t]
  71.         shl ecx,16
  72.         mov cx,wnd_scale_height
  73.         mov edx,[sc.work]
  74.         or  edx,0x33000000
  75.         xor eax,eax
  76.         int 0x40
  77.  
  78.         mov esi,[sc.work_button]
  79.         ;ebx = (l<:)+w, ecx = (t<:)+h
  80.         mcall SF_DEFINE_BUTTON, (5 shl 16)+59, (95 shl 16)+20, 3
  81.         mcall , (75 shl 16)+59, (95 shl 16)+20, 4
  82.  
  83.         mov ecx,[sc.work_text]
  84.         bts ecx,31 ;à¨á㥬 ï áâப  § ª ­ç¨¢ ¥âáï ­ã«ñ¬
  85.         mcall SF_DRAW_TEXT, (5 shl 16)+15,, capt_sc
  86.  
  87.         mov ecx,[sc.work_button_text]
  88.         bts ecx,31
  89.         mcall , (9 shl 16)+101,, txt_but_cancel
  90.         mov edx,txt_but_apply
  91.         mcall ,(79 shl 16)+101
  92.  
  93.         stdcall [edit_box_draw], edit3
  94.  
  95.         mcall SF_REDRAW,SSF_END_DRAW
  96. popad
  97.         ret
  98.  
  99. align 4
  100. proc key_scale uses eax ebx
  101.         mcall SF_GET_KEY
  102.  
  103.         test word [edit3.flags],10b ;ed_focus
  104.         je @f
  105.                 stdcall [edit_box_key], edit3
  106.                 ;jmp .end
  107.         @@:
  108.  
  109.         .end:
  110.         ret
  111. endp
  112.  
  113. align 4
  114. mouse_scale:
  115.         stdcall [edit_box_mouse], edit3
  116.         ret
  117.  
  118. align 4
  119. button_scale:
  120.         mcall SF_GET_BUTTON
  121.  
  122.         cmp ah,3
  123.         je .exit
  124.         cmp ah,4
  125.         jne .end_save
  126.                 push eax ecx edi esi
  127.                         finit
  128.  
  129.                         mov esi,string3
  130.                         mov edi,Data_String
  131.                         cld
  132.                         mov ecx,8
  133.                         rep movsd
  134.                         call String_to_DoubleFloat
  135.                         fld  qword[Data_Double] ;áç¨â뢠¥¬ ª ª double
  136.                         fstp qword[Scale1mm] ;á®å࠭塞 ª ª double
  137.  
  138.                 pop esi edi ecx eax
  139.                 jmp .exit
  140.         .end_save:
  141.  
  142.         cmp ah,1
  143.         jne still_scale.end
  144. .exit:
  145.         mov byte[wnd_run_scale],0 ;®¡­ã«ï¥¬ áç¥â稪 ®ª®­
  146.         mcall SF_TERMINATE_PROCESS ;¢ë室 ¨§ ¯à®£à ¬¬ë
  147.  
  148. align 4
  149. get_scale:
  150.         ;§ £à㧪  ª®®à¤¨­ â ¢ editbox-ë
  151.         push eax
  152.         mov word[NumberSymbolsAD],8
  153.         finit
  154.         fld qword[Scale1mm]
  155.         fstp qword[Data_Double]
  156.         call DoubleFloat_to_String
  157.         call String_crop_0
  158.         stdcall [edit_box_set_text], edit3, Data_String
  159.         ;stdcall [edit_box_draw], edit3
  160.         pop eax
  161.         ret
  162.  
  163. align 4
  164. proc timer_funct_scale
  165.         ;¯à®á¬ âਢ ¥¬ ¢ë¤¥«¥­­ãî ª®®à¤¨­ âã
  166.         ret
  167. endp
  168.  
  169. align 4
  170. if lang eq ru
  171. capt_opt db ' áâனª¨',0
  172. capt_sc db 'Œ áèâ ¡:',0
  173. else
  174. capt_opt db 'Options',0
  175. capt_sc db 'Scale:',0
  176. end if
  177.  
  178. edit3 edit_box 80, 54, 11, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 34, string3, mouse_dd, 0
  179. editboxes_end_sc:
  180.  
  181. string3 rb 34
  182.