mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
This commit is contained in:
parent
35697f816b
commit
0eccd32f2d
8 changed files with 40 additions and 14 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue