void CpuRegistersComponent::paint(juce::Graphics& g)
{
	g.fillAll(juce::Colours::white);

	g.setColour(juce::Colours::orange);
	g.drawRect(getLocalBounds(), 1);
}
void NTLookAndFeel::drawTickBox(juce::Graphics &g, juce::Component &button, float x, float y, float w, float h, bool ticked, bool isEnabled, bool isMouseOverButton, bool isButtonDown){
    
    auto& toggle = dynamic_cast<ToggleButton&>(button);
    
    if (toggle.getRadioGroupId() > 0) {
        auto rect = Rectangle<float>(x,y,w,h);
        rect.reduce(w * .2, h*.2);
        
        g.setColour(Colours::white);
        g.fillEllipse(rect);
        g.setColour(Colours::lightgrey);
        g.drawEllipse(rect,2);
        
        if (ticked) {
            rect.reduce(rect.getWidth() * .2,rect.getHeight() *.2);

            g.fillEllipse(rect);
        }
    }else{
        auto rect = Rectangle<float>(x,y,w,h);
        g.setColour(Colours::white);
        g.fillRect(rect);
        g.setColour(Colours::lightgrey);
        g.drawRect(rect,3);
        if (ticked) {
            rect.reduce(rect.getWidth() * .25,rect.getHeight() *.25);
            g.fillRect(rect);
        }

    }
    
    
}
void NTLookAndFeel::drawLabel(juce::Graphics &g, juce::Label &label){
    g.fillAll (label.findColour (Label::backgroundColourId));
    
    if (! label.isBeingEdited())
    {
        const float alpha = label.isEnabled() ? 1.0f : 0.5f;
        const Font font (getLabelFont (label));
        
        g.setColour (label.findColour (Label::textColourId).withMultipliedAlpha (alpha));
        g.setFont (font);
        
        Rectangle<int> textArea (label.getBorderSize().subtractedFrom (label.getLocalBounds()));
        
        g.drawFittedText (label.getText(), textArea, label.getJustificationType(),
                          jmax (1, (int) (textArea.getHeight() / font.getHeight())),
                          label.getMinimumHorizontalScale());
        
        g.setColour (label.findColour (Label::outlineColourId).withMultipliedAlpha (alpha));
    }
    else if (label.isEnabled())
    {
        g.setColour (label.findColour (Label::outlineColourId));
    }
    
    g.drawRect (label.getLocalBounds(),2);
}
Ejemplo n.º 4
0
void IRBrowserComponent::paint(juce::Graphics& g)
{
  if (_fileTreeComponent && _infoLabel)
  {
    const int width = getWidth();
    const int height = getHeight();
    
    g.setColour(juce::Colour(0xE5, 0xE5, 0xF0));
    g.fillRect(0.0f, 0.0f, static_cast<float>(width), static_cast<float>(height));
    
    g.setColour(juce::Colours::grey);
    g.drawRect(0.0f, 0.0f, static_cast<float>(width), static_cast<float>(height));
    g.drawVerticalLine(_fileTreeComponent->getX()+_fileTreeComponent->getWidth(), 0.0f, static_cast<float>(height-1));
  }
}
void NTLookAndFeel::drawButtonBackground(juce::Graphics &g, juce::Button &button, const juce::Colour &backgroundColour,
                                         bool isMouseOverButton, bool isButtonDown){
    
	if (isMouseOverButton && !isButtonDown) {

		g.fillAll(Colour{ uint8(240),uint8(240),uint8(240) });

	}
	else if (isMouseOverButton && isButtonDown) {

		g.fillAll(Colour{ uint8(225),uint8(225),uint8(225) });

	}
	else {
		g.fillAll(Colours::white);
	}
	g.setColour(Colours::lightgrey);
	g.drawRect(0, 0, button.getWidth(), button.getHeight(), 2);

    
}
void NTLookAndFeel::drawComboBox(juce::Graphics &g, int width, int height, bool isButtonDown, int buttonX, int buttonY, int buttonW, int buttonH, juce::ComboBox &box){
    g.fillAll (box.findColour (ComboBox::backgroundColourId));
    
    const Colour buttonColour (box.findColour (ComboBox::buttonColourId));
    g.setColour (Colours::lightgrey);
    g.drawRect (0, 0, width, height,2);

    
    Path p;

    
    
    int xEnd = (buttonX+buttonW) - buttonW/3;
    int midPointX = (buttonX + xEnd)/2.f;

    int yStart = buttonY + buttonH/3;
    int yEnd = (buttonY + buttonH ) - buttonH/3;
    p.addTriangle (buttonX, yStart,
                   xEnd ,yStart,
                   midPointX,yEnd);
    
    g.setColour (Colours::lightgrey);
    g.fillPath (p);
}