Subversion Repositories Kolibri OS

Rev

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

  1.  
  2. void PipetteTool_activate() {
  3.         SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE);
  4. }
  5.  
  6. void PipetteTool_onMouseEvent(int mouseX, int mouseY, int lkm, int pkm) {
  7.         //if (!canvas.hovered()) return; //TODO: option "Restrict pipette to canvas area"
  8.         tool_color = GetPixelUnderMouse();
  9.         DrawBar(Form.cwidth-30, 5, 20, 20, tool_color);
  10.        
  11.         if (mouse.down) {
  12.                 DrawBar(Form.cwidth-30, 5, 20, 20, system.color.work);
  13.                 SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
  14.                 if (mouse.key&MOUSE_LEFT) EventSetActiveColor(1, tool_color);
  15.                 if (mouse.key&MOUSE_RIGHT) EventSetActiveColor(2, tool_color);
  16.                
  17.                 setCurrentTool(previousTool);
  18.         }
  19. }
  20.