Subversion Repositories Kolibri OS

Rev

Rev 6369 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;-----------------------------------------------------------
  2. ;---load icons  in memory and draw icons on panel-----------
  3. ;-----------------------------------------------------------
  4. load_icons:
  5.         stdcall [img_decode], panel_picture, panel_picture.end-panel_picture, 0
  6.         mov ebx,eax
  7.         mov edi,[ScreenPointer]
  8.         add edi,mem_screen
  9.         stdcall [img_to_rgb2], ebx,edi ;преобразуем изображение к формату rgb
  10.         stdcall [img_destroy], ebx ;удаляем временный буфер с параметрами изображения
  11.  
  12.         stdcall [img_decode], panel_zoom, panel_zoom.end-panel_zoom, 0
  13.         mov ebx,eax
  14.         add edi,mem_panel_but
  15.         stdcall [img_to_rgb2], ebx,edi
  16.         stdcall [img_destroy], ebx
  17.         ret
  18.  
  19. draw_icons:
  20.         mov [Icon_X],ci_panel_x_pos+2
  21.         mov [Icon_Y],ci_panel_y_pos+3
  22.  
  23.         ;draw panel picture
  24.         mov edx,[Icon_X]
  25.         shl edx,16
  26.         add edx,[Icon_Y]
  27.         mov ebx,[ScreenPointer]
  28.         add ebx,mem_screen
  29.         mov ecx,417*65536+46
  30.         mcall SF_PUT_IMAGE
  31.  
  32.         ;draw active zoom button
  33.         add ebx,mem_panel_but
  34.         xor eax,eax
  35.         cmp [k],1
  36.         je .end_calc
  37.         inc eax
  38.         cmp [k],2
  39.         je @f
  40.         inc eax
  41.         cmp [k],3
  42.         je @f
  43.         inc eax
  44.         cmp [k],4
  45.         je @f
  46.         inc eax
  47.         cmp [k],8
  48.         je @f
  49.         inc eax
  50.         cmp [k],16
  51.         je @f
  52.         inc eax
  53.         @@:
  54.                 mov edx,eax
  55.                 imul edx,18*21*3
  56.                 add ebx,edx
  57.         .end_calc:
  58.         mov edx,eax
  59.         imul edx,18+1
  60.         add edx,ci_panel_zoom_x-1
  61.         shl edx,16
  62.         add edx,ci_panel_but_y2-2
  63.         mov ecx,18*65536+21
  64.         mcall SF_PUT_IMAGE
  65.  
  66.         ;main buttons of instrumnts
  67.  
  68.         and [counter],0
  69.         mov [Icon_X],ci_panel_x_pos+4
  70.  
  71.    main_buttons:
  72.  
  73.          mov ebx,[Icon_X]
  74.          mov ecx,ci_panel_but_y1
  75.          dec ebx
  76.          dec ecx
  77.          shl ebx,16
  78.          shl ecx,16
  79.          add ebx,18
  80.          add ecx,19
  81.          mov edx,[counter]
  82.          add edx,10
  83.          add edx,1000000000000000000000000000000b
  84.          mcall SF_DEFINE_BUTTON
  85.  
  86.  
  87.          add [Icon_X],22
  88.  
  89.          inc [counter]
  90.          cmp [counter],19
  91.          jne main_buttons
  92.  
  93.  
  94.          ;buttons of brushes(and lines width)
  95.          and [counter],0
  96.  
  97.          mov [Icon_X],ci_panel_x_pos+4
  98.  
  99.          next_button_brush:
  100.  
  101.          mov ebx,[Icon_X]
  102.          mov ecx,ci_panel_but_y2
  103.          dec ebx
  104.          dec ecx
  105.          shl ebx,16
  106.          shl ecx,16
  107.          add ebx,18
  108.          add ecx,19
  109.          mov edx,[counter]
  110.          add edx,40
  111.          add edx,1000000000000000000000000000000b
  112.          mcall SF_DEFINE_BUTTON
  113.  
  114.          add [Icon_X],19
  115.  
  116.          inc [counter]
  117.          cmp [counter],5
  118.          jne next_button_brush
  119.  
  120.  
  121.          ;buttons of zoom
  122.          and [counter],0
  123.  
  124.          mov [Icon_X],ci_panel_x_pos+ci_panel_zoom_x
  125.  
  126.          next_button_zoom:
  127.  
  128.          mov ebx,[Icon_X]
  129.          mov ecx,ci_panel_but_y2
  130.          dec ebx
  131.          dec ecx
  132.          shl ebx,16
  133.          shl ecx,16
  134.          add ebx,18
  135.          add ecx,19
  136.          mov edx,[counter]
  137.          add edx,45
  138.          add edx,1000000000000000000000000000000b
  139.          mcall SF_DEFINE_BUTTON
  140.  
  141.          add [Icon_X],19
  142.  
  143.          inc [counter]
  144.          cmp [counter],6
  145.          jne next_button_zoom
  146.  
  147.  
  148.          ; button of palette
  149.          mov [Icon_X],ci_panel_x_pos+108
  150.  
  151.          mov ebx,[Icon_X]
  152.          mov ecx,ci_panel_but_y2-1
  153.          dec ebx
  154.          dec ecx
  155.          shl ebx,16
  156.          shl ecx,16
  157.          add ebx,20
  158.          add ecx,21
  159.          mov edx,51
  160.          add edx,1000000000000000000000000000000b
  161.          mcall SF_DEFINE_BUTTON
  162.  
  163.          ; button of color
  164.          mov [Icon_X],ci_panel_x_pos+131
  165.  
  166.          mov ebx,[Icon_X]
  167.          mov ecx,ci_panel_but_y2-1
  168.          dec ebx
  169.          dec ecx
  170.          shl ebx,16
  171.          shl ecx,16
  172.          add ebx,20
  173.          add ecx,20
  174.          mov edx,52
  175.          add edx,1000000000000000000000000000000b
  176.          mcall SF_DEFINE_BUTTON
  177.  
  178.         mcall SF_DRAW_RECT, ((ci_panel_x_pos+130) shl 16)+21,\
  179.                 ((ci_panel_y_pos+28) shl 16)+21, [Color]
  180.  
  181.         ret
  182.