/*
  ==============================================================================

    This file was auto-generated by the Jucer!

    It contains the basic startup code for a Juce application.

  ==============================================================================
*/

#include "FancyButton.h"


//==============================================================================
FancyButton::FancyButton()
{
	buttonImage = ImageFileFormat::loadFrom (button::buttons_png, button::buttons_pngSize);
	

	frameWidth = 20;

}

FancyButton::~FancyButton()
{
}

//==============================================================================
void FancyButton::paint (Graphics& g)
{
	if (FancyButton::getToggleState() == true)
		  g.drawImage (buttonImage, 0,0,20,20, 20, 0, 20, 20, false);
	else if (FancyButton::getToggleState() == false)
		  g.drawImage (buttonImage, 0,0,20,20, 0, 0, 20, 20, false);
	/*
   const double div   = 1.0 / 15.0;
   double pos         = (int)(VolumeDial::getValue() / div);

   if (pos > 0)
      pos = pos - 1;
   if (VolumeDial::getWidth() == 100)
      g.drawImage (knobImage, 0,0,100,100, 0, (int)(pos*100), 100, 100, false);
   else if (VolumeDial::getWidth() == 40)
      g.drawImage (smallKnobImage, 0,0,40,40, 0, (int)(pos*40), 40, 40, false);
*/
}


/* thanks to anita for the math 

void FilmStripSlider::drawFrame (Graphics &g, int x, int y, int width, int height, Slider &slider)
{
   const double div   = slider.getMaximum() / frameCount;
   double pos         = (int)(slider.getValue() / div);

   if (pos > 0)
      pos = pos - 1;



   if (isVerticalStrip)
   {
      g.drawImage (knobStrip, x, y, width, height, 0, (int)(pos*frameSize), frameSize, frameSize, false);
   }

}*/