Subversion Repositories Kolibri OS

Rev

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