Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
0eccd32f2d
8 changed files with 40 additions and 14 deletions
  1. +2
    -2
      build/linux/platform_specific_code/juce_linux_SystemStats.cpp
  2. +2
    -5
      src/juce_appframework/gui/components/layout/juce_StretchableLayoutManager.cpp
  3. +5
    -1
      src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp
  4. +3
    -3
      src/juce_appframework/gui/components/special/juce_ColourSelector.cpp
  5. +16
    -0
      src/juce_appframework/gui/components/special/juce_ColourSelector.h
  6. +1
    -1
      src/juce_core/text/juce_XmlDocument.cpp
  7. +7
    -2
      src/juce_core/text/juce_XmlElement.cpp
  8. +4
    -0
      src/juce_core/text/juce_XmlElement.h

+ 2
- 2
build/linux/platform_specific_code/juce_linux_SystemStats.cpp View File

@@ -323,13 +323,13 @@ uint32 juce_millisecondsSinceStartup() throw()
double Time::getMillisecondCounterHiRes() throw()
{
return getHighResolutionTicks() * (1.0 / 1000000.0);
return getHighResolutionTicks() * 0.001;
}
int64 Time::getHighResolutionTicks() throw()
{
timeval t;
if (gettimeofday (&t,NULL))
if (gettimeofday (&t, 0))
return 0;
return ((int64) t.tv_sec * (int64) 1000000) + (int64) t.tv_usec;


+ 2
- 5
src/juce_appframework/gui/components/layout/juce_StretchableLayoutManager.cpp View File

@@ -100,12 +100,9 @@ bool StretchableLayoutManager::getItemLayout (const int itemIndex,
//==============================================================================
void StretchableLayoutManager::setTotalSize (const int newTotalSize)
{
if (totalSize != newTotalSize)
{
totalSize = newTotalSize;
totalSize = newTotalSize;
fitComponentsIntoSpace (0, items.size(), totalSize, 0);
}
fitComponentsIntoSpace (0, items.size(), totalSize, 0);
}
int StretchableLayoutManager::getItemCurrentPosition (const int itemIndex) const


+ 5
- 1
src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp View File

@@ -66,6 +66,7 @@ BEGIN_JUCE_NAMESPACE
#include "../../graphics/drawables/juce_DrawablePath.h"
#include "../../../../juce_core/text/juce_LocalisedStrings.h"
#include "../special/juce_MidiKeyboardComponent.h"
#include "../special/juce_ColourSelector.h"
//==============================================================================
@@ -188,7 +189,10 @@ LookAndFeel::LookAndFeel()
MidiKeyboardComponent::keyDownOverlayColourId, 0xffb6b600,
MidiKeyboardComponent::textLabelColourId, 0xff000000,
MidiKeyboardComponent::upDownButtonBackgroundColourId, 0xffd3d3d3,
MidiKeyboardComponent::upDownButtonArrowColourId, 0xff000000
MidiKeyboardComponent::upDownButtonArrowColourId, 0xff000000,
ColourSelector::backgroundColourId, 0xffe5e5e5,
ColourSelector::labelTextColourId, 0xff000000
};
for (int i = 0; i < numElementsInArray (standardColours); i += 2)


+ 3
- 3
src/juce_appframework/gui/components/special/juce_ColourSelector.cpp View File

@@ -473,8 +473,8 @@ void ColourSelector::update()
//==============================================================================
void ColourSelector::paint (Graphics& g)
{
g.fillAll (Colour::greyLevel (0.9f));
g.fillAll (findColour (backgroundColourId));
if ((flags & showColourAtTop) != 0)
{
const Colour colour (getCurrentColour());
@@ -502,7 +502,7 @@ void ColourSelector::paint (Graphics& g)
if ((flags & showSliders) != 0)
{
g.setColour (Colours::black);
g.setColour (findColour (labelTextColourId));
g.setFont (11.0f);
for (int i = 4; --i >= 0;)


+ 16
- 0
src/juce_appframework/gui/components/special/juce_ColourSelector.h View File

@@ -122,6 +122,22 @@ public:
*/
virtual void setSwatchColour (const int index, const Colour& newColour) const;
//==============================================================================
/** A set of colour IDs to use to change the colour of various aspects of the keyboard.
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 = 0x1007000, /**< the colour used to fill the component's background. */
labelTextColourId = 0x1007001 /**< the colour used for the labels next to the sliders. */
};
//==============================================================================
juce_UseDebuggingNewOperator


+ 1
- 1
src/juce_core/text/juce_XmlDocument.cpp View File

@@ -475,7 +475,7 @@ XmlElement* XmlDocument::readNextElement (const bool alsoParseSubElements) throw
else
{
if (! outOfData)
setLastError ("illegal characters found", false);
setLastError ("illegal character found in " + node->getTagName() + ": '" + c + "'", false);
}
break;


+ 7
- 2
src/juce_core/text/juce_XmlElement.cpp View File

@@ -1142,11 +1142,16 @@ const String XmlElement::getChildElementAllSubText (const tchar* const childTagN
return defaultReturnValue;
}
void XmlElement::addTextElement (const String& text) throw()
XmlElement* XmlElement::createTextElement (const String& text) throw()
{
XmlElement* const e = new XmlElement ((int) 0);
e->setAttribute (juce_xmltextContentAttributeName, text);
addChildElement (e);
return e;
}
void XmlElement::addTextElement (const String& text) throw()
{
addChildElement (createTextElement (text));
}
void XmlElement::deleteAllTextElements() throw()


+ 4
- 0
src/juce_core/text/juce_XmlElement.h View File

@@ -644,6 +644,10 @@ public:
*/
void deleteAllTextElements() throw();
/** Creates a text element that can be added to a parent element.
*/
static XmlElement* createTextElement (const String& text) throw();
//==============================================================================
juce_UseDebuggingNewOperator


Loading…
Cancel
Save