1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added some colour IDs for TextPropertyComponent

This commit is contained in:
jules 2012-07-30 08:34:44 +01:00
parent 56a1ba8fe1
commit c93d7a31d5
6 changed files with 40 additions and 9 deletions

View file

@ -273,7 +273,6 @@ Component* JuceUpdater::refreshComponentForRow (int rowNumber, bool isRowSelecte
: updater (updater_)
{
addChildComponent (&toggle);
toggle.setBounds ("2, 2, parent.height - 2, parent.height - 2");
toggle.setWantsKeyboardFocus (false);
setInterceptsMouseClicks (false, true);
}
@ -328,6 +327,11 @@ Component* JuceUpdater::refreshComponentForRow (int rowNumber, bool isRowSelecte
Justification::centredLeft, true);
}
void resized()
{
toggle.setBounds (getLocalBounds().reduced (2));
}
private:
JuceUpdater& updater;
ToggleButton toggle;

View file

@ -349,7 +349,6 @@ public:
addAndMakeVisible (&fixButton);
fixButton.setColour (TextButton::buttonColourId, Colours::red);
fixButton.setColour (TextButton::textColourOffId, Colours::white);
fixButton.setBounds ("right - 160, parent.height - 26, parent.width - 8, top + 22");
fixButton.addListener (this);
}
@ -381,6 +380,11 @@ public:
mp->refresh();
}
void resized()
{
fixButton.setBounds (getWidth() - 168, getHeight() - 26, 160, 22);
}
private:
Project& project;
ModuleList& moduleList;

View file

@ -54,13 +54,18 @@ public:
g.fillAll (Colours::white);
}
void resized()
{
if (currentDemo != nullptr)
currentDemo->setBounds (getLocalBounds());
}
//==============================================================================
void showDemo (Component* demoComp)
{
currentDemo = demoComp;
addAndMakeVisible (currentDemo);
currentDemo->setBounds ("0, 0, parent.width, parent.height");
resized();
}
//==============================================================================

View file

@ -140,9 +140,6 @@ LookAndFeel::LookAndFeel()
TextButton::textColourOnId, 0xff000000,
TextButton::textColourOffId, 0xff000000,
ComboBox::buttonColourId, 0xffbbbbff,
ComboBox::outlineColourId, standardOutlineColour,
ToggleButton::textColourId, 0xff000000,
TextEditor::backgroundColourId, 0xffffffff,
@ -172,10 +169,16 @@ LookAndFeel::LookAndFeel()
PopupMenu::highlightedTextColourId, 0xffffffff,
PopupMenu::highlightedBackgroundColourId, 0x991111aa,
ComboBox::buttonColourId, 0xffbbbbff,
ComboBox::outlineColourId, standardOutlineColour,
ComboBox::textColourId, 0xff000000,
ComboBox::backgroundColourId, 0xffffffff,
ComboBox::arrowColourId, 0x99000000,
TextPropertyComponent::backgroundColourId, 0xffffffff,
TextPropertyComponent::textColourId, 0xff000000,
TextPropertyComponent::outlineColourId, standardOutlineColour,
ListBox::backgroundColourId, 0xffffffff,
ListBox::outlineColourId, standardOutlineColour,
ListBox::textColourId, 0xff000000,

View file

@ -35,8 +35,9 @@ public:
{
setEditable (true, true, false);
setColour (backgroundColourId, findColour (Label::backgroundColourId));
setColour (outlineColourId, findColour (Label::outlineColourId));
setColour (backgroundColourId, owner.findColour (TextPropertyComponent::backgroundColourId));
setColour (outlineColourId, owner.findColour (TextPropertyComponent::outlineColourId));
setColour (textColourId, owner.findColour (TextPropertyComponent::textColourId));
}
TextEditor* createEditorComponent()

View file

@ -78,6 +78,20 @@ public:
/** Returns the text that should be shown in the text editor. */
virtual String getText() const;
//==============================================================================
/** A set of colour IDs to use to change the colour of various aspects of the component.
These constants can be used either via the Component::setColour(), or LookAndFeel::setColour()
methods.
@see Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour
*/
enum ColourIds
{
backgroundColourId = 0x100e401, /**< The colour to fill the background of the text area. */
textColourId = 0x100e402, /**< The colour to use for the editable text. */
outlineColourId = 0x100e403, /**< The colour to use to draw an outline around the text area. */
};
//==============================================================================
/** @internal */