Subversion Repositories Kolibri OS

Rev

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

  1. ;---------------------------------------------
  2. ;-------------interraction MOUSE--------------
  3. ;---------------------------------------------
  4. mouse:
  5.         or      ecx,-1
  6.         mcall   9,procinfo
  7.        
  8.         mov     eax,[procinfo+70] ;staus of window
  9.         test    eax,100b
  10.         jne     still
  11.        
  12.         call    GetMouseCoordinats
  13. ;panel
  14.         mov     edx,[Window_SizeX]
  15.         sub     edx,5
  16.  
  17.         cmp     ebx,20
  18.         jle     no_panel
  19.  
  20.         cmp     ebx,20+15
  21.         jae     no_panel
  22.  
  23.         cmp     eax,5
  24.         jle     no_panel
  25.  
  26.         cmp     eax,edx ;585
  27.         jae     no_panel
  28.  
  29.         call    GetMouseCoordinats
  30.         mov     [counter],7
  31.         mov     edi,panel_text
  32.         jmp     panel_interraction
  33.  
  34. no_panel:
  35.         cmp     [Panel_flag],0
  36.         jz      no_redraw_panel
  37.  
  38.         mov     [counter],7
  39.         mov     edi,panel_text
  40.         jmp     panel_interraction
  41.  
  42. no_redraw_panel:
  43.         call    GetMouseCoordinats
  44.         mov     eax,[MouseX]
  45.         mov     ebx,[MouseY]
  46.         mov     ecx,[WorkScreen_SizeX]
  47.         mov     edx,[WorkScreen_SizeY]
  48.         add     ecx,9
  49.         add     edx,89
  50.  
  51.         cmp     eax,ecx
  52.         jae     mouse_scroll
  53.  
  54.         cmp     ebx,edx
  55.         jae     mouse_scroll
  56.         jmp     no_scrollers
  57.  
  58. mouse_scroll:
  59.         mov     [exit_from_work_arrea],1 ;mouse situated after work arrea
  60. ;scrollers
  61.         call    GetMouseClick
  62.         cmp     eax,1
  63.         jne     no_click
  64.  
  65.         call    GetMouseCoordinats
  66. ;interraction with horizontal scroller
  67.         mov     eax,[Scroll1CoordinatX]
  68.         mov     ebx,[Scroll1CoordinatY]
  69.         mov     ecx,[MouseX]
  70.         mov     edx,[MouseY]
  71.         mov     esi,[Scroll1MaxSizeX]
  72.         mov     edi,[Scroll1MaxSizeY]
  73.         call    columnus
  74.         test    eax,eax
  75.         jz      no_horizontal
  76.  
  77.         mov     eax,9
  78.         mov     ebx,[Scroll1CoordinatY]
  79.         mov     ecx,[Scroll1MaxSizeX]
  80.         mov     edx,14+10
  81.         mov     esi,7
  82.         inc     ecx
  83.         call    draw_volume_rectangle
  84.  
  85.         mov     eax,[MouseX]
  86.         mov     ebx,[Scroll1SizeX]
  87.         shr     ebx,1
  88.         sub     eax,ebx
  89.         mov     ecx,[MouseX]
  90.         add     ecx,ebx
  91.         mov     edx,8+1
  92.         add     edx,[Scroll1MaxSizeX]
  93.         mov     [Scroll1CoordinatX],eax
  94.         sub     eax,9
  95.         jns     no_min_scroll
  96.  
  97.         mov     [Scroll1CoordinatX],9
  98.  
  99. no_min_scroll:
  100.         cmp     ecx,edx
  101.         jl      no_max_scroll
  102.  
  103.         sub     edx,ebx
  104.         sub     edx,ebx
  105.         mov     [Scroll1CoordinatX],edx
  106.  
  107. no_max_scroll:
  108.         mov     eax,[Scroll1CoordinatX]
  109.         sub     eax,9
  110.         mov     ebx,[Picture_SizeX]
  111.         imul    eax,ebx
  112.         mov     ebx,[Scroll1MaxSizeX]
  113.         cdq
  114.         idiv    ebx
  115.         mov     [PosX],eax
  116.         jmp     no_vertical
  117.  
  118. no_horizontal:
  119.         mov     eax,[Scroll2CoordinatX]
  120.         mov     ebx,[Scroll2CoordinatY]
  121.         mov     ecx,[MouseX]
  122.         mov     edx,[MouseY]
  123.         mov     esi,[Scroll2MaxSizeX]
  124.         mov     edi,[Scroll2MaxSizeY]
  125.         call    columnus
  126.         test    eax,eax
  127.         jz      no_vertical
  128.  
  129.         mov     eax,[Scroll2CoordinatX]
  130.         mov     ebx,89
  131.         mov     ecx,14+10
  132.         mov     edx,[Scroll2MaxSizeY]
  133.         mov     esi,7
  134.         inc     edx
  135.         call    draw_volume_rectangle
  136.  
  137.         mov     eax,[MouseY]
  138.         mov     ebx,[Scroll2SizeY]
  139.         shr     ebx,1
  140.         sub     eax,ebx
  141.         mov     ecx,[MouseY]
  142.         add     ecx,ebx
  143.         mov     edx,89
  144.         add     edx,[Scroll2MaxSizeY]
  145.         mov     [Scroll2CoordinatY],eax
  146.  
  147.         sub     eax,89
  148.         jns     no_min_scroll2
  149.  
  150.         mov     [Scroll2CoordinatY],89
  151.  
  152. no_min_scroll2:
  153.         cmp     ecx,edx
  154.         jl      no_max_scroll2
  155.  
  156.         sub     edx,ebx
  157.         sub     edx,ebx
  158.         mov     [Scroll2CoordinatY],edx
  159.  
  160. no_max_scroll2:
  161.         mov     eax,[Scroll2CoordinatY]
  162.         sub     eax,89
  163.         mov     ebx,[Picture_SizeY]
  164.         imul    eax,ebx
  165.         mov     ebx,[Scroll2MaxSizeY]
  166.         cdq
  167.         idiv    ebx
  168.         mov     [PosY],eax
  169.  
  170. no_vertical:
  171.         call    CalculatePositionScreen
  172.         call    draw_scrollers
  173.         call    MovePictureToWorkScreen
  174.  
  175. no_click:
  176.         jmp     still
  177.  
  178. no_scrollers:
  179.         mov     eax,[MouseX]
  180.         mov     ebx,[MouseY]
  181.         mov     ecx,[Window_SizeX]
  182.         mov     edx,[Window_SizeY]
  183.         sub     ecx,36
  184.         sub     edx,35
  185.  
  186.         cmp     eax,9
  187.         jle     not_work_arrea
  188.  
  189.         cmp     eax,ecx
  190.         jae     not_work_arrea
  191.  
  192.         cmp     ebx,20+15+1+50
  193.         jle     not_work_arrea
  194.  
  195.         cmp     ebx,edx
  196.         jae     not_work_arrea
  197.         jmp     mouse_in_work_arrea
  198.  
  199. not_work_arrea:
  200.         mov     [exit_from_work_arrea],1
  201.         jmp     still
  202.  
  203. mouse_in_work_arrea:
  204.         call    GetScreenCordinats
  205.         call    PrintMousePos
  206.         call    GetMouseClick
  207.         test    eax,eax
  208.         jz      no_use_instruments
  209.  
  210.         cmp     [Activate_instrument],0
  211.         jnz     no_undo___
  212. ;------------begin copy for undo-------------
  213.         inc     [number_undo]
  214.         cmp     [number_undo],1
  215.         jne     no_one__
  216.  
  217.         mov     edi,[PointerToCopyPicture]
  218.  
  219. no_one__:
  220.         cmp     [number_undo],2
  221.         jne     no_two__
  222.  
  223.         mov     edi,[PointerToCopyPicture2]
  224.  
  225. no_two__:
  226.         cmp     [number_undo],3
  227.         jne     no_three__
  228.  
  229. ;copy bufer number two to bufer number one
  230.         mov     esi,[PointerToCopyPicture2]
  231.         mov     edi,[PointerToCopyPicture]
  232.         mov     ecx,[Picture_SizeX]
  233.         imul    ecx,[Picture_SizeY]
  234.         lea     ecx,[ecx+ecx*2]
  235.         add     ecx,4
  236.         shr     ecx,2
  237.         inc     ecx
  238.         cld
  239.         rep     movsd
  240. ;end copy
  241.         dec     [number_undo]
  242.         mov     edi,[PointerToCopyPicture2]
  243.  
  244. no_three__:
  245.         mov     esi,[PointerToPicture]
  246.         mov     ecx,[Picture_SizeX]
  247.         imul    ecx,[Picture_SizeY]
  248.         lea     ecx,[ecx+ecx*2]
  249.         add     ecx,4
  250.         shr     ecx,2
  251.         inc     ecx
  252.         cld
  253.         rep     movsd
  254. ;--------------end copy for undo-------------
  255. no_undo___:
  256.         call    TakeButtonInstruments
  257.  
  258. no_use_instruments:
  259.         mov     eax,[Current_instrument]
  260.         and     [Activate_instrument],0
  261.         jmp     still
  262. ;-----------------------------------------------
  263. ;---------get mouse cordinats-------------------
  264. ;-----------------------------------------------
  265. GetMouseCoordinats:
  266.         mcall   37,1
  267.         mov     ebx,eax
  268.         shr     eax,16
  269.         and     ebx,0xffff
  270.         mov     [MouseX],eax
  271.         mov     [MouseY],ebx
  272.         ret
  273. ;------------------------------------------------
  274. ;-------get mouse attributs----------------------
  275. ;------------------------------------------------
  276. GetMouseClick:
  277.         mcall   37,2
  278.         ret