Subversion Repositories Kolibri OS

Rev

Rev 485 | Rev 1643 | 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.         mov eax,18
  7.         mov ebx,14
  8.         ;mcall
  9.  
  10.         and [Panel_flag],0
  11.         ;collision with text on panel
  12.       next_columnus_text:
  13.  
  14.         mov eax,[edi]
  15.         mov ebx,[edi+4]
  16.         sub eax,10
  17.         sub ebx,3
  18.         mov [Icon_text_x],eax
  19.         mov [Icon_text_y],ebx
  20.  
  21.         mov esi,[edi+8]
  22.         imul esi,10
  23.         mov [button_menu_size_x],esi
  24.         mov [button_menu_size_y],dword 13
  25.  
  26.         mov esi,[edi+8]
  27.         add edi,4*3
  28.         add edi,esi
  29.  
  30.         mov ecx,[MouseX]
  31.         mov edx,[MouseY]
  32.  
  33.         push edi
  34.         mov edi,[button_menu_size_y]
  35.         mov esi,[button_menu_size_x]
  36.         call columnus
  37.  
  38.         pop edi
  39.         mov esi,7
  40.  
  41.         test eax,eax
  42.         jz no_columnus_text
  43.  
  44.         mov esi,1
  45.         mov [Panel_flag],1
  46.         call GetMouseClick
  47.  
  48.         test eax,eax
  49.         jz no_mouse_pressed
  50.  
  51.         mov eax,18
  52.         mov ebx,14
  53.         ;mcall
  54.  
  55.         call print_panel_menu
  56.  
  57.         no_mouse_pressed:
  58.  
  59.         no_columnus_text:
  60.  
  61.         mov eax,[Icon_text_x]
  62.         mov ebx,[Icon_text_y]
  63.         mov ecx,[button_menu_size_x]            ;-------------------------
  64.         mov edx,[button_menu_size_y]
  65.         call draw_volume_rectangle
  66.  
  67.         push [counter]
  68.         push edi
  69.         mov [counter],7
  70.         mov edi,panel_text
  71.         call print_panel_text
  72.  
  73.         pop edi
  74.         pop [counter]
  75.         dec [counter]
  76.         jnz next_columnus_text
  77.  
  78.         ret
  79. ;---------------------------------------------------------
  80. ;-----draw panel menu(main engin of panel)----------------
  81. ;---------------------------------------------------------
  82. print_panel_menu:
  83.  
  84.  
  85.         push [counter]
  86.         ;delit main buttons(some time)
  87.  
  88.         mov [counter],10
  89.  
  90.         next_icon_delit1:
  91.  
  92.         mov eax,8
  93.         mov edx,[counter]
  94.         add edx,11100000000000000000000000000000b
  95.         mcall
  96.         inc [counter]
  97.  
  98.         cmp [counter],30
  99.         jl next_icon_delit1
  100.  
  101.         ;delit buttons of brushes
  102.         mov [counter],40
  103.  
  104.         next_icon_delit2:
  105.  
  106.         mov eax,8
  107.         mov edx,[counter]
  108.         add edx,11100000000000000000000000000000b
  109.         mcall
  110.         inc [counter]
  111.  
  112.         cmp [counter],45
  113.         jl next_icon_delit2
  114.  
  115.         ;delit buttons of zoom
  116.         mov [counter],45
  117.  
  118.         next_icon_delit3:
  119.  
  120.         mov eax,8
  121.         mov edx,[counter]
  122.         add edx,11100000000000000000000000000000b
  123.         mcall
  124.         inc [counter]
  125.  
  126.         cmp [counter],50
  127.         jl next_icon_delit3
  128.  
  129.         ;delit buttons of palette
  130.         mov eax,8
  131.         mov edx,51
  132.         add edx,11100000000000000000000000000000b
  133.         mcall
  134.  
  135.  
  136.         ;delit buttons of color
  137.         mov eax,8
  138.         mov edx,52
  139.         add edx,11100000000000000000000000000000b
  140.         mcall
  141.  
  142.         pop [counter]
  143.  
  144.         push esi
  145.         mov esi,[counter]
  146.         dec esi
  147.         shl esi,4
  148.  
  149.         mov eax,[menu_rectangles+esi]
  150.         mov ebx,[menu_rectangles+esi+4]
  151.         mov ecx,[menu_rectangles+esi+8]
  152.         mov edx,[menu_rectangles+esi+12]
  153.         mov esi,1
  154.         mov [menu_coordinat_x],eax
  155.         mov [menu_size_x],ecx
  156.         call draw_volume_rectangle
  157.         pop esi
  158.  
  159.     calculate_counter_menu:
  160.  
  161.  
  162.         ;calculate menu counter
  163.         mov eax,[counter]
  164.         dec eax
  165.         shl eax,2
  166.         mov ebx,[menu_counters+eax]
  167.         mov [counter_menu],ebx
  168.  
  169.         call GetMouseCoordinats
  170.  
  171.         and [menu_counter],0
  172.         push esi
  173.         push edi
  174.         ;ᣫ ¦¨¢ ­¨¥  ­¨¬ æ¨¨ >>>>>>>>>>>>>>>>>>
  175.         mov eax,18
  176.         mov ebx,14
  177.         ;mcall
  178.  
  179.     menu_loop:
  180.  
  181.         mov eax,[menu_coordinat_x]
  182.         mov ebx,36
  183.         mov ecx,[MouseX]
  184.         mov edx,[MouseY]
  185.         mov esi,[menu_size_x]
  186.         mov edi,18
  187.         add ebx,[menu_counter]
  188.         add eax,2
  189.         sub esi,3
  190.         inc ebx
  191.         call columnus
  192.         mov esi,7
  193.  
  194.         test eax,eax
  195.         jz no_columnus_menu_text
  196.  
  197.         mov esi,1
  198.  
  199.         no_columnus_menu_text:
  200.  
  201.         mov eax,[menu_coordinat_x]
  202.         mov ebx,36
  203.         mov ecx,[menu_size_x]
  204.         mov edx,18
  205.         add ebx,[menu_counter]
  206.         add eax,2
  207.         sub ecx,3
  208.         inc ebx
  209.         call draw_volume_rectangle
  210.         add [menu_counter],20
  211.  
  212.  
  213.         dec [counter_menu]
  214.         jnz menu_loop
  215.  
  216.  
  217.         ;print menu text
  218.         push [counter]
  219.         mov esi,[counter]
  220.         dec esi
  221.         shl esi,2
  222.         mov edi,[menu_text_en+esi]
  223.         mov eax,[menu_counters+esi]
  224.         mov [counter],eax
  225.         call print_panel_text
  226.         pop [counter]
  227.         pop edi
  228.         pop esi
  229.  
  230.  
  231.         menu_still:
  232.  
  233.         mov eax,10
  234.         mcall
  235.         mov eax,2
  236.         mcall
  237.         mov eax,17
  238.         mcall
  239.  
  240.         call GetMouseClick
  241.  
  242.         test eax,eax
  243.         jz calculate_counter_menu
  244.  
  245.         call GetMouseCoordinats
  246.  
  247.         ;calculate menu counter
  248.         mov eax,[counter]
  249.         dec eax
  250.         shl eax,2
  251.         mov ebx,[menu_counters+eax]
  252.         mov [counter_menu],ebx
  253.  
  254.         and [menu_counter],0
  255.         and [counter_11],0
  256.  
  257.         push esi
  258.         push edi
  259.  
  260.     menu_loop2:
  261.  
  262.  
  263.         mov eax,[menu_coordinat_x]
  264.         mov ebx,36
  265.         mov ecx,[MouseX]
  266.         mov edx,[MouseY]
  267.         mov esi,[menu_size_x]
  268.         mov edi,18
  269.         add ebx,[menu_counter]
  270.         add eax,2
  271.         sub esi,3
  272.         inc ebx
  273.         call columnus
  274.  
  275.         inc [counter_11]
  276.  
  277.         test eax,eax
  278.         jz no_columnus_menu_text2
  279.  
  280.         mov esi,[counter_11]
  281.         mov [number_menu],esi
  282.  
  283.         no_columnus_menu_text2:
  284.  
  285.         add [menu_counter],20
  286.  
  287.         dec [counter_menu]
  288.         jnz menu_loop2
  289.  
  290.         pop edi
  291.         pop esi
  292.  
  293.         mov eax,5
  294.         mov ebx,15
  295.         mcall
  296.  
  297.         push [counter]
  298.         pushad
  299.  
  300.         call drawwin
  301.  
  302.         popad
  303.         pop [counter]
  304.  
  305.         mov eax,[counter]
  306.         mov [number_panel],eax
  307.  
  308.         call TakeInstruments
  309.         jmp still
  310.  
  311. ;---------------------------------------------------------
  312. ;------print mouse position on panel----------------------
  313. ;---------------------------------------------------------
  314. PrintMousePos:
  315.  
  316.         pushad
  317.  
  318.         mov eax,[Window_SizeX]
  319.         sub eax,75
  320.         mov ebx,20+15+6
  321.         mov ecx,52
  322.         mov edx,18
  323.         mov esi,4
  324.         call draw_volume_rectangle
  325.  
  326.         mov eax,[Window_SizeX]
  327.         sub eax,75
  328.         mov ebx,20+15+6+18+2
  329.         mov ecx,52
  330.         mov edx,18
  331.         mov esi,4
  332.         call draw_volume_rectangle
  333.  
  334.         mov eax,[Window_SizeX]
  335.         sub eax,70
  336.         mov ebx,20+15+6+6
  337.         and ecx,0
  338.         mov edx,mouse_pos_x
  339.         mov esi,2
  340.         call print_text
  341.  
  342.         mov eax,[Window_SizeX]
  343.         sub eax,70
  344.         mov ebx,20+15+6+6+18+1
  345.         and ecx,0
  346.         mov edx,mouse_pos_y
  347.         mov esi,2
  348.         call print_text
  349.  
  350.         mov eax,47
  351.         mov ebx,4*65536
  352.         mov ecx,[ScreenX]
  353.         add ecx,[PosX]
  354.         mov edx,[Window_SizeX]
  355.         sub edx,55
  356.         shl edx,16
  357.         add edx,20+15+6+6
  358.         and esi,0
  359.         mcall
  360.  
  361.         mov eax,47
  362.         mov ebx,4*65536
  363.         mov ecx,[ScreenY]
  364.         add ecx,[PosY]
  365.         mov edx,[Window_SizeX]
  366.         sub edx,55
  367.         shl edx,16
  368.         add edx,20+15+6+18+1+6
  369.         and esi,0
  370.         mcall
  371.  
  372.         popad
  373.         ret
  374. ;----------------------------------------------------------
  375. ;---------------draw panel in window of program------------
  376. ;----------------------------------------------------------
  377. draw_panel:
  378.  
  379.         mov eax,5
  380.         mov ebx,20
  381.         mov ecx,[Window_SizeX]
  382.         mov edx,15
  383.         mov esi,6
  384.         sub ecx,10
  385.         call draw_volume_rectangle ; top menu - file and etc.
  386.  
  387.         ;mov eax,5
  388.         ;mov ebx,20
  389.         ;mov ecx,[Window_SizeX]
  390.         ;mov edx,15
  391.         ;mov esi,6
  392.         ;sub ecx,10
  393.         ;call draw_volume_rectangle
  394.  
  395.         mov eax,5
  396.         mov ebx,20+15+1
  397.         mov ecx,[Window_SizeX]
  398.         mov edx,50
  399.         mov esi,1
  400.         sub ecx,10
  401.         call draw_volume_rectangle ; tools panel
  402.  
  403.         mov eax,5
  404.         mov ebx,20+15+1+50+1
  405.         mov ecx,[Window_SizeX]
  406.         mov edx,[Window_SizeY]
  407.         mov esi,1
  408.         sub ecx,10+20
  409.         sub edx,20+15+1+50+1+5+20
  410.         call draw_volume_rectangle      ; picure area
  411.  
  412.         mov eax,5
  413.         mov ebx,[Window_SizeY]
  414.         mov ecx,[Window_SizeX]
  415.         mov edx,20+10
  416.         mov esi,3
  417.         sub ecx,30
  418.         sub ebx,25+10
  419.         call draw_volume_rectangle      ; horizontal scrollbar
  420.  
  421.         mov eax,[Window_SizeX]
  422.         mov ebx,20+15+1+49+2
  423.         mov ecx,20+10
  424.         mov edx,[Window_SizeY]
  425.         mov esi,3
  426.         sub eax,25+10
  427.         sub edx,20+15+1+49+5+20
  428.         call draw_volume_rectangle      ; vertical scrollbar
  429.  
  430.         mov eax,[Window_SizeX]
  431.         mov ebx,[Window_SizeY]
  432.         mov ecx,20+10
  433.         mov edx,20+10
  434.         mov esi,6
  435.         sub eax,25+10
  436.         sub ebx,25+10
  437.         call draw_volume_rectangle      ; down and right small area
  438.  
  439.         ;mov eax,445
  440.         ;mov ebx,20+15+6
  441.         ;mov ecx,37
  442.         ;mov edx,37
  443.         ;mov esi,4
  444.         ;call draw_volume_rectangle
  445.  
  446.         ret
  447.  
  448.  
  449. ;----------------------------------------------------------
  450. ;----------print text on the panel and menu----------------
  451. ;----------------------------------------------------------
  452. print_panel_text:
  453.        next_panel_text:
  454.  
  455.         mov eax,[edi]
  456.         mov ebx,[edi+4]
  457.         ;xor ecx,ecx
  458.         mov ecx,0x10000000
  459.         mov edx,edi
  460.         add edx,12
  461.         mov esi,[edi+8]
  462.         add edi,esi
  463.         add edi,3*4
  464.  
  465.         push edi
  466.         call print_text
  467.         pop edi
  468.  
  469.         dec [counter]
  470.         jnz next_panel_text
  471.         ret
  472. ;----------------------------------------------------------
  473. ;------------draw lines of scoll---------------------------
  474. ;----------------------------------------------------------
  475. draw_scrollers:
  476.  
  477.          mov edi,[CounterX]
  478.          mov eax,[Scroll1CoordinatX]
  479.          mov ebx,[Window_SizeY]
  480.          sub ebx,22+10
  481.          mov ecx,[Window_SizeX]
  482.          sub ecx,10+5+20+10+1
  483.          mov edx,14+10
  484.          mov esi,1
  485.          mov [Scroll1CoordinatX],eax
  486.          mov [Scroll1CoordinatY],ebx
  487.          mov [Scroll1MaxSizeY],edx
  488.          mov [Scroll1MaxSizeX],ecx
  489.          imul ecx,edi
  490.          push eax
  491.          push ebx
  492.          push edx
  493.          mov eax,ecx
  494.          mov ebx,[Picture_SizeX]
  495.          cdq
  496.          idiv ebx
  497.          mov ecx,eax
  498.          pop edx
  499.          pop ebx
  500.          pop eax
  501.          mov [Scroll1SizeX],ecx
  502.          mov edi,[Scroll1MaxSizeX]
  503.          sub edi,ecx
  504.          mov [Scroll1FreeX],edi
  505.          call draw_volume_rectangle
  506.  
  507.          mov eax,[Window_SizeX]
  508.          sub eax,22+10
  509.          mov ebx,[Scroll2CoordinatY]
  510.          mov ecx,14+10
  511.          mov edx,[Window_SizeY]
  512.          sub edx,20+15+1+49+10+20+11
  513.          mov esi,1
  514.          mov [Scroll2CoordinatX],eax
  515.          mov [Scroll2CoordinatY],ebx
  516.          mov [Scroll2MaxSizeX],ecx
  517.          mov [Scroll2MaxSizeY],edx
  518.  
  519.          imul edx,[CounterY]
  520.          push eax
  521.          push ebx
  522.          mov eax,edx
  523.          mov ebx,[Picture_SizeY]
  524.          cdq
  525.          idiv ebx
  526.          mov edx,eax
  527.          pop ebx
  528.          pop eax
  529.          mov [Scroll2SizeY],edx
  530.          mov edi,[Scroll2MaxSizeY]
  531.          sub edi,edx
  532.          mov [Scroll2FreeY],edi
  533.  
  534.          call draw_volume_rectangle
  535.  
  536.          ret
  537.          ret
  538.  
  539. button_menu_size_x  dd 0
  540. button_menu_size_y  dd 0