Subversion Repositories Kolibri OS

Rev

Rev 6360 | Go to most recent revision | 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.         ret
  12.  
  13. draw_icons:
  14.         mov [Icon_X],ci_panel_x_pos+2
  15.         mov [Icon_Y],ci_panel_y_pos+3
  16.  
  17.          ;draw panel picture
  18.          mov edx,[Icon_X]
  19.          shl edx,16
  20.          add edx,[Icon_Y]
  21.          mov ebx,[ScreenPointer]
  22.          add ebx,mem_screen
  23.          mov ecx,417*65536+46
  24.          mcall SF_PUT_IMAGE
  25.  
  26.  
  27.          ;main buttons of instrumnts
  28.  
  29.          and [counter],0
  30.          mov [Icon_X],ci_panel_x_pos+4
  31.  
  32.    main_buttons:
  33.  
  34.          mov ebx,[Icon_X]
  35.          mov ecx,ci_panel_but_y1
  36.          dec ebx
  37.          dec ecx
  38.          shl ebx,16
  39.          shl ecx,16
  40.          add ebx,18
  41.          add ecx,19
  42.          mov edx,[counter]
  43.          add edx,10
  44.          add edx,1000000000000000000000000000000b
  45.          mcall SF_DEFINE_BUTTON
  46.  
  47.  
  48.          add [Icon_X],22
  49.  
  50.          inc [counter]
  51.          cmp [counter],19
  52.          jne main_buttons
  53.  
  54.  
  55.          ;buttons of brushes(and lines width)
  56.          and [counter],0
  57.  
  58.          mov [Icon_X],ci_panel_x_pos+4
  59.  
  60.          next_button_brush:
  61.  
  62.          mov ebx,[Icon_X]
  63.          mov ecx,ci_panel_but_y2
  64.          dec ebx
  65.          dec ecx
  66.          shl ebx,16
  67.          shl ecx,16
  68.          add ebx,18
  69.          add ecx,19
  70.          mov edx,[counter]
  71.          add edx,40
  72.          add edx,1000000000000000000000000000000b
  73.          mcall SF_DEFINE_BUTTON
  74.  
  75.          add [Icon_X],19
  76.  
  77.          inc [counter]
  78.          cmp [counter],5
  79.          jne next_button_brush
  80.  
  81.  
  82.          ;buttons of zoom
  83.          and [counter],0
  84.  
  85.          mov [Icon_X],ci_panel_x_pos+178
  86.  
  87.          next_button_zoom:
  88.  
  89.          mov ebx,[Icon_X]
  90.          mov ecx,ci_panel_but_y2
  91.          dec ebx
  92.          dec ecx
  93.          shl ebx,16
  94.          shl ecx,16
  95.          add ebx,18
  96.          add ecx,19
  97.          mov edx,[counter]
  98.          add edx,45
  99.          add edx,1000000000000000000000000000000b
  100.          mcall SF_DEFINE_BUTTON
  101.  
  102.          add [Icon_X],19
  103.  
  104.          inc [counter]
  105.          cmp [counter],6
  106.          jne next_button_zoom
  107.  
  108.  
  109.          ; button of palette
  110.          mov [Icon_X],ci_panel_x_pos+108
  111.  
  112.          mov ebx,[Icon_X]
  113.          mov ecx,ci_panel_but_y2-1
  114.          dec ebx
  115.          dec ecx
  116.          shl ebx,16
  117.          shl ecx,16
  118.          add ebx,20
  119.          add ecx,21
  120.          mov edx,51
  121.          add edx,1000000000000000000000000000000b
  122.          mcall SF_DEFINE_BUTTON
  123.  
  124.          ; button of color
  125.          mov [Icon_X],ci_panel_x_pos+131
  126.  
  127.          mov ebx,[Icon_X]
  128.          mov ecx,ci_panel_but_y2-1
  129.          dec ebx
  130.          dec ecx
  131.          shl ebx,16
  132.          shl ecx,16
  133.          add ebx,20
  134.          add ecx,20
  135.          mov edx,52
  136.          add edx,1000000000000000000000000000000b
  137.          mcall SF_DEFINE_BUTTON
  138.  
  139.         mcall SF_DRAW_RECT, ((ci_panel_x_pos+130) shl 16)+21,\
  140.                 ((ci_panel_y_pos+28) shl 16)+21, [Color]
  141.  
  142.         ret
  143.