1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
This commit is contained in:
jules 2007-06-20 14:52:56 +00:00
parent ed8b1d5692
commit d00a1e4892
7 changed files with 93 additions and 88 deletions

View file

@ -247,7 +247,7 @@ static int lastProcessPriority = -1;
// called by WindowDriver because Windows does wierd things to process priority // called by WindowDriver because Windows does wierd things to process priority
// when you swap apps, and this forces an update when the app is brought to the front. // when you swap apps, and this forces an update when the app is brought to the front.
void repeatLastProcessPriority() void juce_repeatLastProcessPriority() throw()
{ {
if (lastProcessPriority >= 0) // (avoid changing this if it's not been explicitly set by the app..) if (lastProcessPriority >= 0) // (avoid changing this if it's not been explicitly set by the app..)
{ {
@ -285,7 +285,7 @@ void Process::setPriority (ProcessPriority prior)
if (lastProcessPriority != (int) prior) if (lastProcessPriority != (int) prior)
{ {
lastProcessPriority = (int) prior; lastProcessPriority = (int) prior;
repeatLastProcessPriority(); juce_repeatLastProcessPriority();
} }
} }

View file

@ -91,8 +91,8 @@ BEGIN_JUCE_NAMESPACE
#include "juce_win32_DynamicLibraryLoader.h" #include "juce_win32_DynamicLibraryLoader.h"
extern void repeatLastProcessPriority(); // in juce_win32_Threads.cpp extern void juce_repeatLastProcessPriority() throw(); // in juce_win32_Threads.cpp
extern void juce_CheckCurrentlyFocusedTopLevelWindow(); // in juce_TopLevelWindow.cpp extern void juce_CheckCurrentlyFocusedTopLevelWindow() throw(); // in juce_TopLevelWindow.cpp
const int juce_windowIsSemiTransparentFlag = (1 << 31); // also in component.cpp const int juce_windowIsSemiTransparentFlag = (1 << 31); // also in component.cpp
@ -1927,7 +1927,7 @@ private:
// Windows does weird things to process priority when you swap apps, // Windows does weird things to process priority when you swap apps,
// so this forces an update when the app is brought to the front // so this forces an update when the app is brought to the front
if (wParam != FALSE) if (wParam != FALSE)
repeatLastProcessPriority(); juce_repeatLastProcessPriority();
juce_CheckCurrentlyFocusedTopLevelWindow(); juce_CheckCurrentlyFocusedTopLevelWindow();
return 0; return 0;

View file

@ -211,7 +211,7 @@ const Colour LookAndFeel::findColour (const int colourId) const throw()
return Colours::black; return Colours::black;
} }
void LookAndFeel::setColour (const int colourId, const Colour& colour) void LookAndFeel::setColour (const int colourId, const Colour& colour) throw()
{ {
const int index = colourIds.indexOf (colourId); const int index = colourIds.indexOf (colourId);
@ -226,7 +226,7 @@ void LookAndFeel::setColour (const int colourId, const Colour& colour)
static LookAndFeel* defaultLF = 0; static LookAndFeel* defaultLF = 0;
static LookAndFeel* currentDefaultLF = 0; static LookAndFeel* currentDefaultLF = 0;
LookAndFeel& LookAndFeel::getDefaultLookAndFeel() LookAndFeel& LookAndFeel::getDefaultLookAndFeel() throw()
{ {
// if this happens, your app hasn't initialised itself properly.. if you're // if this happens, your app hasn't initialised itself properly.. if you're
// trying to hack your own main() function, have a look at // trying to hack your own main() function, have a look at
@ -236,7 +236,7 @@ LookAndFeel& LookAndFeel::getDefaultLookAndFeel()
return *currentDefaultLF; return *currentDefaultLF;
} }
void LookAndFeel::setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) void LookAndFeel::setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) throw()
{ {
if (newDefaultLookAndFeel == 0) if (newDefaultLookAndFeel == 0)
{ {
@ -257,7 +257,7 @@ void LookAndFeel::setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel)
} }
} }
void LookAndFeel::clearDefaultLookAndFeel() void LookAndFeel::clearDefaultLookAndFeel() throw()
{ {
if (currentDefaultLF == defaultLF) if (currentDefaultLF == defaultLF)
currentDefaultLF = 0; currentDefaultLF = 0;
@ -276,11 +276,12 @@ void LookAndFeel::drawButtonBackground (Graphics& g,
const int height = button.getHeight(); const int height = button.getHeight();
const float outlineThickness = button.isEnabled() ? ((isButtonDown || isMouseOverButton) ? 1.2f : 0.7f) : 0.4f; const float outlineThickness = button.isEnabled() ? ((isButtonDown || isMouseOverButton) ? 1.2f : 0.7f) : 0.4f;
const float halfThickness = outlineThickness * 0.5f;
const float indentL = button.isConnectedOnLeft() ? 0.1f : outlineThickness * 0.5f; const float indentL = button.isConnectedOnLeft() ? 0.1f : halfThickness;
const float indentR = button.isConnectedOnRight() ? 0.1f : outlineThickness * 0.5f; const float indentR = button.isConnectedOnRight() ? 0.1f : halfThickness;
const float indentT = button.isConnectedOnTop() ? 0.1f : outlineThickness * 0.5f; const float indentT = button.isConnectedOnTop() ? 0.1f : halfThickness;
const float indentB = button.isConnectedOnBottom() ? 0.1f : outlineThickness * 0.5f; const float indentB = button.isConnectedOnBottom() ? 0.1f : halfThickness;
const Colour baseColour (createBaseColour (backgroundColour, const Colour baseColour (createBaseColour (backgroundColour,
button.hasKeyboardFocus (true), button.hasKeyboardFocus (true),
@ -326,8 +327,8 @@ void LookAndFeel::drawTickBox (Graphics& g,
g.setColour (isEnabled ? Colours::black : Colours::grey); g.setColour (isEnabled ? Colours::black : Colours::grey);
AffineTransform trans (AffineTransform::scale (w / 9.0f, h / 9.0f) const AffineTransform trans (AffineTransform::scale (w / 9.0f, h / 9.0f)
.translated ((float) x, (float) y)); .translated ((float) x, (float) y));
g.strokePath (tick, PathStrokeType (2.5f), trans); g.strokePath (tick, PathStrokeType (2.5f), trans);
} }
@ -405,7 +406,7 @@ void LookAndFeel::drawAlertBox (Graphics& g,
|| alert.getAlertType() == AlertWindow::InfoIcon) || alert.getAlertType() == AlertWindow::InfoIcon)
{ {
if (alert.getAlertType() == AlertWindow::InfoIcon) if (alert.getAlertType() == AlertWindow::InfoIcon)
g.setColour (background.overlaidWith (Colours::blue.withAlpha (0.16f))); g.setColour (background.overlaidWith (Colour (0x280000ff)));
else else
g.setColour (background.overlaidWith (Colours::gold.darker().withAlpha (0.25f))); g.setColour (background.overlaidWith (Colours::gold.darker().withAlpha (0.25f)));
@ -437,7 +438,7 @@ void LookAndFeel::drawAlertBox (Graphics& g,
(float) iconRect.getX(), (float) iconRect.getX(),
(float) iconRect.getBottom()); (float) iconRect.getBottom());
g.setColour (background.overlaidWith (Colours::red.withAlpha (0.2f))); g.setColour (background.overlaidWith (Colour (0x33ff0000)));
g.fillPath (p.createPathWithRoundedCorners (5.0f)); g.fillPath (p.createPathWithRoundedCorners (5.0f));
g.setColour (background); g.setColour (background);
@ -528,7 +529,7 @@ void LookAndFeel::drawScrollbarButton (Graphics& g,
g.fillPath (p); g.fillPath (p);
g.setColour (Colours::black.withAlpha (0.5f)); g.setColour (Colour (0x80000000));
g.strokePath (p, PathStrokeType (0.5f)); g.strokePath (p, PathStrokeType (0.5f));
} }
@ -547,7 +548,9 @@ void LookAndFeel::drawScrollbar (Graphics& g,
Path slotPath, thumbPath; Path slotPath, thumbPath;
const float slotIndent = jmin (width, height) > 15 ? 1.0f : 0.0f; const float slotIndent = jmin (width, height) > 15 ? 1.0f : 0.0f;
const float slotIndentx2 = slotIndent * 2.0f;
const float thumbIndent = slotIndent + 1.0f; const float thumbIndent = slotIndent + 1.0f;
const float thumbIndentx2 = thumbIndent * 2.0f;
float gx1 = 0.0f, gy1 = 0.0f, gx2 = 0.0f, gy2 = 0.0f; float gx1 = 0.0f, gy1 = 0.0f, gx2 = 0.0f, gy2 = 0.0f;
@ -555,16 +558,16 @@ void LookAndFeel::drawScrollbar (Graphics& g,
{ {
slotPath.addRoundedRectangle (x + slotIndent, slotPath.addRoundedRectangle (x + slotIndent,
y + slotIndent, y + slotIndent,
width - slotIndent * 2.0f, width - slotIndentx2,
height - slotIndent * 2.0f, height - slotIndentx2,
(width - slotIndent * 2.0f) * 0.5f); (width - slotIndentx2) * 0.5f);
if (thumbSize > 0) if (thumbSize > 0)
thumbPath.addRoundedRectangle (x + thumbIndent, thumbPath.addRoundedRectangle (x + thumbIndent,
thumbStartPosition + thumbIndent, thumbStartPosition + thumbIndent,
width - thumbIndent * 2.0f, width - thumbIndentx2,
thumbSize - thumbIndent * 2.0f, thumbSize - thumbIndentx2,
(width - thumbIndent * 2.0f) * 0.5f); (width - thumbIndentx2) * 0.5f);
gx1 = (float) x; gx1 = (float) x;
gx2 = x + width * 0.7f; gx2 = x + width * 0.7f;
} }
@ -572,25 +575,25 @@ void LookAndFeel::drawScrollbar (Graphics& g,
{ {
slotPath.addRoundedRectangle (x + slotIndent, slotPath.addRoundedRectangle (x + slotIndent,
y + slotIndent, y + slotIndent,
width - slotIndent * 2.0f, width - slotIndentx2,
height - slotIndent * 2.0f, height - slotIndentx2,
(height - slotIndent * 2.0f) * 0.5f); (height - slotIndentx2) * 0.5f);
if (thumbSize > 0) if (thumbSize > 0)
thumbPath.addRoundedRectangle (thumbStartPosition + thumbIndent, thumbPath.addRoundedRectangle (thumbStartPosition + thumbIndent,
y + thumbIndent, y + thumbIndent,
thumbSize - thumbIndent * 2.0f, thumbSize - thumbIndentx2,
height - thumbIndent * 2.0f, height - thumbIndentx2,
(height - thumbIndent * 2.0f) * 0.5f); (height - thumbIndentx2) * 0.5f);
gy1 = (float) y; gy1 = (float) y;
gy2 = y + height * 0.7f; gy2 = y + height * 0.7f;
} }
const Colour thumbColour (scrollbar.findColour (ScrollBar::thumbColourId)); const Colour thumbColour (scrollbar.findColour (ScrollBar::thumbColourId));
GradientBrush gb (thumbColour.overlaidWith (Colours::black.withAlpha (0.27f)), GradientBrush gb (thumbColour.overlaidWith (Colour (0x44000000)),
gx1, gy1, gx1, gy1,
thumbColour.overlaidWith (Colours::black.withAlpha (0.1f)), thumbColour.overlaidWith (Colour (0x19000000)),
gx2, gy2, false); gx2, gy2, false);
g.setBrush (&gb); g.setBrush (&gb);
@ -607,9 +610,9 @@ void LookAndFeel::drawScrollbar (Graphics& g,
gy2 = (float) y + height; gy2 = (float) y + height;
} }
GradientBrush gb2 (Colours::black.withAlpha (0.0f), GradientBrush gb2 (Colours::transparentBlack,
gx1, gy1, gx1, gy1,
Colours::black.withAlpha (0.1f), Colour (0x19000000),
gx2, gy2, false); gx2, gy2, false);
g.setBrush (&gb2); g.setBrush (&gb2);
@ -618,9 +621,9 @@ void LookAndFeel::drawScrollbar (Graphics& g,
g.setColour (thumbColour); g.setColour (thumbColour);
g.fillPath (thumbPath); g.fillPath (thumbPath);
GradientBrush gb3 (Colours::black.withAlpha (0.05f), GradientBrush gb3 (Colour (0x10000000),
gx1, gy1, gx1, gy1,
Colours::black.withAlpha (0.0f), Colours::transparentBlack,
gx2, gy2, false); gx2, gy2, false);
g.saveState(); g.saveState();
@ -634,7 +637,7 @@ void LookAndFeel::drawScrollbar (Graphics& g,
g.fillPath (thumbPath); g.fillPath (thumbPath);
g.restoreState(); g.restoreState();
g.setColour (Colours::black.withAlpha (0.3f)); g.setColour (Colour (0x4c000000));
g.strokePath (thumbPath, PathStrokeType (0.4f)); g.strokePath (thumbPath, PathStrokeType (0.4f));
} }
@ -655,8 +658,8 @@ int LookAndFeel::getDefaultScrollbarWidth()
int LookAndFeel::getScrollbarButtonSize (ScrollBar& scrollbar) int LookAndFeel::getScrollbarButtonSize (ScrollBar& scrollbar)
{ {
return 2 + ((scrollbar.isVertical()) ? scrollbar.getWidth() return 2 + (scrollbar.isVertical() ? scrollbar.getWidth()
: scrollbar.getHeight()); : scrollbar.getHeight());
} }
//============================================================================== //==============================================================================
@ -706,10 +709,10 @@ void LookAndFeel::drawTreeviewPlusMinusBox (Graphics& g, int x, int y, int w, in
w = boxSize; w = boxSize;
h = boxSize; h = boxSize;
g.setColour (Colours::white.withAlpha (0.9f)); g.setColour (Colour (0xe5ffffff));
g.fillRect (x, y, w, h); g.fillRect (x, y, w, h);
g.setColour (Colours::black.withAlpha (0.5f)); g.setColour (Colour (0x80000000));
g.drawRect (x, y, w, h); g.drawRect (x, y, w, h);
const float size = boxSize / 2 + 1.0f; const float size = boxSize / 2 + 1.0f;
@ -789,7 +792,7 @@ void LookAndFeel::drawPopupMenuBackground (Graphics& g, int width, int height)
const Colour background (findColour (PopupMenu::backgroundColourId)); const Colour background (findColour (PopupMenu::backgroundColourId));
g.fillAll (background); g.fillAll (background);
g.setColour (background.overlaidWith (Colours::lightblue.withAlpha (0.17f))); g.setColour (background.overlaidWith (Colour (0x2badd8e6)));
for (int i = 0; i < height; i += 3) for (int i = 0; i < height; i += 3)
g.fillRect (0, i, width, 1); g.fillRect (0, i, width, 1);
@ -802,12 +805,10 @@ void LookAndFeel::drawPopupMenuUpDownArrow (Graphics& g,
int width, int height, int width, int height,
bool isScrollUpArrow) bool isScrollUpArrow)
{ {
const float hh = height * 0.5f;
const Colour background (findColour (PopupMenu::backgroundColourId)); const Colour background (findColour (PopupMenu::backgroundColourId));
GradientBrush gb (background, GradientBrush gb (background,
0.0f, hh, 0.0f, height * 0.5f,
background.withAlpha (0.0f), background.withAlpha (0.0f),
0.0f, isScrollUpArrow ? ((float) height) : 0.0f, 0.0f, isScrollUpArrow ? ((float) height) : 0.0f,
false); false);
@ -847,10 +848,10 @@ void LookAndFeel::drawPopupMenuItem (Graphics& g,
{ {
const float separatorIndent = 5.5f; const float separatorIndent = 5.5f;
g.setColour (Colours::black.withAlpha (0.2f)); g.setColour (Colour (0x33000000));
g.drawLine (separatorIndent, halfH, width - separatorIndent, halfH); g.drawLine (separatorIndent, halfH, width - separatorIndent, halfH);
g.setColour (Colours::white.withAlpha (0.4f)); g.setColour (Colour (0x66ffffff));
g.drawLine (separatorIndent, halfH + 1.0f, width - separatorIndent, halfH + 1.0f); g.drawLine (separatorIndent, halfH + 1.0f, width - separatorIndent, halfH + 1.0f);
} }
else else
@ -1078,14 +1079,14 @@ void LookAndFeel::drawComboBox (Graphics& g, int width, int height,
buttonX + buttonW * (1.0f - arrowX), buttonY + buttonH * 0.55f, buttonX + buttonW * (1.0f - arrowX), buttonY + buttonH * 0.55f,
buttonX + buttonW * arrowX, buttonY + buttonH * 0.55f); buttonX + buttonW * arrowX, buttonY + buttonH * 0.55f);
g.setColour (Colours::black.withAlpha (0.6f)); g.setColour (Colour (0x99000000));
g.fillPath (p); g.fillPath (p);
} }
} }
const Font LookAndFeel::getComboBoxFont (ComboBox& box) const Font LookAndFeel::getComboBoxFont (ComboBox& box)
{ {
Font f (jmin (15.0f, box.getHeight() * 0.85f)); const Font f (jmin (15.0f, box.getHeight() * 0.85f));
return f; return f;
} }
@ -1122,7 +1123,7 @@ void LookAndFeel::drawLinearSlider (Graphics& g,
const Colour trackColour (slider.findColour (Slider::trackColourId)); const Colour trackColour (slider.findColour (Slider::trackColourId));
const Colour gradCol1 (trackColour.overlaidWith (Colours::black.withAlpha (slider.isEnabled() ? 0.25f : 0.13f))); const Colour gradCol1 (trackColour.overlaidWith (Colours::black.withAlpha (slider.isEnabled() ? 0.25f : 0.13f)));
const Colour gradCol2 (trackColour.overlaidWith (Colours::black.withAlpha (0.08f))); const Colour gradCol2 (trackColour.overlaidWith (Colour (0x14000000)));
Path indent; Path indent;
if (slider.isHorizontal()) if (slider.isHorizontal())
@ -1154,7 +1155,7 @@ void LookAndFeel::drawLinearSlider (Graphics& g,
g.fillPath (indent); g.fillPath (indent);
} }
g.setColour (Colours::black.withAlpha (0.3f)); g.setColour (Colour (0x4c000000));
g.strokePath (indent, PathStrokeType (0.5f)); g.strokePath (indent, PathStrokeType (0.5f));
Colour knobColour (createBaseColour (slider.findColour (Slider::thumbColourId), Colour knobColour (createBaseColour (slider.findColour (Slider::thumbColourId),
@ -1258,7 +1259,7 @@ void LookAndFeel::drawRotarySlider (Graphics& g,
if (slider.isEnabled()) if (slider.isEnabled())
g.setColour (slider.findColour (Slider::rotarySliderFillColourId).withAlpha (isMouseOver ? 1.0f : 0.7f)); g.setColour (slider.findColour (Slider::rotarySliderFillColourId).withAlpha (isMouseOver ? 1.0f : 0.7f));
else else
g.setColour (Colours::grey.withAlpha (0.5f)); g.setColour (Colour (0x80808080));
const float thickness = 0.7f; const float thickness = 0.7f;
@ -1300,7 +1301,7 @@ void LookAndFeel::drawRotarySlider (Graphics& g,
if (slider.isEnabled()) if (slider.isEnabled())
g.setColour (slider.findColour (Slider::rotarySliderFillColourId).withAlpha (isMouseOver ? 1.0f : 0.7f)); g.setColour (slider.findColour (Slider::rotarySliderFillColourId).withAlpha (isMouseOver ? 1.0f : 0.7f));
else else
g.setColour (Colours::grey.withAlpha (0.5f)); g.setColour (Colour (0x80808080));
Path p; Path p;
p.addEllipse (-0.4f * rw, -0.4f * rw, rw * 0.8f, rw * 0.8f); p.addEllipse (-0.4f * rw, -0.4f * rw, rw * 0.8f, rw * 0.8f);
@ -1441,10 +1442,10 @@ void LookAndFeel::drawResizableFrame (Graphics&, int /*w*/, int /*h*/,
void LookAndFeel::drawResizableWindowBorder (Graphics& g, int w, int h, void LookAndFeel::drawResizableWindowBorder (Graphics& g, int w, int h,
const BorderSize& border, ResizableWindow&) const BorderSize& border, ResizableWindow&)
{ {
g.setColour (Colours::black.withAlpha (0.5f)); g.setColour (Colour (0x80000000));
g.drawRect (0, 0, w, h); g.drawRect (0, 0, w, h);
g.setColour (Colours::black.withAlpha (0.1f)); g.setColour (Colour (0x19000000));
g.drawRect (border.getLeft() - 1, g.drawRect (border.getLeft() - 1,
border.getTop() - 1, border.getTop() - 1,
w + 2 - border.getLeftAndRight(), w + 2 - border.getLeftAndRight(),
@ -1505,7 +1506,7 @@ public:
//============================================================================== //==============================================================================
GlassWindowButton (const String& name, const Colour& col, GlassWindowButton (const String& name, const Colour& col,
const Path& normalShape_, const Path& normalShape_,
const Path& toggledShape_) const Path& toggledShape_) throw()
: Button (name), : Button (name),
colour (col), colour (col),
normalShape (normalShape_), normalShape (normalShape_),
@ -1670,7 +1671,7 @@ void LookAndFeel::drawStretchableLayoutResizerBar (Graphics& g,
if (isMouseOver || isMouseDragging) if (isMouseOver || isMouseDragging)
{ {
g.fillAll (Colours::blue.withAlpha (0.1f)); g.fillAll (Colour (0x190000ff));
alpha = 1.0f; alpha = 1.0f;
} }
@ -1997,7 +1998,8 @@ void LookAndFeel::drawTabAreaBehindFrontButton (Graphics& g,
shadowRect.expand (2, 2); shadowRect.expand (2, 2);
g.fillRect (shadowRect); g.fillRect (shadowRect);
g.setColour (Colours::black.withAlpha (0.5f)); g.setColour (Colour (0x80000000));
if (orientation == TabbedButtonBar::TabsAtLeft) if (orientation == TabbedButtonBar::TabsAtLeft)
{ {
g.fillRect (w - 1, 0, 1, h); g.fillRect (w - 1, 0, 1, h);
@ -2026,7 +2028,7 @@ Button* LookAndFeel::createTabBarExtrasButton()
DrawablePath ellipse; DrawablePath ellipse;
ellipse.setPath (p); ellipse.setPath (p);
ellipse.setSolidFill (Colours::white.withAlpha (0.6f)); ellipse.setSolidFill (Colour (0x99ffffff));
p.clear(); p.clear();
p.addEllipse (0.0f, 0.0f, 100.0f, 100.0f); p.addEllipse (0.0f, 0.0f, 100.0f, 100.0f);
@ -2037,13 +2039,13 @@ Button* LookAndFeel::createTabBarExtrasButton()
DrawablePath dp; DrawablePath dp;
dp.setPath (p); dp.setPath (p);
dp.setSolidFill (Colours::black.withAlpha (0.35f)); dp.setSolidFill (Colour (0x59000000));
DrawableComposite normalImage; DrawableComposite normalImage;
normalImage.insertDrawable (ellipse); normalImage.insertDrawable (ellipse);
normalImage.insertDrawable (dp); normalImage.insertDrawable (dp);
dp.setSolidFill (Colours::black.withAlpha (0.8f)); dp.setSolidFill (Colour (0xcc000000));
DrawableComposite overImage; DrawableComposite overImage;
overImage.insertDrawable (ellipse); overImage.insertDrawable (ellipse);
@ -2070,7 +2072,7 @@ void LookAndFeel::drawTableHeaderBackground (Graphics& g, TableHeaderComponent&
g.setBrush (&gb); g.setBrush (&gb);
g.fillRect (0, h / 2, w, h); g.fillRect (0, h / 2, w, h);
g.setColour (Colours::black.withAlpha (0.2f)); g.setColour (Colour (0x33000000));
g.fillRect (0, h - 1, w, 1); g.fillRect (0, h - 1, w, 1);
for (int i = header.getNumColumns (true); --i >= 0;) for (int i = header.getNumColumns (true); --i >= 0;)
@ -2101,7 +2103,7 @@ void LookAndFeel::drawTableHeaderColumn (Graphics& g, const String& columnName,
Path sortArrow; Path sortArrow;
sortArrow.addTriangle (x, bottom, x + w * 0.5f, top, x + w, bottom); sortArrow.addTriangle (x, bottom, x + w * 0.5f, top, x + w, bottom);
g.setColour (Colours::black.withAlpha (0.6f)); g.setColour (Colour (0x99000000));
g.fillPath (sortArrow); g.fillPath (sortArrow);
} }
@ -2176,7 +2178,7 @@ void LookAndFeel::drawPropertyPanelSectionHeader (Graphics& g, const String& nam
void LookAndFeel::drawPropertyComponentBackground (Graphics& g, int width, int height, void LookAndFeel::drawPropertyComponentBackground (Graphics& g, int width, int height,
PropertyComponent&) PropertyComponent&)
{ {
g.setColour (Colours::white.withAlpha (0.4f)); g.setColour (Colour (0x66ffffff));
g.fillRect (0, 0, width, height - 1); g.fillRect (0, 0, width, height - 1);
} }
@ -2440,17 +2442,17 @@ void LookAndFeel::drawShinyButtonShape (Graphics& g,
! (flatOnRight || flatOnBottom)); ! (flatOnRight || flatOnBottom));
ColourGradient cg (baseColour, 0.0f, y, ColourGradient cg (baseColour, 0.0f, y,
baseColour.overlaidWith (Colours::blue.withAlpha (0.03f)), 0.0f, y + h, baseColour.overlaidWith (Colour (0x070000ff)), 0.0f, y + h,
false); false);
cg.addColour (0.5, baseColour.overlaidWith (Colours::white.withAlpha (0.2f))); cg.addColour (0.5, baseColour.overlaidWith (Colour (0x33ffffff)));
cg.addColour (0.51, baseColour.overlaidWith (Colours::blue.withAlpha (0.07f))); cg.addColour (0.51, baseColour.overlaidWith (Colour (0x110000ff)));
GradientBrush gb (cg); GradientBrush gb (cg);
g.setBrush (&gb); g.setBrush (&gb);
g.fillPath (outline); g.fillPath (outline);
g.setColour (Colours::black.withAlpha (0.5f)); g.setColour (Colour (0x80000000));
g.strokePath (outline, PathStrokeType (strokeWidth)); g.strokePath (outline, PathStrokeType (strokeWidth));
} }

View file

@ -81,7 +81,7 @@ public:
@see setDefaultLookAndFeel @see setDefaultLookAndFeel
*/ */
static LookAndFeel& getDefaultLookAndFeel(); static LookAndFeel& getDefaultLookAndFeel() throw();
/** Changes the default look-and-feel. /** Changes the default look-and-feel.
@ -91,7 +91,7 @@ public:
it's no longer needed. it's no longer needed.
@see getDefaultLookAndFeel @see getDefaultLookAndFeel
*/ */
static void setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel); static void setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) throw();
//============================================================================== //==============================================================================
@ -120,7 +120,7 @@ public:
@see findColour, Component::findColour, Component::setColour @see findColour, Component::findColour, Component::setColour
*/ */
void setColour (const int colourId, const Colour& colour); void setColour (const int colourId, const Colour& colour) throw();
//============================================================================== //==============================================================================
/** Draws the lozenge-shaped background for a standard button. */ /** Draws the lozenge-shaped background for a standard button. */
@ -539,7 +539,7 @@ protected:
private: private:
friend void JUCE_PUBLIC_FUNCTION shutdownJuce_GUI(); friend void JUCE_PUBLIC_FUNCTION shutdownJuce_GUI();
static void clearDefaultLookAndFeel(); // called at shutdown static void clearDefaultLookAndFeel() throw(); // called at shutdown
Array <int> colourIds; Array <int> colourIds;
Array <Colour> colours; Array <Colour> colours;
@ -552,6 +552,9 @@ private:
const bool flatOnRight, const bool flatOnRight,
const bool flatOnTop, const bool flatOnTop,
const bool flatOnBottom) throw(); const bool flatOnBottom) throw();
LookAndFeel (const LookAndFeel&);
const LookAndFeel& operator= (const LookAndFeel&);
}; };

View file

@ -180,7 +180,7 @@ void DocumentWindow::paint (Graphics& g)
if (resizableBorder == 0 && getBorderSize() == 1) if (resizableBorder == 0 && getBorderSize() == 1)
{ {
g.setColour (getBackgroundColour().overlaidWith (Colours::black.withAlpha (0.5f))); g.setColour (getBackgroundColour().overlaidWith (Colour (0x80000000)));
g.drawRect (0, 0, getWidth(), getHeight()); g.drawRect (0, 0, getWidth(), getHeight());
} }

View file

@ -100,7 +100,7 @@ public:
} }
} }
bool addWindow (TopLevelWindow* const w) bool addWindow (TopLevelWindow* const w) throw()
{ {
windows.add (w); windows.add (w);
startTimer (10); startTimer (10);
@ -108,7 +108,7 @@ public:
return isWindowActive (w); return isWindowActive (w);
} }
void removeWindow (TopLevelWindow* const w) void removeWindow (TopLevelWindow* const w) throw()
{ {
startTimer (10); startTimer (10);
@ -126,7 +126,7 @@ public:
private: private:
TopLevelWindow* currentActive; TopLevelWindow* currentActive;
bool isWindowActive (TopLevelWindow* const tlw) const bool isWindowActive (TopLevelWindow* const tlw) const throw()
{ {
return (tlw == currentActive return (tlw == currentActive
|| tlw->isParentOf (currentActive) || tlw->isParentOf (currentActive)
@ -140,7 +140,7 @@ private:
juce_ImplementSingleton_SingleThreaded (TopLevelWindowManager) juce_ImplementSingleton_SingleThreaded (TopLevelWindowManager)
void juce_CheckCurrentlyFocusedTopLevelWindow() void juce_CheckCurrentlyFocusedTopLevelWindow() throw()
{ {
if (TopLevelWindowManager::getInstanceWithoutCreating() != 0) if (TopLevelWindowManager::getInstanceWithoutCreating() != 0)
TopLevelWindowManager::getInstanceWithoutCreating()->startTimer (20); TopLevelWindowManager::getInstanceWithoutCreating()->startTimer (20);
@ -182,7 +182,7 @@ void TopLevelWindow::focusOfChildComponentChanged (FocusChangeType)
TopLevelWindowManager::getInstance()->startTimer (10); TopLevelWindowManager::getInstance()->startTimer (10);
} }
void TopLevelWindow::setWindowActive (const bool isNowActive) void TopLevelWindow::setWindowActive (const bool isNowActive) throw()
{ {
if (windowIsActive_ != isNowActive) if (windowIsActive_ != isNowActive)
{ {
@ -338,7 +338,7 @@ void TopLevelWindow::centreAroundComponent (Component* c, const int width, const
} }
else else
{ {
Rectangle screenArea (getParentMonitorArea()); const Rectangle screenArea (getParentMonitorArea());
setBounds (jlimit (screenArea.getX(), jmax (screenArea.getX(), screenArea.getWidth() - width), x), setBounds (jlimit (screenArea.getX(), jmax (screenArea.getX(), screenArea.getWidth() - width), x),
jlimit (screenArea.getY(), jmax (screenArea.getY(), screenArea.getHeight() - height), y), jlimit (screenArea.getY(), jmax (screenArea.getY(), screenArea.getHeight() - height), y),
@ -348,17 +348,17 @@ void TopLevelWindow::centreAroundComponent (Component* c, const int width, const
} }
//============================================================================== //==============================================================================
int TopLevelWindow::getNumTopLevelWindows() int TopLevelWindow::getNumTopLevelWindows() throw()
{ {
return TopLevelWindowManager::getInstance()->windows.size(); return TopLevelWindowManager::getInstance()->windows.size();
} }
TopLevelWindow* TopLevelWindow::getTopLevelWindow (const int index) TopLevelWindow* TopLevelWindow::getTopLevelWindow (const int index) throw()
{ {
return (TopLevelWindow*) TopLevelWindowManager::getInstance()->windows [index]; return (TopLevelWindow*) TopLevelWindowManager::getInstance()->windows [index];
} }
TopLevelWindow* TopLevelWindow::getActiveTopLevelWindow() TopLevelWindow* TopLevelWindow::getActiveTopLevelWindow() throw()
{ {
TopLevelWindow* best = 0; TopLevelWindow* best = 0;
int bestNumTWLParents = -1; int bestNumTWLParents = -1;
@ -371,11 +371,11 @@ TopLevelWindow* TopLevelWindow::getActiveTopLevelWindow()
{ {
int numTWLParents = 0; int numTWLParents = 0;
Component* c = tlw->getParentComponent(); const Component* c = tlw->getParentComponent();
while (c != 0) while (c != 0)
{ {
if (dynamic_cast <TopLevelWindow*> (c) != 0) if (dynamic_cast <const TopLevelWindow*> (c) != 0)
++numTWLParents; ++numTWLParents;
c = c->getParentComponent(); c = c->getParentComponent();

View file

@ -121,19 +121,19 @@ public:
@see getTopLevelWindow @see getTopLevelWindow
*/ */
static int getNumTopLevelWindows(); static int getNumTopLevelWindows() throw();
/** Returns one of the TopLevelWindow objects currently in use. /** Returns one of the TopLevelWindow objects currently in use.
The index is 0 to (getNumTopLevelWindows() - 1). The index is 0 to (getNumTopLevelWindows() - 1).
*/ */
static TopLevelWindow* getTopLevelWindow (const int index); static TopLevelWindow* getTopLevelWindow (const int index) throw();
/** Returns the currently-active top level window. /** Returns the currently-active top level window.
There might not be one, of course, so this can return 0. There might not be one, of course, so this can return 0.
*/ */
static TopLevelWindow* getActiveTopLevelWindow(); static TopLevelWindow* getActiveTopLevelWindow() throw();
//============================================================================== //==============================================================================
@ -168,7 +168,7 @@ private:
bool useDropShadow, useNativeTitleBar, windowIsActive_; bool useDropShadow, useNativeTitleBar, windowIsActive_;
DropShadower* shadower; DropShadower* shadower;
void setWindowActive (const bool isNowActive); void setWindowActive (const bool isNowActive) throw();
TopLevelWindow (const TopLevelWindow&); TopLevelWindow (const TopLevelWindow&);
const TopLevelWindow& operator= (const TopLevelWindow&); const TopLevelWindow& operator= (const TopLevelWindow&);