From d00a1e4892d4f995695914f013570f137655762b Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 20 Jun 2007 14:52:56 +0000 Subject: [PATCH] --- .../juce_win32_Threads.cpp | 4 +- .../juce_win32_Windowing.cpp | 6 +- .../lookandfeel/juce_LookAndFeel.cpp | 128 +++++++++--------- .../components/lookandfeel/juce_LookAndFeel.h | 11 +- .../windows/juce_DocumentWindow.cpp | 2 +- .../windows/juce_TopLevelWindow.cpp | 22 +-- .../components/windows/juce_TopLevelWindow.h | 8 +- 7 files changed, 93 insertions(+), 88 deletions(-) diff --git a/build/win32/platform_specific_code/juce_win32_Threads.cpp b/build/win32/platform_specific_code/juce_win32_Threads.cpp index 94f34dee0b..e88b7de356 100644 --- a/build/win32/platform_specific_code/juce_win32_Threads.cpp +++ b/build/win32/platform_specific_code/juce_win32_Threads.cpp @@ -247,7 +247,7 @@ static int lastProcessPriority = -1; // 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. -void repeatLastProcessPriority() +void juce_repeatLastProcessPriority() throw() { 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) { lastProcessPriority = (int) prior; - repeatLastProcessPriority(); + juce_repeatLastProcessPriority(); } } diff --git a/build/win32/platform_specific_code/juce_win32_Windowing.cpp b/build/win32/platform_specific_code/juce_win32_Windowing.cpp index 953f54177b..a4f514dbfb 100644 --- a/build/win32/platform_specific_code/juce_win32_Windowing.cpp +++ b/build/win32/platform_specific_code/juce_win32_Windowing.cpp @@ -91,8 +91,8 @@ BEGIN_JUCE_NAMESPACE #include "juce_win32_DynamicLibraryLoader.h" -extern void repeatLastProcessPriority(); // in juce_win32_Threads.cpp -extern void juce_CheckCurrentlyFocusedTopLevelWindow(); // in juce_TopLevelWindow.cpp +extern void juce_repeatLastProcessPriority() throw(); // in juce_win32_Threads.cpp +extern void juce_CheckCurrentlyFocusedTopLevelWindow() throw(); // in juce_TopLevelWindow.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, // so this forces an update when the app is brought to the front if (wParam != FALSE) - repeatLastProcessPriority(); + juce_repeatLastProcessPriority(); juce_CheckCurrentlyFocusedTopLevelWindow(); return 0; diff --git a/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp b/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp index 15c84baeac..92772e5320 100644 --- a/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp +++ b/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp @@ -211,7 +211,7 @@ const Colour LookAndFeel::findColour (const int colourId) const throw() 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); @@ -226,7 +226,7 @@ void LookAndFeel::setColour (const int colourId, const Colour& colour) static LookAndFeel* defaultLF = 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 // trying to hack your own main() function, have a look at @@ -236,7 +236,7 @@ LookAndFeel& LookAndFeel::getDefaultLookAndFeel() return *currentDefaultLF; } -void LookAndFeel::setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) +void LookAndFeel::setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) throw() { if (newDefaultLookAndFeel == 0) { @@ -257,7 +257,7 @@ void LookAndFeel::setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) } } -void LookAndFeel::clearDefaultLookAndFeel() +void LookAndFeel::clearDefaultLookAndFeel() throw() { if (currentDefaultLF == defaultLF) currentDefaultLF = 0; @@ -276,11 +276,12 @@ void LookAndFeel::drawButtonBackground (Graphics& g, const int height = button.getHeight(); 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 indentR = button.isConnectedOnRight() ? 0.1f : outlineThickness * 0.5f; - const float indentT = button.isConnectedOnTop() ? 0.1f : outlineThickness * 0.5f; - const float indentB = button.isConnectedOnBottom() ? 0.1f : outlineThickness * 0.5f; + const float indentL = button.isConnectedOnLeft() ? 0.1f : halfThickness; + const float indentR = button.isConnectedOnRight() ? 0.1f : halfThickness; + const float indentT = button.isConnectedOnTop() ? 0.1f : halfThickness; + const float indentB = button.isConnectedOnBottom() ? 0.1f : halfThickness; const Colour baseColour (createBaseColour (backgroundColour, button.hasKeyboardFocus (true), @@ -326,8 +327,8 @@ void LookAndFeel::drawTickBox (Graphics& g, g.setColour (isEnabled ? Colours::black : Colours::grey); - AffineTransform trans (AffineTransform::scale (w / 9.0f, h / 9.0f) - .translated ((float) x, (float) y)); + const AffineTransform trans (AffineTransform::scale (w / 9.0f, h / 9.0f) + .translated ((float) x, (float) y)); g.strokePath (tick, PathStrokeType (2.5f), trans); } @@ -405,7 +406,7 @@ void LookAndFeel::drawAlertBox (Graphics& g, || 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 g.setColour (background.overlaidWith (Colours::gold.darker().withAlpha (0.25f))); @@ -437,7 +438,7 @@ void LookAndFeel::drawAlertBox (Graphics& g, (float) iconRect.getX(), (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.setColour (background); @@ -528,7 +529,7 @@ void LookAndFeel::drawScrollbarButton (Graphics& g, g.fillPath (p); - g.setColour (Colours::black.withAlpha (0.5f)); + g.setColour (Colour (0x80000000)); g.strokePath (p, PathStrokeType (0.5f)); } @@ -547,7 +548,9 @@ void LookAndFeel::drawScrollbar (Graphics& g, Path slotPath, thumbPath; 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 thumbIndentx2 = thumbIndent * 2.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, y + slotIndent, - width - slotIndent * 2.0f, - height - slotIndent * 2.0f, - (width - slotIndent * 2.0f) * 0.5f); + width - slotIndentx2, + height - slotIndentx2, + (width - slotIndentx2) * 0.5f); if (thumbSize > 0) thumbPath.addRoundedRectangle (x + thumbIndent, thumbStartPosition + thumbIndent, - width - thumbIndent * 2.0f, - thumbSize - thumbIndent * 2.0f, - (width - thumbIndent * 2.0f) * 0.5f); + width - thumbIndentx2, + thumbSize - thumbIndentx2, + (width - thumbIndentx2) * 0.5f); gx1 = (float) x; gx2 = x + width * 0.7f; } @@ -572,25 +575,25 @@ void LookAndFeel::drawScrollbar (Graphics& g, { slotPath.addRoundedRectangle (x + slotIndent, y + slotIndent, - width - slotIndent * 2.0f, - height - slotIndent * 2.0f, - (height - slotIndent * 2.0f) * 0.5f); + width - slotIndentx2, + height - slotIndentx2, + (height - slotIndentx2) * 0.5f); if (thumbSize > 0) thumbPath.addRoundedRectangle (thumbStartPosition + thumbIndent, y + thumbIndent, - thumbSize - thumbIndent * 2.0f, - height - thumbIndent * 2.0f, - (height - thumbIndent * 2.0f) * 0.5f); + thumbSize - thumbIndentx2, + height - thumbIndentx2, + (height - thumbIndentx2) * 0.5f); gy1 = (float) y; gy2 = y + height * 0.7f; } const Colour thumbColour (scrollbar.findColour (ScrollBar::thumbColourId)); - GradientBrush gb (thumbColour.overlaidWith (Colours::black.withAlpha (0.27f)), + GradientBrush gb (thumbColour.overlaidWith (Colour (0x44000000)), gx1, gy1, - thumbColour.overlaidWith (Colours::black.withAlpha (0.1f)), + thumbColour.overlaidWith (Colour (0x19000000)), gx2, gy2, false); g.setBrush (&gb); @@ -607,9 +610,9 @@ void LookAndFeel::drawScrollbar (Graphics& g, gy2 = (float) y + height; } - GradientBrush gb2 (Colours::black.withAlpha (0.0f), + GradientBrush gb2 (Colours::transparentBlack, gx1, gy1, - Colours::black.withAlpha (0.1f), + Colour (0x19000000), gx2, gy2, false); g.setBrush (&gb2); @@ -618,9 +621,9 @@ void LookAndFeel::drawScrollbar (Graphics& g, g.setColour (thumbColour); g.fillPath (thumbPath); - GradientBrush gb3 (Colours::black.withAlpha (0.05f), + GradientBrush gb3 (Colour (0x10000000), gx1, gy1, - Colours::black.withAlpha (0.0f), + Colours::transparentBlack, gx2, gy2, false); g.saveState(); @@ -634,7 +637,7 @@ void LookAndFeel::drawScrollbar (Graphics& g, g.fillPath (thumbPath); g.restoreState(); - g.setColour (Colours::black.withAlpha (0.3f)); + g.setColour (Colour (0x4c000000)); g.strokePath (thumbPath, PathStrokeType (0.4f)); } @@ -655,8 +658,8 @@ int LookAndFeel::getDefaultScrollbarWidth() int LookAndFeel::getScrollbarButtonSize (ScrollBar& scrollbar) { - return 2 + ((scrollbar.isVertical()) ? scrollbar.getWidth() - : scrollbar.getHeight()); + return 2 + (scrollbar.isVertical() ? scrollbar.getWidth() + : scrollbar.getHeight()); } //============================================================================== @@ -706,10 +709,10 @@ void LookAndFeel::drawTreeviewPlusMinusBox (Graphics& g, int x, int y, int w, in w = boxSize; h = boxSize; - g.setColour (Colours::white.withAlpha (0.9f)); + g.setColour (Colour (0xe5ffffff)); g.fillRect (x, y, w, h); - g.setColour (Colours::black.withAlpha (0.5f)); + g.setColour (Colour (0x80000000)); g.drawRect (x, y, w, h); 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)); 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) g.fillRect (0, i, width, 1); @@ -802,12 +805,10 @@ void LookAndFeel::drawPopupMenuUpDownArrow (Graphics& g, int width, int height, bool isScrollUpArrow) { - const float hh = height * 0.5f; - const Colour background (findColour (PopupMenu::backgroundColourId)); GradientBrush gb (background, - 0.0f, hh, + 0.0f, height * 0.5f, background.withAlpha (0.0f), 0.0f, isScrollUpArrow ? ((float) height) : 0.0f, false); @@ -847,10 +848,10 @@ void LookAndFeel::drawPopupMenuItem (Graphics& g, { const float separatorIndent = 5.5f; - g.setColour (Colours::black.withAlpha (0.2f)); + g.setColour (Colour (0x33000000)); 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); } 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 * arrowX, buttonY + buttonH * 0.55f); - g.setColour (Colours::black.withAlpha (0.6f)); + g.setColour (Colour (0x99000000)); g.fillPath (p); } } 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; } @@ -1122,7 +1123,7 @@ void LookAndFeel::drawLinearSlider (Graphics& g, const Colour trackColour (slider.findColour (Slider::trackColourId)); 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; if (slider.isHorizontal()) @@ -1154,7 +1155,7 @@ void LookAndFeel::drawLinearSlider (Graphics& g, g.fillPath (indent); } - g.setColour (Colours::black.withAlpha (0.3f)); + g.setColour (Colour (0x4c000000)); g.strokePath (indent, PathStrokeType (0.5f)); Colour knobColour (createBaseColour (slider.findColour (Slider::thumbColourId), @@ -1258,7 +1259,7 @@ void LookAndFeel::drawRotarySlider (Graphics& g, if (slider.isEnabled()) g.setColour (slider.findColour (Slider::rotarySliderFillColourId).withAlpha (isMouseOver ? 1.0f : 0.7f)); else - g.setColour (Colours::grey.withAlpha (0.5f)); + g.setColour (Colour (0x80808080)); const float thickness = 0.7f; @@ -1300,7 +1301,7 @@ void LookAndFeel::drawRotarySlider (Graphics& g, if (slider.isEnabled()) g.setColour (slider.findColour (Slider::rotarySliderFillColourId).withAlpha (isMouseOver ? 1.0f : 0.7f)); else - g.setColour (Colours::grey.withAlpha (0.5f)); + g.setColour (Colour (0x80808080)); Path p; 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, const BorderSize& border, ResizableWindow&) { - g.setColour (Colours::black.withAlpha (0.5f)); + g.setColour (Colour (0x80000000)); g.drawRect (0, 0, w, h); - g.setColour (Colours::black.withAlpha (0.1f)); + g.setColour (Colour (0x19000000)); g.drawRect (border.getLeft() - 1, border.getTop() - 1, w + 2 - border.getLeftAndRight(), @@ -1505,7 +1506,7 @@ public: //============================================================================== GlassWindowButton (const String& name, const Colour& col, const Path& normalShape_, - const Path& toggledShape_) + const Path& toggledShape_) throw() : Button (name), colour (col), normalShape (normalShape_), @@ -1670,7 +1671,7 @@ void LookAndFeel::drawStretchableLayoutResizerBar (Graphics& g, if (isMouseOver || isMouseDragging) { - g.fillAll (Colours::blue.withAlpha (0.1f)); + g.fillAll (Colour (0x190000ff)); alpha = 1.0f; } @@ -1997,7 +1998,8 @@ void LookAndFeel::drawTabAreaBehindFrontButton (Graphics& g, shadowRect.expand (2, 2); g.fillRect (shadowRect); - g.setColour (Colours::black.withAlpha (0.5f)); + g.setColour (Colour (0x80000000)); + if (orientation == TabbedButtonBar::TabsAtLeft) { g.fillRect (w - 1, 0, 1, h); @@ -2026,7 +2028,7 @@ Button* LookAndFeel::createTabBarExtrasButton() DrawablePath ellipse; ellipse.setPath (p); - ellipse.setSolidFill (Colours::white.withAlpha (0.6f)); + ellipse.setSolidFill (Colour (0x99ffffff)); p.clear(); p.addEllipse (0.0f, 0.0f, 100.0f, 100.0f); @@ -2037,13 +2039,13 @@ Button* LookAndFeel::createTabBarExtrasButton() DrawablePath dp; dp.setPath (p); - dp.setSolidFill (Colours::black.withAlpha (0.35f)); + dp.setSolidFill (Colour (0x59000000)); DrawableComposite normalImage; normalImage.insertDrawable (ellipse); normalImage.insertDrawable (dp); - dp.setSolidFill (Colours::black.withAlpha (0.8f)); + dp.setSolidFill (Colour (0xcc000000)); DrawableComposite overImage; overImage.insertDrawable (ellipse); @@ -2070,7 +2072,7 @@ void LookAndFeel::drawTableHeaderBackground (Graphics& g, TableHeaderComponent& g.setBrush (&gb); 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); for (int i = header.getNumColumns (true); --i >= 0;) @@ -2101,7 +2103,7 @@ void LookAndFeel::drawTableHeaderColumn (Graphics& g, const String& columnName, Path sortArrow; 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); } @@ -2176,7 +2178,7 @@ void LookAndFeel::drawPropertyPanelSectionHeader (Graphics& g, const String& nam void LookAndFeel::drawPropertyComponentBackground (Graphics& g, int width, int height, PropertyComponent&) { - g.setColour (Colours::white.withAlpha (0.4f)); + g.setColour (Colour (0x66ffffff)); g.fillRect (0, 0, width, height - 1); } @@ -2440,17 +2442,17 @@ void LookAndFeel::drawShinyButtonShape (Graphics& g, ! (flatOnRight || flatOnBottom)); 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); - cg.addColour (0.5, baseColour.overlaidWith (Colours::white.withAlpha (0.2f))); - cg.addColour (0.51, baseColour.overlaidWith (Colours::blue.withAlpha (0.07f))); + cg.addColour (0.5, baseColour.overlaidWith (Colour (0x33ffffff))); + cg.addColour (0.51, baseColour.overlaidWith (Colour (0x110000ff))); GradientBrush gb (cg); g.setBrush (&gb); g.fillPath (outline); - g.setColour (Colours::black.withAlpha (0.5f)); + g.setColour (Colour (0x80000000)); g.strokePath (outline, PathStrokeType (strokeWidth)); } diff --git a/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.h b/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.h index fbbb369ea5..deae7532fd 100644 --- a/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.h +++ b/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.h @@ -81,7 +81,7 @@ public: @see setDefaultLookAndFeel */ - static LookAndFeel& getDefaultLookAndFeel(); + static LookAndFeel& getDefaultLookAndFeel() throw(); /** Changes the default look-and-feel. @@ -91,7 +91,7 @@ public: it's no longer needed. @see getDefaultLookAndFeel */ - static void setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel); + static void setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) throw(); //============================================================================== @@ -120,7 +120,7 @@ public: @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. */ @@ -539,7 +539,7 @@ protected: private: friend void JUCE_PUBLIC_FUNCTION shutdownJuce_GUI(); - static void clearDefaultLookAndFeel(); // called at shutdown + static void clearDefaultLookAndFeel() throw(); // called at shutdown Array colourIds; Array colours; @@ -552,6 +552,9 @@ private: const bool flatOnRight, const bool flatOnTop, const bool flatOnBottom) throw(); + + LookAndFeel (const LookAndFeel&); + const LookAndFeel& operator= (const LookAndFeel&); }; diff --git a/src/juce_appframework/gui/components/windows/juce_DocumentWindow.cpp b/src/juce_appframework/gui/components/windows/juce_DocumentWindow.cpp index 629cfd90aa..1f3e9052fa 100644 --- a/src/juce_appframework/gui/components/windows/juce_DocumentWindow.cpp +++ b/src/juce_appframework/gui/components/windows/juce_DocumentWindow.cpp @@ -180,7 +180,7 @@ void DocumentWindow::paint (Graphics& g) 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()); } diff --git a/src/juce_appframework/gui/components/windows/juce_TopLevelWindow.cpp b/src/juce_appframework/gui/components/windows/juce_TopLevelWindow.cpp index 5262c93f86..c349ea748b 100644 --- a/src/juce_appframework/gui/components/windows/juce_TopLevelWindow.cpp +++ b/src/juce_appframework/gui/components/windows/juce_TopLevelWindow.cpp @@ -100,7 +100,7 @@ public: } } - bool addWindow (TopLevelWindow* const w) + bool addWindow (TopLevelWindow* const w) throw() { windows.add (w); startTimer (10); @@ -108,7 +108,7 @@ public: return isWindowActive (w); } - void removeWindow (TopLevelWindow* const w) + void removeWindow (TopLevelWindow* const w) throw() { startTimer (10); @@ -126,7 +126,7 @@ public: private: TopLevelWindow* currentActive; - bool isWindowActive (TopLevelWindow* const tlw) const + bool isWindowActive (TopLevelWindow* const tlw) const throw() { return (tlw == currentActive || tlw->isParentOf (currentActive) @@ -140,7 +140,7 @@ private: juce_ImplementSingleton_SingleThreaded (TopLevelWindowManager) -void juce_CheckCurrentlyFocusedTopLevelWindow() +void juce_CheckCurrentlyFocusedTopLevelWindow() throw() { if (TopLevelWindowManager::getInstanceWithoutCreating() != 0) TopLevelWindowManager::getInstanceWithoutCreating()->startTimer (20); @@ -182,7 +182,7 @@ void TopLevelWindow::focusOfChildComponentChanged (FocusChangeType) TopLevelWindowManager::getInstance()->startTimer (10); } -void TopLevelWindow::setWindowActive (const bool isNowActive) +void TopLevelWindow::setWindowActive (const bool isNowActive) throw() { if (windowIsActive_ != isNowActive) { @@ -338,7 +338,7 @@ void TopLevelWindow::centreAroundComponent (Component* c, const int width, const } else { - Rectangle screenArea (getParentMonitorArea()); + const Rectangle screenArea (getParentMonitorArea()); setBounds (jlimit (screenArea.getX(), jmax (screenArea.getX(), screenArea.getWidth() - width), x), 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(); } -TopLevelWindow* TopLevelWindow::getTopLevelWindow (const int index) +TopLevelWindow* TopLevelWindow::getTopLevelWindow (const int index) throw() { return (TopLevelWindow*) TopLevelWindowManager::getInstance()->windows [index]; } -TopLevelWindow* TopLevelWindow::getActiveTopLevelWindow() +TopLevelWindow* TopLevelWindow::getActiveTopLevelWindow() throw() { TopLevelWindow* best = 0; int bestNumTWLParents = -1; @@ -371,11 +371,11 @@ TopLevelWindow* TopLevelWindow::getActiveTopLevelWindow() { int numTWLParents = 0; - Component* c = tlw->getParentComponent(); + const Component* c = tlw->getParentComponent(); while (c != 0) { - if (dynamic_cast (c) != 0) + if (dynamic_cast (c) != 0) ++numTWLParents; c = c->getParentComponent(); diff --git a/src/juce_appframework/gui/components/windows/juce_TopLevelWindow.h b/src/juce_appframework/gui/components/windows/juce_TopLevelWindow.h index 62af4fb7c6..34965ee6bf 100644 --- a/src/juce_appframework/gui/components/windows/juce_TopLevelWindow.h +++ b/src/juce_appframework/gui/components/windows/juce_TopLevelWindow.h @@ -121,19 +121,19 @@ public: @see getTopLevelWindow */ - static int getNumTopLevelWindows(); + static int getNumTopLevelWindows() throw(); /** Returns one of the TopLevelWindow objects currently in use. 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. 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_; DropShadower* shadower; - void setWindowActive (const bool isNowActive); + void setWindowActive (const bool isNowActive) throw(); TopLevelWindow (const TopLevelWindow&); const TopLevelWindow& operator= (const TopLevelWindow&);