Subversion Repositories Kolibri OS

Rev

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

  1. ;-------------------------------------------------
  2. ;-----interraction panel with user----------------
  3. ;-------------------------------------------------
  4. panel_interraction:
  5. ;>>>>>>>>>>>>>>>>>>>>>>>>>>
  6. ;       mcall   18,14
  7.  
  8.         and     [Panel_flag],0
  9. ;collision with text on panel
  10. next_columnus_text:
  11.         mov     eax,[edi]
  12.         mov     ebx,[edi+4]
  13.         sub     eax,10
  14.         sub     ebx,3
  15.         mov     [Icon_text_x],eax
  16.         mov     [Icon_text_y],ebx
  17.  
  18.         mov     esi,[edi+8]
  19.         imul    esi,10
  20.         mov     [button_menu_size_x],esi
  21.         mov     [button_menu_size_y],dword 13
  22.  
  23.         mov     esi,[edi+8]
  24.         add     edi,4*3
  25.         add     edi,esi
  26.  
  27.         mov     ecx,[MouseX]
  28.         mov     edx,[MouseY]
  29.  
  30.         push    edi
  31.         mov     edi,[button_menu_size_y]
  32.         mov     esi,[button_menu_size_x]
  33.         call    columnus
  34.         pop     edi
  35.  
  36.         mov     esi,7
  37.         test    eax,eax
  38.         jz      no_columnus_text
  39.  
  40.         mov     esi,1
  41.         mov     [Panel_flag],1
  42.         call    GetMouseClick
  43.         test    eax,eax
  44.         jz      no_mouse_pressed
  45.  
  46. ;       mcall   18,14
  47.  
  48.         jmp     print_panel_menu
  49.  
  50. no_mouse_pressed:
  51. no_columnus_text:
  52.         mov     eax,[Icon_text_x]
  53.         mov     ebx,[Icon_text_y]
  54.         mov     ecx,[button_menu_size_x]
  55.         mov     edx,[button_menu_size_y]
  56.         call    draw_volume_rectangle
  57.  
  58.         push    [counter]
  59.         push    edi
  60.         mov     [counter],7
  61.         mov     edi,panel_text
  62.         call    print_panel_text
  63.         pop     edi
  64.         pop     [counter]
  65.  
  66.         dec     [counter]
  67.         jnz     next_columnus_text
  68.  
  69.         jmp     still
  70. ;---------------------------------------------------------
  71. ;-----draw panel menu(main engin of panel)----------------
  72. ;---------------------------------------------------------
  73. print_panel_menu:
  74.         push    [counter]
  75. ;delit main buttons(some time)
  76.         mov     [counter],10
  77.  
  78. next_icon_delit1:
  79.         mov     edx,[counter]
  80.         add     edx,11100000000000000000000000000000b
  81.         mcall   8
  82.         inc     [counter]
  83.         cmp     [counter],30
  84.         jl      next_icon_delit1
  85.  
  86.         ;delit  buttons of      brushes
  87.         mov     [counter],40
  88.  
  89. next_icon_delit2:
  90.         mov     edx,[counter]
  91.         add     edx,11100000000000000000000000000000b
  92.         mcall   8
  93.         inc     [counter]
  94.         cmp     [counter],45
  95.         jl      next_icon_delit2
  96.  
  97.         ;delit  buttons of      zoom
  98.         mov     [counter],45
  99.  
  100. next_icon_delit3:
  101.         mov     edx,[counter]
  102.         add     edx,11100000000000000000000000000000b
  103.         mcall   8
  104.         inc     [counter]
  105.         cmp     [counter],50
  106.         jl      next_icon_delit3
  107.  
  108. ;delit buttons of palette
  109.         mov     edx,51
  110.         add     edx,11100000000000000000000000000000b
  111.         mcall   8
  112.  
  113. ;delit buttons of color
  114.         mov     edx,52
  115.         add     edx,11100000000000000000000000000000b
  116.         mcall   8
  117.  
  118.         pop     [counter]
  119.  
  120.         push    esi
  121.         mov     esi,[counter]
  122.         dec     esi
  123.         shl     esi,4
  124.  
  125.         mov     eax,[menu_rectangles+esi]
  126.         mov     ebx,[menu_rectangles+esi+4]
  127.         mov     ecx,[menu_rectangles+esi+8]
  128.         mov     edx,[menu_rectangles+esi+12]
  129.         mov     esi,1
  130.         mov     [menu_coordinat_x],eax
  131.         mov     [menu_size_x],ecx
  132.         call    draw_volume_rectangle
  133.         pop     esi
  134.  
  135. calculate_counter_menu:
  136. ;calculate menu counter
  137.         mov     eax,[counter]
  138.         dec     eax
  139.         shl     eax,2
  140.         mov     ebx,[menu_counters+eax]
  141.         mov     [counter_menu],ebx
  142.  
  143.         call    GetMouseCoordinats
  144.  
  145.         and     [menu_counter],0
  146.  
  147.         push    esi edi
  148. ;ᣫ ¦¨¢ ­¨¥  ­¨¬ æ¨¨ >>>>>>>>>>>>>>>>>>
  149. ;       mcall   18,4
  150.  
  151. menu_loop:
  152.         mov     eax,[menu_coordinat_x]
  153.         mov     ebx,36
  154.         mov     ecx,[MouseX]
  155.         mov     edx,[MouseY]
  156.         mov     esi,[menu_size_x]
  157.         mov     edi,18
  158.         add     ebx,[menu_counter]
  159.         add     eax,2
  160.         sub     esi,3
  161.         inc     ebx
  162.         call    columnus
  163.         mov     esi,7
  164.  
  165.         test    eax,eax
  166.         jz      no_columnus_menu_text
  167.  
  168.         mov     esi,1
  169.  
  170. no_columnus_menu_text:
  171.         mov     eax,[menu_coordinat_x]
  172.         mov     ebx,36
  173.         mov     ecx,[menu_size_x]
  174.         mov     edx,18
  175.         add     ebx,[menu_counter]
  176.         add     eax,2
  177.         sub     ecx,3
  178.         inc     ebx
  179.         call    draw_volume_rectangle
  180.         add     [menu_counter],20
  181.  
  182.         dec     [counter_menu]
  183.         jnz     menu_loop
  184.  
  185. ;print menu text
  186.         push    [counter]
  187.         mov     esi,[counter]
  188.         dec     esi
  189.         shl     esi,2
  190.         mov     edi,[menu_text_en+esi]
  191.         mov     eax,[menu_counters+esi]
  192.         mov     [counter],eax
  193.         call    print_panel_text
  194.         pop     [counter]
  195.         pop     edi esi
  196.  
  197.  
  198. menu_still:
  199.         mcall   10
  200.         mcall   2
  201.         mcall   17
  202.         call    GetMouseClick
  203.         test    eax,eax
  204.         jz      calculate_counter_menu
  205.  
  206.         call    GetMouseCoordinats
  207. ;calculate menu counter
  208.         mov     eax,[counter]
  209.         dec     eax
  210.         shl     eax,2
  211.         mov     ebx,[menu_counters+eax]
  212.         mov     [counter_menu],ebx
  213.  
  214.         and     [menu_counter],0
  215.         and     [counter_11],0
  216.  
  217.         push    esi edi
  218.  
  219. menu_loop2:
  220.         mov     eax,[menu_coordinat_x]
  221.         mov     ebx,36
  222.         mov     ecx,[MouseX]
  223.         mov     edx,[MouseY]
  224.         mov     esi,[menu_size_x]
  225.         mov     edi,18
  226.         add     ebx,[menu_counter]
  227.         add     eax,2
  228.         sub     esi,3
  229.         inc     ebx
  230.         call    columnus
  231.  
  232.         inc     [counter_11]
  233.         test    eax,eax
  234.         jz      no_columnus_menu_text2
  235.  
  236.         mov     esi,[counter_11]
  237.         mov     [number_menu],esi
  238.  
  239. no_columnus_menu_text2:
  240.         add     [menu_counter],20
  241.         dec     [counter_menu]
  242.         jnz     menu_loop2
  243.  
  244.         pop     edi esi
  245.  
  246.         mcall   5,15
  247.  
  248.         push    [counter]
  249.         pusha
  250.         call    drawwin
  251.         popa
  252.         pop     [counter]
  253.  
  254.         mov     eax,[counter]
  255.         mov     [number_panel],eax
  256.  
  257.         jmp     TakeInstruments
  258.  
  259. ;---------------------------------------------------------
  260. ;------print mouse position on panel----------------------
  261. ;---------------------------------------------------------
  262. PrintMousePos:
  263.         pushad
  264.         mov     eax,[Window_SizeX]
  265.         sub     eax,75
  266.         mov     ebx,20+15+6
  267.         mov     ecx,52
  268.         mov     edx,18
  269.         mov     esi,4
  270.         call    draw_volume_rectangle
  271.  
  272.         mov     eax,[Window_SizeX]
  273.         sub     eax,75
  274.         mov     ebx,20+15+6+18+2
  275.         mov     ecx,52
  276.         mov     edx,18
  277.         mov     esi,4
  278.         call    draw_volume_rectangle
  279.  
  280.         mov     eax,[Window_SizeX]
  281.         sub     eax,70
  282.         mov     ebx,20+15+6+6
  283.         and     ecx,0
  284.         mov     edx,mouse_pos_x
  285.         mov     esi,2
  286.         call    print_text
  287.  
  288.         mov     eax,[Window_SizeX]
  289.         sub     eax,70
  290.         mov     ebx,20+15+6+6+18+1
  291.         and     ecx,0
  292.         mov     edx,mouse_pos_y
  293.         mov     esi,2
  294.         call    print_text
  295.  
  296.         mov     ecx,[ScreenX]
  297.         add     ecx,[PosX]
  298.         mov     edx,[Window_SizeX]
  299.         sub     edx,55
  300.         shl     edx,16
  301.         add     edx,20+15+6+6
  302.         and     esi,0
  303.         mcall   47,<4,0>
  304.  
  305.         mov     ecx,[ScreenY]
  306.         add     ecx,[PosY]
  307.         mov     edx,[Window_SizeX]
  308.         sub     edx,55
  309.         shl     edx,16
  310.         add     edx,20+15+6+18+1+6
  311.         mcall
  312.  
  313.         popad
  314.         ret
  315.  
  316. ;----------------------------------------------------------
  317. ;----------print text on the panel and menu----------------
  318. ;----------------------------------------------------------
  319. print_panel_text:
  320. next_panel_text:
  321.         mov     eax,[edi]
  322.         mov     ebx,[edi+4]
  323. ;       xor     ecx,ecx
  324.         mov     ecx,0x10000000
  325.         mov     edx,edi
  326.         add     edx,12
  327.         mov     esi,[edi+8]
  328.         add     edi,esi
  329.         add     edi,3*4
  330.  
  331.         push    edi
  332.         call    print_text
  333.         pop     edi
  334.  
  335.         dec     [counter]
  336.         jnz     next_panel_text
  337.         ret
  338. ;----------------------------------------------------------
  339. ;------------draw lines of scoll---------------------------
  340. ;----------------------------------------------------------
  341. draw_scrollers:
  342.         mov     edi,[CounterX]
  343.         mov     eax,[Scroll1CoordinatX]
  344.         mov     ebx,[Window_SizeY]
  345.         sub     ebx,22+10
  346.         mov     ecx,[Window_SizeX]
  347.         sub     ecx,10+5+20+10+1
  348.         mov     edx,14+10
  349.         mov     esi,1
  350.         mov     [Scroll1CoordinatX],eax
  351.         mov     [Scroll1CoordinatY],ebx
  352.         mov     [Scroll1MaxSizeY],edx
  353.         mov     [Scroll1MaxSizeX],ecx
  354.         imul    ecx,edi
  355.         push    eax     ebx     edx
  356.         mov     eax,ecx
  357.         mov     ebx,[Picture_SizeX]
  358.         cdq
  359.         idiv    ebx
  360.         mov     ecx,eax
  361.         pop     edx     ebx     eax
  362.         mov     [Scroll1SizeX],ecx
  363.         mov     edi,[Scroll1MaxSizeX]
  364.         sub     edi,ecx
  365.         mov     [Scroll1FreeX],edi
  366.         call    draw_volume_rectangle
  367.  
  368.         mov     eax,[Window_SizeX]
  369.         sub     eax,22+10
  370.         mov     ebx,[Scroll2CoordinatY]
  371.         mov     ecx,14+10
  372.         mov     edx,[Window_SizeY]
  373.         sub     edx,20+15+1+49+10+20+11
  374.         mov     esi,1
  375.         mov     [Scroll2CoordinatX],eax
  376.         mov     [Scroll2CoordinatY],ebx
  377.         mov     [Scroll2MaxSizeX],ecx
  378.         mov     [Scroll2MaxSizeY],edx
  379.  
  380.         imul    edx,[CounterY]
  381.         push    eax     ebx
  382.         mov     eax,edx
  383.         mov     ebx,[Picture_SizeY]
  384.         cdq
  385.         idiv    ebx
  386.         mov     edx,eax
  387.         pop     ebx     eax
  388.         mov     [Scroll2SizeY],edx
  389.         mov     edi,[Scroll2MaxSizeY]
  390.         sub     edi,edx
  391.         mov     [Scroll2FreeY],edi
  392.  
  393.         call    draw_volume_rectangle
  394.  
  395.         ret
  396.  
  397. button_menu_size_x      dd 0
  398. button_menu_size_y      dd 0