From d11e104152834aeefc7e2f783488232086e84277 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 13 Jun 2007 12:47:46 +0000 Subject: [PATCH] added colour ids to LassoComponent --- .../lookandfeel/juce_LookAndFeel.cpp | 4 +++ .../components/mouse/juce_LassoComponent.h | 28 +++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp b/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp index 3f1c9d11b1..e37f4d51ef 100644 --- a/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp +++ b/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp @@ -46,6 +46,7 @@ BEGIN_JUCE_NAMESPACE #include "../menus/juce_MenuBarComponent.h" #include "../menus/juce_PopupMenu.h" #include "../layout/juce_ScrollBar.h" +#include "../mouse/juce_LassoComponent.h" #include "../controls/juce_Slider.h" #include "../controls/juce_ListBox.h" #include "../controls/juce_TableHeaderComponent.h" @@ -153,6 +154,9 @@ LookAndFeel::LookAndFeel() setColour (FileListComponent::highlightColourId, findColour (TextEditor::highlightColourId)); setColour (FileListComponent::textColourId, Colours::black); + setColour (0x1000440, /*LassoComponent::lassoFillColourId*/ Colour (0x66dddddd)); + setColour (0x1000441, /*LassoComponent::lassoOutlineColourId*/ Colour (0x99111111)); + setColour (MidiKeyboardComponent::whiteNoteColourId, Colours::white); setColour (MidiKeyboardComponent::blackNoteColourId, Colours::black); setColour (MidiKeyboardComponent::keySeparatorLineColourId, Colours::black.withAlpha (0.4f)); diff --git a/src/juce_appframework/gui/components/mouse/juce_LassoComponent.h b/src/juce_appframework/gui/components/mouse/juce_LassoComponent.h index 31855a82fb..e462f919ad 100644 --- a/src/juce_appframework/gui/components/mouse/juce_LassoComponent.h +++ b/src/juce_appframework/gui/components/mouse/juce_LassoComponent.h @@ -112,12 +112,8 @@ public: The fill colour is used to fill the lasso'ed rectangle, and the outline colour is used to draw a line around its edge. */ - LassoComponent (const Colour& fillColour_ = Colour (0x66dddddd), - const Colour& outlineColour_ = Colour (0x99111111), - const int outlineThickness_ = 1) + LassoComponent (const int outlineThickness_ = 1) : source (0), - fillColour (fillColour_), - outlineColour (outlineColour_), outlineThickness (outlineThickness_) { } @@ -207,13 +203,30 @@ public: setVisible (false); } + //============================================================================== + /** A set of colour IDs to use to change the colour of various aspects of the label. + + These constants can be used either via the Component::setColour(), or LookAndFeel::setColour() + methods. + + Note that you can also use the constants from TextEditor::ColourIds to change the + colour of the text editor that is opened when a label is editable. + + @see Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour + */ + enum ColourIds + { + lassoFillColourId = 0x1000440, /**< The colour to fill the lasso rectangle with. */ + lassoOutlineColourId = 0x1000441, /**< The colour to draw the outline with. */ + }; //============================================================================== /** @internal */ void paint (Graphics& g) { - g.fillAll (fillColour); - g.setColour (outlineColour); + g.fillAll (findColour (lassoFillColourId)); + + g.setColour (findColour (lassoOutlineColourId)); g.drawRect (0, 0, getWidth(), getHeight(), outlineThickness); // this suggests that you've left a lasso comp lying around after the @@ -231,7 +244,6 @@ public: private: Array originalSelection; LassoSource * source; - Colour fillColour, outlineColour; int outlineThickness; };