initial: added first widget
This commit is contained in:
@@ -12,13 +12,15 @@
|
||||
#include "PluginEditor.h"
|
||||
|
||||
|
||||
|
||||
//==============================================================================
|
||||
LampshadeAudioProcessorEditor::LampshadeAudioProcessorEditor (LampshadeAudioProcessor& p)
|
||||
: AudioProcessorEditor (&p), processor (p)
|
||||
: AudioProcessorEditor (&p), processor (p), nlines (3), lineThickness(4)
|
||||
{
|
||||
// Make sure that before the constructor has finished, you've set the
|
||||
// editor's size to whatever you need it to be.
|
||||
setSize (400, 300);
|
||||
component.setTextBoxStyle(Slider::NoTextBox, true, 0, 0);
|
||||
setSize(400, 300);
|
||||
component.setLookAndFeel(gui);
|
||||
addAndMakeVisible(component);
|
||||
}
|
||||
|
||||
LampshadeAudioProcessorEditor::~LampshadeAudioProcessorEditor()
|
||||
@@ -29,15 +31,15 @@ LampshadeAudioProcessorEditor::~LampshadeAudioProcessorEditor()
|
||||
void LampshadeAudioProcessorEditor::paint (Graphics& g)
|
||||
{
|
||||
// (Our component is opaque, so we must completely fill the background with a solid colour)
|
||||
g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));
|
||||
|
||||
g.setColour (Colours::white);
|
||||
g.setFont (15.0f);
|
||||
g.drawFittedText ("Hello World!", getLocalBounds(), Justification::centred, 1);
|
||||
g.fillAll(Colours::white);
|
||||
|
||||
for (int i = 1; i < nlines; i++) {
|
||||
g.drawLine(0, getHeight()*((float)i / nlines), getWidth(), getHeight()*((float)i / nlines), lineThickness);
|
||||
g.drawLine(getWidth()*((float) i /nlines), 0, getWidth()*((float) i /nlines), getHeight(), lineThickness);
|
||||
}
|
||||
}
|
||||
|
||||
void LampshadeAudioProcessorEditor::resized()
|
||||
{
|
||||
// This is generally where you'll want to lay out the positions of any
|
||||
// subcomponents in your editor..
|
||||
component.setBounds(getWidth()/nlines+lineThickness/2, getHeight()/nlines+lineThickness/2, getWidth()/nlines-lineThickness+1, getHeight()/nlines-lineThickness);
|
||||
}
|
||||
|
Reference in New Issue
Block a user