diff --git a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.h b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.h index 07f6e914cd..b84bfc3efe 100644 --- a/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.h +++ b/extras/Jucer (experimental)/Source/ui/Component Editor/jucer_ComponentEditor.h @@ -38,7 +38,7 @@ class ComponentEditor : public DocumentEditorComponent public: //============================================================================== ComponentEditor (OpenDocumentManager::Document* document, - Project* project, + Project* project, ComponentDocument* componentDocument); ~ComponentEditor(); @@ -46,7 +46,7 @@ public: //============================================================================== void paint (Graphics& g); void resized(); - + ComponentDocument& getDocument() const { return *componentDocument; } private: diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 1234ceae1c..35de06a512 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -56153,12 +56153,12 @@ FileBrowserListener::~FileBrowserListener() { } -void DirectoryContentsDisplayComponent::addListener (FileBrowserListener* const listener) throw() +void DirectoryContentsDisplayComponent::addListener (FileBrowserListener* const listener) { listeners.add (listener); } -void DirectoryContentsDisplayComponent::removeListener (FileBrowserListener* const listener) throw() +void DirectoryContentsDisplayComponent::removeListener (FileBrowserListener* const listener) { listeners.remove (listener); } @@ -56577,12 +56577,12 @@ FileBrowserComponent::~FileBrowserComponent() thread.stopThread (10000); } -void FileBrowserComponent::addListener (FileBrowserListener* const newListener) throw() +void FileBrowserComponent::addListener (FileBrowserListener* const newListener) { listeners.add (newListener); } -void FileBrowserComponent::removeListener (FileBrowserListener* const listener) throw() +void FileBrowserComponent::removeListener (FileBrowserListener* const listener) { listeners.remove (listener); } @@ -57582,7 +57582,7 @@ void FilenameComponent::setTooltip (const String& newTooltip) filenameBox->setTooltip (newTooltip); } -void FilenameComponent::setDefaultBrowseTarget (const File& newDefaultDirectory) throw() +void FilenameComponent::setDefaultBrowseTarget (const File& newDefaultDirectory) { defaultBrowseFile = newDefaultDirectory; } @@ -57712,12 +57712,12 @@ void FilenameComponent::addRecentlyUsedFile (const File& file) } } -void FilenameComponent::addListener (FilenameComponentListener* const listener) throw() +void FilenameComponent::addListener (FilenameComponentListener* const listener) { listeners.add (listener); } -void FilenameComponent::removeListener (FilenameComponentListener* const listener) throw() +void FilenameComponent::removeListener (FilenameComponentListener* const listener) { listeners.remove (listener); } @@ -57787,7 +57787,7 @@ FileSearchPathListComponent::~FileSearchPathListComponent() deleteAllChildren(); } -void FileSearchPathListComponent::updateButtons() throw() +void FileSearchPathListComponent::updateButtons() { const bool anythingSelected = listBox->getNumSelectedRows() > 0; @@ -57797,7 +57797,7 @@ void FileSearchPathListComponent::updateButtons() throw() downButton->setEnabled (anythingSelected); } -void FileSearchPathListComponent::changed() throw() +void FileSearchPathListComponent::changed() { listBox->updateContent(); listBox->repaint(); @@ -57813,7 +57813,7 @@ void FileSearchPathListComponent::setPath (const FileSearchPath& newPath) } } -void FileSearchPathListComponent::setDefaultBrowseTarget (const File& newDefaultDirectory) throw() +void FileSearchPathListComponent::setDefaultBrowseTarget (const File& newDefaultDirectory) { defaultBrowseTarget = newDefaultDirectory; } @@ -57985,7 +57985,7 @@ public: DirectoryContentsList* const parentContentsList_, const int indexInContentsList_, const File& file_, - TimeSliceThread& thread_) throw() + TimeSliceThread& thread_) : file (file_), owner (owner_), parentContentsList (parentContentsList_), @@ -58010,7 +58010,7 @@ public: } } - ~FileListTreeItem() throw() + ~FileListTreeItem() { thread.removeTimeSliceClient (this); @@ -58053,7 +58053,7 @@ public: } } - void setSubContentsList (DirectoryContentsList* newList) throw() + void setSubContentsList (DirectoryContentsList* newList) { jassert (subContentsList == 0); subContentsList = newList; @@ -58139,7 +58139,7 @@ private: String fileSize; String modTime; - void updateIcon (const bool onlyUpdateIfCached) throw() + void updateIcon (const bool onlyUpdateIfCached) { if (icon == 0) { @@ -58195,7 +58195,7 @@ void FileTreeComponent::scrollToTop() getViewport()->getVerticalScrollBar()->setCurrentRangeStart (0); } -void FileTreeComponent::setDragAndDropDescription (const String& description) throw() +void FileTreeComponent::setDragAndDropDescription (const String& description) { dragAndDropDescription = description; } @@ -58330,7 +58330,7 @@ bool WildcardFileFilter::isDirectorySuitable (const File& file) const return match (file, directoryWildcards); } -void WildcardFileFilter::parse (const String& pattern, StringArray& result) throw() +void WildcardFileFilter::parse (const String& pattern, StringArray& result) { result.addTokens (pattern.toLowerCase(), ";,", "\"'"); @@ -58344,7 +58344,7 @@ void WildcardFileFilter::parse (const String& pattern, StringArray& result) thro result.set (i, "*"); } -bool WildcardFileFilter::match (const File& file, const StringArray& wildcards) throw() +bool WildcardFileFilter::match (const File& file, const StringArray& wildcards) { const String filename (file.getFileName()); @@ -58379,7 +58379,7 @@ namespace KeyboardFocusHelpers public: ScreenPositionComparator() {} - static int compareElements (const Component* const first, const Component* const second) throw() + static int compareElements (const Component* const first, const Component* const second) { int explicitOrder1 = first->getExplicitFocusOrder(); if (explicitOrder1 <= 0) @@ -58429,7 +58429,7 @@ namespace KeyboardFocusHelpers } } -static Component* getIncrementedComponent (Component* const current, const int delta) throw() +static Component* getIncrementedComponent (Component* const current, const int delta) { Component* focusContainer = current->getParentComponent(); @@ -59032,7 +59032,7 @@ bool KeyPress::operator!= (const KeyPress& other) const throw() return ! operator== (other); } -bool KeyPress::isCurrentlyDown() const throw() +bool KeyPress::isCurrentlyDown() const { return isKeyCurrentlyDown (keyCode) && (ModifierKeys::getCurrentModifiers().getRawFlags() & ModifierKeys::allKeyboardModifiers) @@ -59073,7 +59073,7 @@ namespace KeyPressHelpers static const String numberPadPrefix() { return "numpad "; } } -const KeyPress KeyPress::createFromDescription (const String& desc) throw() +const KeyPress KeyPress::createFromDescription (const String& desc) { int modifiers = 0; @@ -59158,7 +59158,7 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw() return KeyPress (key, ModifierKeys (modifiers), 0); } -const String KeyPress::getTextDescription() const throw() +const String KeyPress::getTextDescription() const { String desc; @@ -59226,7 +59226,7 @@ END_JUCE_NAMESPACE /*** Start of inlined file: juce_KeyPressMappingSet.cpp ***/ BEGIN_JUCE_NAMESPACE -KeyPressMappingSet::KeyPressMappingSet (ApplicationCommandManager* const commandManager_) throw() +KeyPressMappingSet::KeyPressMappingSet (ApplicationCommandManager* const commandManager_) : commandManager (commandManager_) { // A manager is needed to get the descriptions of commands, and will be called when @@ -59236,7 +59236,7 @@ KeyPressMappingSet::KeyPressMappingSet (ApplicationCommandManager* const command Desktop::getInstance().addFocusChangeListener (this); } -KeyPressMappingSet::KeyPressMappingSet (const KeyPressMappingSet& other) throw() +KeyPressMappingSet::KeyPressMappingSet (const KeyPressMappingSet& other) : commandManager (other.commandManager) { Desktop::getInstance().addFocusChangeListener (this); @@ -59247,7 +59247,7 @@ KeyPressMappingSet::~KeyPressMappingSet() Desktop::getInstance().removeFocusChangeListener (this); } -const Array KeyPressMappingSet::getKeyPressesAssignedToCommand (const CommandID commandID) const throw() +const Array KeyPressMappingSet::getKeyPressesAssignedToCommand (const CommandID commandID) const { for (int i = 0; i < mappings.size(); ++i) if (mappings.getUnchecked(i)->commandID == commandID) @@ -59258,7 +59258,7 @@ const Array KeyPressMappingSet::getKeyPressesAssignedToCommand (const void KeyPressMappingSet::addKeyPress (const CommandID commandID, const KeyPress& newKeyPress, - int insertIndex) throw() + int insertIndex) { // If you specify an upper-case letter but no shift key, how is the user supposed to press it!? // Stick to lower-case letters when defining a keypress, to avoid ambiguity. @@ -59298,7 +59298,7 @@ void KeyPressMappingSet::addKeyPress (const CommandID commandID, } } -void KeyPressMappingSet::resetToDefaultMappings() throw() +void KeyPressMappingSet::resetToDefaultMappings() { mappings.clear(); @@ -59316,7 +59316,7 @@ void KeyPressMappingSet::resetToDefaultMappings() throw() sendChangeMessage (this); } -void KeyPressMappingSet::resetToDefaultMapping (const CommandID commandID) throw() +void KeyPressMappingSet::resetToDefaultMapping (const CommandID commandID) { clearAllKeyPresses (commandID); @@ -59329,7 +59329,7 @@ void KeyPressMappingSet::resetToDefaultMapping (const CommandID commandID) throw } } -void KeyPressMappingSet::clearAllKeyPresses() throw() +void KeyPressMappingSet::clearAllKeyPresses() { if (mappings.size() > 0) { @@ -59338,7 +59338,7 @@ void KeyPressMappingSet::clearAllKeyPresses() throw() } } -void KeyPressMappingSet::clearAllKeyPresses (const CommandID commandID) throw() +void KeyPressMappingSet::clearAllKeyPresses (const CommandID commandID) { for (int i = mappings.size(); --i >= 0;) { @@ -59350,7 +59350,7 @@ void KeyPressMappingSet::clearAllKeyPresses (const CommandID commandID) throw() } } -void KeyPressMappingSet::removeKeyPress (const KeyPress& keypress) throw() +void KeyPressMappingSet::removeKeyPress (const KeyPress& keypress) { if (keypress.isValid()) { @@ -59370,8 +59370,7 @@ void KeyPressMappingSet::removeKeyPress (const KeyPress& keypress) throw() } } -void KeyPressMappingSet::removeKeyPress (const CommandID commandID, - const int keyPressIndex) throw() +void KeyPressMappingSet::removeKeyPress (const CommandID commandID, const int keyPressIndex) { for (int i = mappings.size(); --i >= 0;) { @@ -59393,8 +59392,7 @@ CommandID KeyPressMappingSet::findCommandForKeyPress (const KeyPress& keyPress) return 0; } -bool KeyPressMappingSet::containsMapping (const CommandID commandID, - const KeyPress& keyPress) const throw() +bool KeyPressMappingSet::containsMapping (const CommandID commandID, const KeyPress& keyPress) const throw() { for (int i = mappings.size(); --i >= 0;) if (mappings.getUnchecked(i)->commandID == commandID) @@ -60308,7 +60306,7 @@ GroupComponent::~GroupComponent() { } -void GroupComponent::setText (const String& newText) throw() +void GroupComponent::setText (const String& newText) { if (text != newText) { @@ -60317,7 +60315,7 @@ void GroupComponent::setText (const String& newText) throw() } } -const String GroupComponent::getText() const throw() +const String GroupComponent::getText() const { return text; } @@ -61112,8 +61110,7 @@ class ScrollbarButton : public Button public: int direction; - ScrollbarButton (const int direction_, - ScrollBar& owner_) throw() + ScrollbarButton (const int direction_, ScrollBar& owner_) : Button (String::empty), direction (direction_), owner (owner_) @@ -61125,9 +61122,7 @@ public: { } - void paintButton (Graphics& g, - bool isMouseOver, - bool isMouseDown) + void paintButton (Graphics& g, bool isMouseOver, bool isMouseDown) { getLookAndFeel() .drawScrollbarButton (g, owner, @@ -61153,10 +61148,8 @@ private: ScrollBar::ScrollBar (const bool vertical_, const bool buttonsAreVisible) - : minimum (0.0), - maximum (1.0), - rangeStart (0.0), - rangeSize (0.1), + : totalRange (0.0, 1.0), + visibleRange (0.0, 0.1), singleStepSize (0.1), thumbAreaStart (0), thumbAreaSize (0), @@ -61182,68 +61175,73 @@ ScrollBar::~ScrollBar() deleteAllChildren(); } -void ScrollBar::setRangeLimits (const double newMinimum, - const double newMaximum) throw() +void ScrollBar::setRangeLimits (const Range& newRangeLimit) { - minimum = newMinimum; - maximum = newMaximum; - - jassert (maximum >= minimum); // these can't be the wrong way round! - - setCurrentRangeStart (rangeStart); - updateThumbPosition(); + if (totalRange != newRangeLimit) + { + totalRange = newRangeLimit; + setCurrentRange (visibleRange); + updateThumbPosition(); + } } -void ScrollBar::setCurrentRange (double newStart, - double newSize) throw() +void ScrollBar::setRangeLimits (const double newMinimum, const double newMaximum) { - newSize = jlimit (0.0, maximum - minimum, newSize); - newStart = jlimit (minimum, maximum - newSize, newStart); + jassert (newMaximum >= newMinimum); // these can't be the wrong way round! + setRangeLimits (Range (newMinimum, newMaximum)); +} - if (rangeStart != newStart - || rangeSize != newSize) +void ScrollBar::setCurrentRange (const Range& newRange) +{ + const Range constrainedRange (totalRange.constrainRange (newRange)); + + if (visibleRange != constrainedRange) { - rangeStart = newStart; - rangeSize = newSize; + visibleRange = constrainedRange; updateThumbPosition(); triggerAsyncUpdate(); } } -void ScrollBar::setCurrentRangeStart (double newStart) throw() +void ScrollBar::setCurrentRange (const double newStart, const double newSize) { - setCurrentRange (newStart, rangeSize); + setCurrentRange (Range (newStart, newStart + newSize)); } -void ScrollBar::setSingleStepSize (const double newSingleStepSize) throw() +void ScrollBar::setCurrentRangeStart (const double newStart) +{ + setCurrentRange (visibleRange.movedToStartAt (newStart)); +} + +void ScrollBar::setSingleStepSize (const double newSingleStepSize) { singleStepSize = newSingleStepSize; } -void ScrollBar::moveScrollbarInSteps (const int howManySteps) throw() +void ScrollBar::moveScrollbarInSteps (const int howManySteps) { - setCurrentRangeStart (rangeStart + howManySteps * singleStepSize); + setCurrentRange (visibleRange + howManySteps * singleStepSize); } -void ScrollBar::moveScrollbarInPages (const int howManyPages) throw() +void ScrollBar::moveScrollbarInPages (const int howManyPages) { - setCurrentRangeStart (rangeStart + howManyPages * rangeSize); + setCurrentRange (visibleRange + howManyPages * visibleRange.getLength()); } -void ScrollBar::scrollToTop() throw() +void ScrollBar::scrollToTop() { - setCurrentRangeStart (minimum); + setCurrentRange (visibleRange.movedToStartAt (getMinimumRangeLimit())); } -void ScrollBar::scrollToBottom() throw() +void ScrollBar::scrollToBottom() { - setCurrentRangeStart (maximum - rangeSize); + setCurrentRange (visibleRange.movedToEndAt (getMaximumRangeLimit())); } void ScrollBar::setButtonRepeatSpeed (const int initialDelayInMillisecs_, const int repeatDelayInMillisecs_, - const int minimumDelayInMillisecs_) throw() + const int minimumDelayInMillisecs_) { initialDelayInMillisecs = initialDelayInMillisecs_; repeatDelayInMillisecs = repeatDelayInMillisecs_; @@ -61256,25 +61254,25 @@ void ScrollBar::setButtonRepeatSpeed (const int initialDelayInMillisecs_, } } -void ScrollBar::addListener (ScrollBarListener* const listener) throw() +void ScrollBar::addListener (ScrollBarListener* const listener) { listeners.add (listener); } -void ScrollBar::removeListener (ScrollBarListener* const listener) throw() +void ScrollBar::removeListener (ScrollBarListener* const listener) { listeners.remove (listener); } void ScrollBar::handleAsyncUpdate() { - listeners.call (&ScrollBarListener::scrollBarMoved, this, rangeStart); + listeners.call (&ScrollBarListener::scrollBarMoved, this, visibleRange.getStart()); } -void ScrollBar::updateThumbPosition() throw() +void ScrollBar::updateThumbPosition() { - int newThumbSize = roundToInt ((maximum > minimum) ? (rangeSize * thumbAreaSize) / (maximum - minimum) - : thumbAreaSize); + int newThumbSize = roundToInt (totalRange.getLength() > 0 ? (visibleRange.getLength() * thumbAreaSize) / totalRange.getLength() + : thumbAreaSize); if (newThumbSize < getLookAndFeel().getMinimumScrollbarThumbSize (*this)) newThumbSize = jmin (getLookAndFeel().getMinimumScrollbarThumbSize (*this), thumbAreaSize - 1); @@ -61284,11 +61282,11 @@ void ScrollBar::updateThumbPosition() throw() int newThumbStart = thumbAreaStart; - if (maximum - minimum > rangeSize) - newThumbStart += roundToInt (((rangeStart - minimum) * (thumbAreaSize - newThumbSize)) - / ((maximum - minimum) - rangeSize)); + if (totalRange.getLength() > visibleRange.getLength()) + newThumbStart += roundToInt (((visibleRange.getStart() - totalRange.getStart()) * (thumbAreaSize - newThumbSize)) + / (totalRange.getLength() - visibleRange.getLength())); - setVisible (alwaysVisible || (maximum - minimum > rangeSize && rangeSize > 0.0)); + setVisible (alwaysVisible || (totalRange.getLength() > visibleRange.getLength() && visibleRange.getLength() > 0.0)); if (thumbStart != newThumbStart || thumbSize != newThumbSize) { @@ -61305,7 +61303,7 @@ void ScrollBar::updateThumbPosition() throw() } } -void ScrollBar::setOrientation (const bool shouldBeVertical) throw() +void ScrollBar::setOrientation (const bool shouldBeVertical) { if (vertical != shouldBeVertical) { @@ -61418,7 +61416,7 @@ void ScrollBar::mouseDown (const MouseEvent& e) isDraggingThumb = false; lastMousePos = vertical ? e.y : e.x; dragStartMousePos = lastMousePos; - dragStartRange = rangeStart; + dragStartRange = visibleRange.getStart(); if (dragStartMousePos < thumbStart) { @@ -61444,7 +61442,7 @@ void ScrollBar::mouseDrag (const MouseEvent& e) const int deltaPixels = ((vertical) ? e.y : e.x) - dragStartMousePos; setCurrentRangeStart (dragStartRange - + deltaPixels * ((maximum - minimum) - rangeSize) + + deltaPixels * (totalRange.getLength() - visibleRange.getLength()) / (thumbAreaSize - thumbSize)); } else @@ -61471,7 +61469,7 @@ void ScrollBar::mouseWheelMove (const MouseEvent&, else if (increment > 0) increment = jmax (increment * 10.0f, 1.0f); - setCurrentRangeStart (rangeStart - singleStepSize * increment); + setCurrentRange (visibleRange - singleStepSize * increment); } void ScrollBar::timerCallback() @@ -61481,9 +61479,9 @@ void ScrollBar::timerCallback() startTimer (40); if (lastMousePos < thumbStart) - setCurrentRangeStart (rangeStart - rangeSize); + setCurrentRange (visibleRange - visibleRange.getLength()); else if (lastMousePos > thumbStart + thumbSize) - setCurrentRangeStart (rangeStart + rangeSize); + setCurrentRangeStart (visibleRange.getEnd()); } else { @@ -213869,7 +213867,7 @@ private: long improbableWindowNumber = 0xf965aa01; // also referenced by messaging.cpp -bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() +bool KeyPress::isKeyCurrentlyDown (const int keyCode) { SHORT k = (SHORT) keyCode; @@ -230844,7 +230842,7 @@ namespace Keys static const int extendedKeyModifier = 0x10000000; } -bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() +bool KeyPress::isKeyCurrentlyDown (const int keyCode) { int keysym; @@ -240391,7 +240389,7 @@ END_JUCE_NAMESPACE owner->drawRect (r); } -bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() +bool KeyPress::isKeyCurrentlyDown (const int keyCode) { return false; } @@ -245632,7 +245630,7 @@ ModifierKeys NSViewComponentPeer::currentModifiers; ComponentPeer* NSViewComponentPeer::currentlyFocusedPeer = 0; VoidArray NSViewComponentPeer::keysCurrentlyDown; -bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() +bool KeyPress::isKeyCurrentlyDown (const int keyCode) { if (NSViewComponentPeer::keysCurrentlyDown.contains ((void*) keyCode)) return true; diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 3585448a3b..24d2612390 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -4857,6 +4857,11 @@ public: return Range (newStart, jmax (newStart, end)); } + const Range movedToStartAt (const ValueType newStart) const throw() + { + return Range (newStart, newStart + getLength()); + } + void setEnd (const ValueType newEnd) throw() { end = newEnd; @@ -4869,6 +4874,11 @@ public: return Range (jmin (start, newEnd), newEnd); } + const Range movedToEndAt (const ValueType newEnd) const throw() + { + return Range (newEnd - getLength(), newEnd); + } + void setLength (const ValueType newLength) throw() { end = start + jmax (ValueType(), newLength); @@ -4903,6 +4913,9 @@ public: return Range (start - amountToSubtract, end - amountToSubtract); } + bool operator== (const Range& other) const throw() { return start == other.start && end == other.end; } + bool operator!= (const Range& other) const throw() { return start != other.start || end != other.end; } + bool contains (const ValueType position) const throw() { return position >= start && position < end; @@ -4930,6 +4943,14 @@ public: jmax (end, other.end)); } + const Range constrainRange (const Range& rangeToConstrain) const throw() + { + const ValueType otherLen = rangeToConstrain.getLength(); + return otherLen >= getLength() + ? *this + : rangeToConstrain.movedToStartAt (jlimit (start, end - otherLen, rangeToConstrain.getStart())); + } + juce_UseDebuggingNewOperator private: @@ -9735,13 +9756,13 @@ public: bool isKeyCode (int keyCodeToCompare) const throw() { return keyCode == keyCodeToCompare; } - static const KeyPress createFromDescription (const String& textVersion) throw(); + static const KeyPress createFromDescription (const String& textVersion); - const String getTextDescription() const throw(); + const String getTextDescription() const; - bool isCurrentlyDown() const throw(); + bool isCurrentlyDown() const; - static bool isKeyCurrentlyDown (int keyCode) throw(); + static bool isKeyCurrentlyDown (int keyCode); // Key codes // @@ -16082,41 +16103,47 @@ public: bool isVertical() const throw() { return vertical; } - void setOrientation (bool shouldBeVertical) throw(); + void setOrientation (bool shouldBeVertical); void setButtonVisibility (bool buttonsAreVisible); void setAutoHide (bool shouldHideWhenFullRange); - void setRangeLimits (double minimum, - double maximum) throw(); + void setRangeLimits (const Range& newRangeLimit); - double getMinimumRangeLimit() const throw() { return minimum; } + void setRangeLimits (double minimum, double maximum); - double getMaximumRangeLimit() const throw() { return maximum; } + const Range getRangeLimit() const throw() { return totalRange; } - void setCurrentRange (double newStart, - double newSize) throw(); + double getMinimumRangeLimit() const throw() { return totalRange.getStart(); } - void setCurrentRangeStart (double newStart) throw(); + double getMaximumRangeLimit() const throw() { return totalRange.getEnd(); } - double getCurrentRangeStart() const throw() { return rangeStart; } + void setCurrentRange (const Range& newRange); - double getCurrentRangeSize() const throw() { return rangeSize; } + void setCurrentRange (double newStart, double newSize); - void setSingleStepSize (double newSingleStepSize) throw(); + void setCurrentRangeStart (double newStart); - void moveScrollbarInSteps (int howManySteps) throw(); + const Range getCurrentRange() const throw() { return visibleRange; } - void moveScrollbarInPages (int howManyPages) throw(); + double getCurrentRangeStart() const throw() { return visibleRange.getStart(); } - void scrollToTop() throw(); + double getCurrentRangeSize() const throw() { return visibleRange.getLength(); } - void scrollToBottom() throw(); + void setSingleStepSize (double newSingleStepSize); + + void moveScrollbarInSteps (int howManySteps); + + void moveScrollbarInPages (int howManyPages); + + void scrollToTop(); + + void scrollToBottom(); void setButtonRepeatSpeed (int initialDelayInMillisecs, int repeatDelayInMillisecs, - int minimumDelayInMillisecs = -1) throw(); + int minimumDelayInMillisecs = -1); enum ColourIds { @@ -16125,9 +16152,9 @@ public: trackColourId = 0x1000401 /**< A base colour to use for the slot area of the bar. The look and feel will probably use variations on this colour. */ }; - void addListener (ScrollBarListener* listener) throw(); + void addListener (ScrollBarListener* listener); - void removeListener (ScrollBarListener* listener) throw(); + void removeListener (ScrollBarListener* listener); bool keyPressed (const KeyPress& key); void mouseWheelMove (const MouseEvent& e, float wheelIncrementX, float wheelIncrementY); @@ -16143,8 +16170,7 @@ public: private: - double minimum, maximum; - double rangeStart, rangeSize; + Range totalRange, visibleRange; double singleStepSize, dragStartRange; int thumbAreaStart, thumbAreaSize, thumbStart, thumbSize; int dragStartMousePos, lastMousePos; @@ -16154,7 +16180,7 @@ private: Button* downButton; ListenerList listeners; - void updateThumbPosition() throw(); + void updateThumbPosition(); void timerCallback(); ScrollBar (const ScrollBar&); @@ -22337,9 +22363,9 @@ public: virtual void scrollToTop() = 0; - void addListener (FileBrowserListener* listener) throw(); + void addListener (FileBrowserListener* listener); - void removeListener (FileBrowserListener* listener) throw(); + void removeListener (FileBrowserListener* listener); enum ColourIds { @@ -22452,9 +22478,9 @@ public: bool isSaveMode() const throw(); - void addListener (FileBrowserListener* listener) throw(); + void addListener (FileBrowserListener* listener); - void removeListener (FileBrowserListener* listener) throw(); + void removeListener (FileBrowserListener* listener); void resized(); void buttonClicked (Button* b); @@ -23271,7 +23297,7 @@ public: void setFilenameIsEditable (bool shouldBeEditable); - void setDefaultBrowseTarget (const File& newDefaultDirectory) throw(); + void setDefaultBrowseTarget (const File& newDefaultDirectory); const StringArray getRecentlyUsedFilenames() const; @@ -23283,9 +23309,9 @@ public: void setBrowseButtonText (const String& browseButtonText); - void addListener (FilenameComponentListener* listener) throw(); + void addListener (FilenameComponentListener* listener); - void removeListener (FilenameComponentListener* listener) throw(); + void removeListener (FilenameComponentListener* listener); void setTooltip (const String& newTooltip); @@ -23348,7 +23374,7 @@ public: void setPath (const FileSearchPath& newPath); - void setDefaultBrowseTarget (const File& newDefaultDirectory) throw(); + void setDefaultBrowseTarget (const File& newDefaultDirectory); enum ColourIds { @@ -23382,8 +23408,8 @@ private: Button* upButton; Button* downButton; - void changed() throw(); - void updateButtons() throw(); + void changed(); + void updateButtons(); FileSearchPathListComponent (const FileSearchPathListComponent&); FileSearchPathListComponent& operator= (const FileSearchPathListComponent&); @@ -23415,7 +23441,7 @@ public: void scrollToTop(); - void setDragAndDropDescription (const String& description) throw(); + void setDragAndDropDescription (const String& description); const String& getDragAndDropDescription() const throw() { return dragAndDropDescription; } @@ -23495,8 +23521,8 @@ public: private: StringArray fileWildcards, directoryWildcards; - static void parse (const String& pattern, StringArray& result) throw(); - static bool match (const File& file, const StringArray& wildcards) throw(); + static void parse (const String& pattern, StringArray& result); + static bool match (const File& file, const StringArray& wildcards); }; #endif // __JUCE_WILDCARDFILEFILTER_JUCEHEADER__ @@ -23536,35 +23562,33 @@ class JUCE_API KeyPressMappingSet : public KeyListener, { public: - explicit KeyPressMappingSet (ApplicationCommandManager* commandManager) throw(); + explicit KeyPressMappingSet (ApplicationCommandManager* commandManager); - KeyPressMappingSet (const KeyPressMappingSet& other) throw(); + KeyPressMappingSet (const KeyPressMappingSet& other); ~KeyPressMappingSet(); ApplicationCommandManager* getCommandManager() const throw() { return commandManager; } - const Array getKeyPressesAssignedToCommand (CommandID commandID) const throw(); + const Array getKeyPressesAssignedToCommand (CommandID commandID) const; void addKeyPress (CommandID commandID, const KeyPress& newKeyPress, - int insertIndex = -1) throw(); + int insertIndex = -1); - void resetToDefaultMappings() throw(); + void resetToDefaultMappings(); - void resetToDefaultMapping (CommandID commandID) throw(); + void resetToDefaultMapping (CommandID commandID); - void clearAllKeyPresses() throw(); + void clearAllKeyPresses(); - void clearAllKeyPresses (CommandID commandID) throw(); + void clearAllKeyPresses (CommandID commandID); - void removeKeyPress (CommandID commandID, - int keyPressIndex) throw(); + void removeKeyPress (CommandID commandID, int keyPressIndex); - void removeKeyPress (const KeyPress& keypress) throw(); + void removeKeyPress (const KeyPress& keypress); - bool containsMapping (CommandID commandID, - const KeyPress& keyPress) const throw(); + bool containsMapping (CommandID commandID, const KeyPress& keyPress) const throw(); CommandID findCommandForKeyPress (const KeyPress& keyPress) const throw(); @@ -23748,9 +23772,9 @@ public: ~GroupComponent(); - void setText (const String& newText) throw(); + void setText (const String& newText); - const String getText() const throw(); + const String getText() const; void setTextLabelPosition (const Justification& justification); diff --git a/src/containers/juce_Range.h b/src/containers/juce_Range.h index 7fce23bf4d..21bae58503 100644 --- a/src/containers/juce_Range.h +++ b/src/containers/juce_Range.h @@ -117,6 +117,12 @@ public: return Range (newStart, jmax (newStart, end)); } + /** Returns a range with the same length as this one, but moved to have the given start position. */ + const Range movedToStartAt (const ValueType newStart) const throw() + { + return Range (newStart, newStart + getLength()); + } + /** Changes the end position of the range, leaving the start unchanged. If the new end position is below the current start of the range, the start point will be pushed back to equal the new end point. @@ -137,6 +143,12 @@ public: return Range (jmin (start, newEnd), newEnd); } + /** Returns a range with the same length as this one, but moved to have the given start position. */ + const Range movedToEndAt (const ValueType newEnd) const throw() + { + return Range (newEnd - getLength(), newEnd); + } + /** Changes the length of the range. Lengths less than zero are treated as zero. */ @@ -185,6 +197,9 @@ public: return Range (start - amountToSubtract, end - amountToSubtract); } + bool operator== (const Range& other) const throw() { return start == other.start && end == other.end; } + bool operator!= (const Range& other) const throw() { return start != other.start || end != other.end; } + //============================================================================== /** Returns true if the given position lies inside this range. */ bool contains (const ValueType position) const throw() @@ -219,6 +234,24 @@ public: jmax (end, other.end)); } + /** Returns a given range, after moving it forwards or backwards to fit it + within this range. + + If the supplied range has a greater length than this one, the return value + will be this range. + + Otherwise, if the supplied range is smaller than this one, the return value + will be the new range, shifted forwards or backwards so that it doesn't extend + beyond this one, but keeping its original length. + */ + const Range constrainRange (const Range& rangeToConstrain) const throw() + { + const ValueType otherLen = rangeToConstrain.getLength(); + return otherLen >= getLength() + ? *this + : rangeToConstrain.movedToStartAt (jlimit (start, end - otherLen, rangeToConstrain.getStart())); + } + //============================================================================== juce_UseDebuggingNewOperator diff --git a/src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.cpp b/src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.cpp index 26dd1f19a5..9e8dc41a86 100644 --- a/src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.cpp +++ b/src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.cpp @@ -45,12 +45,12 @@ FileBrowserListener::~FileBrowserListener() { } -void DirectoryContentsDisplayComponent::addListener (FileBrowserListener* const listener) throw() +void DirectoryContentsDisplayComponent::addListener (FileBrowserListener* const listener) { listeners.add (listener); } -void DirectoryContentsDisplayComponent::removeListener (FileBrowserListener* const listener) throw() +void DirectoryContentsDisplayComponent::removeListener (FileBrowserListener* const listener) { listeners.remove (listener); } diff --git a/src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.h b/src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.h index ea9f8e5b04..2e5598b328 100644 --- a/src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.h +++ b/src/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.h @@ -41,8 +41,7 @@ class JUCE_API DirectoryContentsDisplayComponent { public: //============================================================================== - /** - */ + /** Creates a DirectoryContentsDisplayComponent for a given list of files. */ DirectoryContentsDisplayComponent (DirectoryContentsList& listToShow); /** Destructor. */ @@ -65,16 +64,14 @@ public: //============================================================================== /** Adds a listener to be told when files are selected or clicked. - @see removeListener */ - void addListener (FileBrowserListener* listener) throw(); + void addListener (FileBrowserListener* listener); /** Removes a listener. - @see addListener */ - void removeListener (FileBrowserListener* listener) throw(); + void removeListener (FileBrowserListener* listener); //============================================================================== diff --git a/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp b/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp index 1e96ba6ec8..b56631dff5 100644 --- a/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp +++ b/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp @@ -150,12 +150,12 @@ FileBrowserComponent::~FileBrowserComponent() } //============================================================================== -void FileBrowserComponent::addListener (FileBrowserListener* const newListener) throw() +void FileBrowserComponent::addListener (FileBrowserListener* const newListener) { listeners.add (newListener); } -void FileBrowserComponent::removeListener (FileBrowserListener* const listener) throw() +void FileBrowserComponent::removeListener (FileBrowserListener* const listener) { listeners.remove (listener); } diff --git a/src/gui/components/filebrowser/juce_FileBrowserComponent.h b/src/gui/components/filebrowser/juce_FileBrowserComponent.h index fbb5eb4281..e1bce77322 100644 --- a/src/gui/components/filebrowser/juce_FileBrowserComponent.h +++ b/src/gui/components/filebrowser/juce_FileBrowserComponent.h @@ -160,13 +160,13 @@ public: @see removeListener */ - void addListener (FileBrowserListener* listener) throw(); + void addListener (FileBrowserListener* listener); /** Removes a listener. @see addListener */ - void removeListener (FileBrowserListener* listener) throw(); + void removeListener (FileBrowserListener* listener); //============================================================================== diff --git a/src/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp b/src/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp index a16912ffdb..52be811e06 100644 --- a/src/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp +++ b/src/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp @@ -89,7 +89,7 @@ FileSearchPathListComponent::~FileSearchPathListComponent() deleteAllChildren(); } -void FileSearchPathListComponent::updateButtons() throw() +void FileSearchPathListComponent::updateButtons() { const bool anythingSelected = listBox->getNumSelectedRows() > 0; @@ -99,7 +99,7 @@ void FileSearchPathListComponent::updateButtons() throw() downButton->setEnabled (anythingSelected); } -void FileSearchPathListComponent::changed() throw() +void FileSearchPathListComponent::changed() { listBox->updateContent(); listBox->repaint(); @@ -116,7 +116,7 @@ void FileSearchPathListComponent::setPath (const FileSearchPath& newPath) } } -void FileSearchPathListComponent::setDefaultBrowseTarget (const File& newDefaultDirectory) throw() +void FileSearchPathListComponent::setDefaultBrowseTarget (const File& newDefaultDirectory) { defaultBrowseTarget = newDefaultDirectory; } diff --git a/src/gui/components/filebrowser/juce_FileSearchPathListComponent.h b/src/gui/components/filebrowser/juce_FileSearchPathListComponent.h index c4552875b7..dca10ad283 100644 --- a/src/gui/components/filebrowser/juce_FileSearchPathListComponent.h +++ b/src/gui/components/filebrowser/juce_FileSearchPathListComponent.h @@ -66,7 +66,7 @@ public: This is only used if the current file hasn't been set. */ - void setDefaultBrowseTarget (const File& newDefaultDirectory) throw(); + void setDefaultBrowseTarget (const File& newDefaultDirectory); /** A set of colour IDs to use to change the colour of various aspects of the label. @@ -120,8 +120,8 @@ private: Button* upButton; Button* downButton; - void changed() throw(); - void updateButtons() throw(); + void changed(); + void updateButtons(); FileSearchPathListComponent (const FileSearchPathListComponent&); FileSearchPathListComponent& operator= (const FileSearchPathListComponent&); diff --git a/src/gui/components/filebrowser/juce_FileTreeComponent.cpp b/src/gui/components/filebrowser/juce_FileTreeComponent.cpp index 6b63464d14..eb8440eb5b 100644 --- a/src/gui/components/filebrowser/juce_FileTreeComponent.cpp +++ b/src/gui/components/filebrowser/juce_FileTreeComponent.cpp @@ -47,7 +47,7 @@ public: DirectoryContentsList* const parentContentsList_, const int indexInContentsList_, const File& file_, - TimeSliceThread& thread_) throw() + TimeSliceThread& thread_) : file (file_), owner (owner_), parentContentsList (parentContentsList_), @@ -72,7 +72,7 @@ public: } } - ~FileListTreeItem() throw() + ~FileListTreeItem() { thread.removeTimeSliceClient (this); @@ -116,7 +116,7 @@ public: } } - void setSubContentsList (DirectoryContentsList* newList) throw() + void setSubContentsList (DirectoryContentsList* newList) { jassert (subContentsList == 0); subContentsList = newList; @@ -203,7 +203,7 @@ private: String fileSize; String modTime; - void updateIcon (const bool onlyUpdateIfCached) throw() + void updateIcon (const bool onlyUpdateIfCached) { if (icon == 0) { @@ -261,7 +261,7 @@ void FileTreeComponent::scrollToTop() getViewport()->getVerticalScrollBar()->setCurrentRangeStart (0); } -void FileTreeComponent::setDragAndDropDescription (const String& description) throw() +void FileTreeComponent::setDragAndDropDescription (const String& description) { dragAndDropDescription = description; } diff --git a/src/gui/components/filebrowser/juce_FileTreeComponent.h b/src/gui/components/filebrowser/juce_FileTreeComponent.h index b0d0717256..7587f386ae 100644 --- a/src/gui/components/filebrowser/juce_FileTreeComponent.h +++ b/src/gui/components/filebrowser/juce_FileTreeComponent.h @@ -74,7 +74,7 @@ public: The string that you pass in here will be returned by the getDragSourceDescription() of the items in the tree. For more info, see TreeViewItem::getDragSourceDescription(). */ - void setDragAndDropDescription (const String& description) throw(); + void setDragAndDropDescription (const String& description); /** Returns the last value that was set by setDragAndDropDescription(). */ diff --git a/src/gui/components/filebrowser/juce_FilenameComponent.cpp b/src/gui/components/filebrowser/juce_FilenameComponent.cpp index ad8e002d05..4948d9fa57 100644 --- a/src/gui/components/filebrowser/juce_FilenameComponent.cpp +++ b/src/gui/components/filebrowser/juce_FilenameComponent.cpp @@ -105,7 +105,7 @@ void FilenameComponent::setTooltip (const String& newTooltip) filenameBox->setTooltip (newTooltip); } -void FilenameComponent::setDefaultBrowseTarget (const File& newDefaultDirectory) throw() +void FilenameComponent::setDefaultBrowseTarget (const File& newDefaultDirectory) { defaultBrowseFile = newDefaultDirectory; } @@ -237,12 +237,12 @@ void FilenameComponent::addRecentlyUsedFile (const File& file) } //============================================================================== -void FilenameComponent::addListener (FilenameComponentListener* const listener) throw() +void FilenameComponent::addListener (FilenameComponentListener* const listener) { listeners.add (listener); } -void FilenameComponent::removeListener (FilenameComponentListener* const listener) throw() +void FilenameComponent::removeListener (FilenameComponentListener* const listener) { listeners.remove (listener); } diff --git a/src/gui/components/filebrowser/juce_FilenameComponent.h b/src/gui/components/filebrowser/juce_FilenameComponent.h index 67994f7410..e1bf95605d 100644 --- a/src/gui/components/filebrowser/juce_FilenameComponent.h +++ b/src/gui/components/filebrowser/juce_FilenameComponent.h @@ -131,7 +131,7 @@ public: This is only used if the current file hasn't been set. */ - void setDefaultBrowseTarget (const File& newDefaultDirectory) throw(); + void setDefaultBrowseTarget (const File& newDefaultDirectory); /** Returns all the entries on the recent files list. @@ -174,10 +174,10 @@ public: //============================================================================== /** Adds a listener that will be called when the selected file is changed. */ - void addListener (FilenameComponentListener* listener) throw(); + void addListener (FilenameComponentListener* listener); /** Removes a previously-registered listener. */ - void removeListener (FilenameComponentListener* listener) throw(); + void removeListener (FilenameComponentListener* listener); /** Gives the component a tooltip. */ void setTooltip (const String& newTooltip); diff --git a/src/gui/components/filebrowser/juce_WildcardFileFilter.cpp b/src/gui/components/filebrowser/juce_WildcardFileFilter.cpp index 298519927c..88a56003ca 100644 --- a/src/gui/components/filebrowser/juce_WildcardFileFilter.cpp +++ b/src/gui/components/filebrowser/juce_WildcardFileFilter.cpp @@ -56,7 +56,7 @@ bool WildcardFileFilter::isDirectorySuitable (const File& file) const } //============================================================================== -void WildcardFileFilter::parse (const String& pattern, StringArray& result) throw() +void WildcardFileFilter::parse (const String& pattern, StringArray& result) { result.addTokens (pattern.toLowerCase(), ";,", "\"'"); @@ -70,7 +70,7 @@ void WildcardFileFilter::parse (const String& pattern, StringArray& result) thro result.set (i, "*"); } -bool WildcardFileFilter::match (const File& file, const StringArray& wildcards) throw() +bool WildcardFileFilter::match (const File& file, const StringArray& wildcards) { const String filename (file.getFileName()); diff --git a/src/gui/components/filebrowser/juce_WildcardFileFilter.h b/src/gui/components/filebrowser/juce_WildcardFileFilter.h index 582f6653cb..026dd5e6a8 100644 --- a/src/gui/components/filebrowser/juce_WildcardFileFilter.h +++ b/src/gui/components/filebrowser/juce_WildcardFileFilter.h @@ -72,8 +72,8 @@ public: private: StringArray fileWildcards, directoryWildcards; - static void parse (const String& pattern, StringArray& result) throw(); - static bool match (const File& file, const StringArray& wildcards) throw(); + static void parse (const String& pattern, StringArray& result); + static bool match (const File& file, const StringArray& wildcards); }; diff --git a/src/gui/components/keyboard/juce_KeyPress.cpp b/src/gui/components/keyboard/juce_KeyPress.cpp index 76a324cf47..5302285bed 100644 --- a/src/gui/components/keyboard/juce_KeyPress.cpp +++ b/src/gui/components/keyboard/juce_KeyPress.cpp @@ -88,7 +88,7 @@ bool KeyPress::operator!= (const KeyPress& other) const throw() return ! operator== (other); } -bool KeyPress::isCurrentlyDown() const throw() +bool KeyPress::isCurrentlyDown() const { return isKeyCurrentlyDown (keyCode) && (ModifierKeys::getCurrentModifiers().getRawFlags() & ModifierKeys::allKeyboardModifiers) @@ -131,7 +131,7 @@ namespace KeyPressHelpers } //============================================================================== -const KeyPress KeyPress::createFromDescription (const String& desc) throw() +const KeyPress KeyPress::createFromDescription (const String& desc) { int modifiers = 0; @@ -216,7 +216,7 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw() return KeyPress (key, ModifierKeys (modifiers), 0); } -const String KeyPress::getTextDescription() const throw() +const String KeyPress::getTextDescription() const { String desc; diff --git a/src/gui/components/keyboard/juce_KeyPress.h b/src/gui/components/keyboard/juce_KeyPress.h index 4f29f8b66d..b98935c245 100644 --- a/src/gui/components/keyboard/juce_KeyPress.h +++ b/src/gui/components/keyboard/juce_KeyPress.h @@ -137,7 +137,7 @@ public: @see getTextDescription */ - static const KeyPress createFromDescription (const String& textVersion) throw(); + static const KeyPress createFromDescription (const String& textVersion); /** Creates a textual description of the key combination. @@ -146,7 +146,7 @@ public: To store a keypress in a file, use this method, along with createFromDescription() to retrieve it later. */ - const String getTextDescription() const throw(); + const String getTextDescription() const; //============================================================================== /** Checks whether the user is currently holding down the keys that make up this @@ -156,14 +156,14 @@ public: down - e.g. if the keypress is CTRL+X and the user is actually holding CTRL+ALT+x then it will be false. */ - bool isCurrentlyDown() const throw(); + bool isCurrentlyDown() const; /** Checks whether a particular key is held down, irrespective of modifiers. The values for key codes can either be one of the special constants defined in this class, or an 8-bit character code. */ - static bool isKeyCurrentlyDown (int keyCode) throw(); + static bool isKeyCurrentlyDown (int keyCode); //============================================================================== // Key codes diff --git a/src/gui/components/keyboard/juce_KeyPressMappingSet.cpp b/src/gui/components/keyboard/juce_KeyPressMappingSet.cpp index ce35300252..aecbf236b9 100644 --- a/src/gui/components/keyboard/juce_KeyPressMappingSet.cpp +++ b/src/gui/components/keyboard/juce_KeyPressMappingSet.cpp @@ -34,7 +34,7 @@ BEGIN_JUCE_NAMESPACE //============================================================================== -KeyPressMappingSet::KeyPressMappingSet (ApplicationCommandManager* const commandManager_) throw() +KeyPressMappingSet::KeyPressMappingSet (ApplicationCommandManager* const commandManager_) : commandManager (commandManager_) { // A manager is needed to get the descriptions of commands, and will be called when @@ -44,7 +44,7 @@ KeyPressMappingSet::KeyPressMappingSet (ApplicationCommandManager* const command Desktop::getInstance().addFocusChangeListener (this); } -KeyPressMappingSet::KeyPressMappingSet (const KeyPressMappingSet& other) throw() +KeyPressMappingSet::KeyPressMappingSet (const KeyPressMappingSet& other) : commandManager (other.commandManager) { Desktop::getInstance().addFocusChangeListener (this); @@ -56,7 +56,7 @@ KeyPressMappingSet::~KeyPressMappingSet() } //============================================================================== -const Array KeyPressMappingSet::getKeyPressesAssignedToCommand (const CommandID commandID) const throw() +const Array KeyPressMappingSet::getKeyPressesAssignedToCommand (const CommandID commandID) const { for (int i = 0; i < mappings.size(); ++i) if (mappings.getUnchecked(i)->commandID == commandID) @@ -67,7 +67,7 @@ const Array KeyPressMappingSet::getKeyPressesAssignedToCommand (const void KeyPressMappingSet::addKeyPress (const CommandID commandID, const KeyPress& newKeyPress, - int insertIndex) throw() + int insertIndex) { // If you specify an upper-case letter but no shift key, how is the user supposed to press it!? // Stick to lower-case letters when defining a keypress, to avoid ambiguity. @@ -107,7 +107,7 @@ void KeyPressMappingSet::addKeyPress (const CommandID commandID, } } -void KeyPressMappingSet::resetToDefaultMappings() throw() +void KeyPressMappingSet::resetToDefaultMappings() { mappings.clear(); @@ -125,7 +125,7 @@ void KeyPressMappingSet::resetToDefaultMappings() throw() sendChangeMessage (this); } -void KeyPressMappingSet::resetToDefaultMapping (const CommandID commandID) throw() +void KeyPressMappingSet::resetToDefaultMapping (const CommandID commandID) { clearAllKeyPresses (commandID); @@ -138,7 +138,7 @@ void KeyPressMappingSet::resetToDefaultMapping (const CommandID commandID) throw } } -void KeyPressMappingSet::clearAllKeyPresses() throw() +void KeyPressMappingSet::clearAllKeyPresses() { if (mappings.size() > 0) { @@ -147,7 +147,7 @@ void KeyPressMappingSet::clearAllKeyPresses() throw() } } -void KeyPressMappingSet::clearAllKeyPresses (const CommandID commandID) throw() +void KeyPressMappingSet::clearAllKeyPresses (const CommandID commandID) { for (int i = mappings.size(); --i >= 0;) { @@ -159,7 +159,7 @@ void KeyPressMappingSet::clearAllKeyPresses (const CommandID commandID) throw() } } -void KeyPressMappingSet::removeKeyPress (const KeyPress& keypress) throw() +void KeyPressMappingSet::removeKeyPress (const KeyPress& keypress) { if (keypress.isValid()) { @@ -179,8 +179,7 @@ void KeyPressMappingSet::removeKeyPress (const KeyPress& keypress) throw() } } -void KeyPressMappingSet::removeKeyPress (const CommandID commandID, - const int keyPressIndex) throw() +void KeyPressMappingSet::removeKeyPress (const CommandID commandID, const int keyPressIndex) { for (int i = mappings.size(); --i >= 0;) { @@ -203,8 +202,7 @@ CommandID KeyPressMappingSet::findCommandForKeyPress (const KeyPress& keyPress) return 0; } -bool KeyPressMappingSet::containsMapping (const CommandID commandID, - const KeyPress& keyPress) const throw() +bool KeyPressMappingSet::containsMapping (const CommandID commandID, const KeyPress& keyPress) const throw() { for (int i = mappings.size(); --i >= 0;) if (mappings.getUnchecked(i)->commandID == commandID) diff --git a/src/gui/components/keyboard/juce_KeyPressMappingSet.h b/src/gui/components/keyboard/juce_KeyPressMappingSet.h index 99390c564d..1b5f311bb1 100644 --- a/src/gui/components/keyboard/juce_KeyPressMappingSet.h +++ b/src/gui/components/keyboard/juce_KeyPressMappingSet.h @@ -107,10 +107,10 @@ public: @see ApplicationCommandManager */ - explicit KeyPressMappingSet (ApplicationCommandManager* commandManager) throw(); + explicit KeyPressMappingSet (ApplicationCommandManager* commandManager); /** Creates an copy of a KeyPressMappingSet. */ - KeyPressMappingSet (const KeyPressMappingSet& other) throw(); + KeyPressMappingSet (const KeyPressMappingSet& other); /** Destructor. */ ~KeyPressMappingSet(); @@ -123,7 +123,7 @@ public: @param commandID the command's ID */ - const Array getKeyPressesAssignedToCommand (CommandID commandID) const throw(); + const Array getKeyPressesAssignedToCommand (CommandID commandID) const; /** Assigns a keypress to a command. @@ -140,41 +140,39 @@ public: */ void addKeyPress (CommandID commandID, const KeyPress& newKeyPress, - int insertIndex = -1) throw(); + int insertIndex = -1); /** Reset all mappings to the defaults, as dictated by the ApplicationCommandManager. @see resetToDefaultMapping */ - void resetToDefaultMappings() throw(); + void resetToDefaultMappings(); /** Resets all key-mappings to the defaults for a particular command. @see resetToDefaultMappings */ - void resetToDefaultMapping (CommandID commandID) throw(); + void resetToDefaultMapping (CommandID commandID); /** Removes all keypresses that are assigned to any commands. */ - void clearAllKeyPresses() throw(); + void clearAllKeyPresses(); /** Removes all keypresses that are assigned to a particular command. */ - void clearAllKeyPresses (CommandID commandID) throw(); + void clearAllKeyPresses (CommandID commandID); /** Removes one of the keypresses that are assigned to a command. See the getKeyPressesAssignedToCommand() for the list of keypresses to which the keyPressIndex refers. */ - void removeKeyPress (CommandID commandID, - int keyPressIndex) throw(); + void removeKeyPress (CommandID commandID, int keyPressIndex); /** Removes a keypress from any command that it may be assigned to. */ - void removeKeyPress (const KeyPress& keypress) throw(); + void removeKeyPress (const KeyPress& keypress); /** Returns true if the given command is linked to this key. */ - bool containsMapping (CommandID commandID, - const KeyPress& keyPress) const throw(); + bool containsMapping (CommandID commandID, const KeyPress& keyPress) const throw(); //============================================================================== /** Looks for a command that corresponds to a keypress. diff --git a/src/gui/components/keyboard/juce_KeyboardFocusTraverser.cpp b/src/gui/components/keyboard/juce_KeyboardFocusTraverser.cpp index bcd891b912..30496e58fe 100644 --- a/src/gui/components/keyboard/juce_KeyboardFocusTraverser.cpp +++ b/src/gui/components/keyboard/juce_KeyboardFocusTraverser.cpp @@ -50,7 +50,7 @@ namespace KeyboardFocusHelpers public: ScreenPositionComparator() {} - static int compareElements (const Component* const first, const Component* const second) throw() + static int compareElements (const Component* const first, const Component* const second) { int explicitOrder1 = first->getExplicitFocusOrder(); if (explicitOrder1 <= 0) @@ -100,7 +100,7 @@ namespace KeyboardFocusHelpers } } -static Component* getIncrementedComponent (Component* const current, const int delta) throw() +static Component* getIncrementedComponent (Component* const current, const int delta) { Component* focusContainer = current->getParentComponent(); diff --git a/src/gui/components/layout/juce_GroupComponent.cpp b/src/gui/components/layout/juce_GroupComponent.cpp index 62fbe2b8c7..6cfdd3784d 100644 --- a/src/gui/components/layout/juce_GroupComponent.cpp +++ b/src/gui/components/layout/juce_GroupComponent.cpp @@ -46,7 +46,7 @@ GroupComponent::~GroupComponent() } //============================================================================== -void GroupComponent::setText (const String& newText) throw() +void GroupComponent::setText (const String& newText) { if (text != newText) { @@ -55,7 +55,7 @@ void GroupComponent::setText (const String& newText) throw() } } -const String GroupComponent::getText() const throw() +const String GroupComponent::getText() const { return text; } diff --git a/src/gui/components/layout/juce_GroupComponent.h b/src/gui/components/layout/juce_GroupComponent.h index 48abe8a71e..ee3305bb5f 100644 --- a/src/gui/components/layout/juce_GroupComponent.h +++ b/src/gui/components/layout/juce_GroupComponent.h @@ -52,10 +52,10 @@ public: //============================================================================== /** Changes the text that's shown at the top of the component. */ - void setText (const String& newText) throw(); + void setText (const String& newText); /** Returns the currently displayed text label. */ - const String getText() const throw(); + const String getText() const; /** Sets the positioning of the text label. diff --git a/src/gui/components/layout/juce_ScrollBar.cpp b/src/gui/components/layout/juce_ScrollBar.cpp index d85fe2825a..25003f9ceb 100644 --- a/src/gui/components/layout/juce_ScrollBar.cpp +++ b/src/gui/components/layout/juce_ScrollBar.cpp @@ -38,8 +38,7 @@ class ScrollbarButton : public Button public: int direction; - ScrollbarButton (const int direction_, - ScrollBar& owner_) throw() + ScrollbarButton (const int direction_, ScrollBar& owner_) : Button (String::empty), direction (direction_), owner (owner_) @@ -51,9 +50,7 @@ public: { } - void paintButton (Graphics& g, - bool isMouseOver, - bool isMouseDown) + void paintButton (Graphics& g, bool isMouseOver, bool isMouseDown) { getLookAndFeel() .drawScrollbarButton (g, owner, @@ -82,10 +79,8 @@ private: //============================================================================== ScrollBar::ScrollBar (const bool vertical_, const bool buttonsAreVisible) - : minimum (0.0), - maximum (1.0), - rangeStart (0.0), - rangeSize (0.1), + : totalRange (0.0, 1.0), + visibleRange (0.0, 0.1), singleStepSize (0.1), thumbAreaStart (0), thumbAreaSize (0), @@ -112,68 +107,73 @@ ScrollBar::~ScrollBar() } //============================================================================== -void ScrollBar::setRangeLimits (const double newMinimum, - const double newMaximum) throw() +void ScrollBar::setRangeLimits (const Range& newRangeLimit) { - minimum = newMinimum; - maximum = newMaximum; - - jassert (maximum >= minimum); // these can't be the wrong way round! - - setCurrentRangeStart (rangeStart); - updateThumbPosition(); + if (totalRange != newRangeLimit) + { + totalRange = newRangeLimit; + setCurrentRange (visibleRange); + updateThumbPosition(); + } } -void ScrollBar::setCurrentRange (double newStart, - double newSize) throw() +void ScrollBar::setRangeLimits (const double newMinimum, const double newMaximum) { - newSize = jlimit (0.0, maximum - minimum, newSize); - newStart = jlimit (minimum, maximum - newSize, newStart); + jassert (newMaximum >= newMinimum); // these can't be the wrong way round! + setRangeLimits (Range (newMinimum, newMaximum)); +} - if (rangeStart != newStart - || rangeSize != newSize) +void ScrollBar::setCurrentRange (const Range& newRange) +{ + const Range constrainedRange (totalRange.constrainRange (newRange)); + + if (visibleRange != constrainedRange) { - rangeStart = newStart; - rangeSize = newSize; + visibleRange = constrainedRange; updateThumbPosition(); triggerAsyncUpdate(); } } -void ScrollBar::setCurrentRangeStart (double newStart) throw() +void ScrollBar::setCurrentRange (const double newStart, const double newSize) { - setCurrentRange (newStart, rangeSize); + setCurrentRange (Range (newStart, newStart + newSize)); } -void ScrollBar::setSingleStepSize (const double newSingleStepSize) throw() +void ScrollBar::setCurrentRangeStart (const double newStart) +{ + setCurrentRange (visibleRange.movedToStartAt (newStart)); +} + +void ScrollBar::setSingleStepSize (const double newSingleStepSize) { singleStepSize = newSingleStepSize; } -void ScrollBar::moveScrollbarInSteps (const int howManySteps) throw() +void ScrollBar::moveScrollbarInSteps (const int howManySteps) { - setCurrentRangeStart (rangeStart + howManySteps * singleStepSize); + setCurrentRange (visibleRange + howManySteps * singleStepSize); } -void ScrollBar::moveScrollbarInPages (const int howManyPages) throw() +void ScrollBar::moveScrollbarInPages (const int howManyPages) { - setCurrentRangeStart (rangeStart + howManyPages * rangeSize); + setCurrentRange (visibleRange + howManyPages * visibleRange.getLength()); } -void ScrollBar::scrollToTop() throw() +void ScrollBar::scrollToTop() { - setCurrentRangeStart (minimum); + setCurrentRange (visibleRange.movedToStartAt (getMinimumRangeLimit())); } -void ScrollBar::scrollToBottom() throw() +void ScrollBar::scrollToBottom() { - setCurrentRangeStart (maximum - rangeSize); + setCurrentRange (visibleRange.movedToEndAt (getMaximumRangeLimit())); } void ScrollBar::setButtonRepeatSpeed (const int initialDelayInMillisecs_, const int repeatDelayInMillisecs_, - const int minimumDelayInMillisecs_) throw() + const int minimumDelayInMillisecs_) { initialDelayInMillisecs = initialDelayInMillisecs_; repeatDelayInMillisecs = repeatDelayInMillisecs_; @@ -187,26 +187,26 @@ void ScrollBar::setButtonRepeatSpeed (const int initialDelayInMillisecs_, } //============================================================================== -void ScrollBar::addListener (ScrollBarListener* const listener) throw() +void ScrollBar::addListener (ScrollBarListener* const listener) { listeners.add (listener); } -void ScrollBar::removeListener (ScrollBarListener* const listener) throw() +void ScrollBar::removeListener (ScrollBarListener* const listener) { listeners.remove (listener); } void ScrollBar::handleAsyncUpdate() { - listeners.call (&ScrollBarListener::scrollBarMoved, this, rangeStart); + listeners.call (&ScrollBarListener::scrollBarMoved, this, visibleRange.getStart()); } //============================================================================== -void ScrollBar::updateThumbPosition() throw() +void ScrollBar::updateThumbPosition() { - int newThumbSize = roundToInt ((maximum > minimum) ? (rangeSize * thumbAreaSize) / (maximum - minimum) - : thumbAreaSize); + int newThumbSize = roundToInt (totalRange.getLength() > 0 ? (visibleRange.getLength() * thumbAreaSize) / totalRange.getLength() + : thumbAreaSize); if (newThumbSize < getLookAndFeel().getMinimumScrollbarThumbSize (*this)) newThumbSize = jmin (getLookAndFeel().getMinimumScrollbarThumbSize (*this), thumbAreaSize - 1); @@ -216,11 +216,11 @@ void ScrollBar::updateThumbPosition() throw() int newThumbStart = thumbAreaStart; - if (maximum - minimum > rangeSize) - newThumbStart += roundToInt (((rangeStart - minimum) * (thumbAreaSize - newThumbSize)) - / ((maximum - minimum) - rangeSize)); + if (totalRange.getLength() > visibleRange.getLength()) + newThumbStart += roundToInt (((visibleRange.getStart() - totalRange.getStart()) * (thumbAreaSize - newThumbSize)) + / (totalRange.getLength() - visibleRange.getLength())); - setVisible (alwaysVisible || (maximum - minimum > rangeSize && rangeSize > 0.0)); + setVisible (alwaysVisible || (totalRange.getLength() > visibleRange.getLength() && visibleRange.getLength() > 0.0)); if (thumbStart != newThumbStart || thumbSize != newThumbSize) { @@ -237,7 +237,7 @@ void ScrollBar::updateThumbPosition() throw() } } -void ScrollBar::setOrientation (const bool shouldBeVertical) throw() +void ScrollBar::setOrientation (const bool shouldBeVertical) { if (vertical != shouldBeVertical) { @@ -351,7 +351,7 @@ void ScrollBar::mouseDown (const MouseEvent& e) isDraggingThumb = false; lastMousePos = vertical ? e.y : e.x; dragStartMousePos = lastMousePos; - dragStartRange = rangeStart; + dragStartRange = visibleRange.getStart(); if (dragStartMousePos < thumbStart) { @@ -377,7 +377,7 @@ void ScrollBar::mouseDrag (const MouseEvent& e) const int deltaPixels = ((vertical) ? e.y : e.x) - dragStartMousePos; setCurrentRangeStart (dragStartRange - + deltaPixels * ((maximum - minimum) - rangeSize) + + deltaPixels * (totalRange.getLength() - visibleRange.getLength()) / (thumbAreaSize - thumbSize)); } else @@ -404,7 +404,7 @@ void ScrollBar::mouseWheelMove (const MouseEvent&, else if (increment > 0) increment = jmax (increment * 10.0f, 1.0f); - setCurrentRangeStart (rangeStart - singleStepSize * increment); + setCurrentRange (visibleRange - singleStepSize * increment); } void ScrollBar::timerCallback() @@ -414,9 +414,9 @@ void ScrollBar::timerCallback() startTimer (40); if (lastMousePos < thumbStart) - setCurrentRangeStart (rangeStart - rangeSize); + setCurrentRange (visibleRange - visibleRange.getLength()); else if (lastMousePos > thumbStart + thumbSize) - setCurrentRangeStart (rangeStart + rangeSize); + setCurrentRangeStart (visibleRange.getEnd()); } else { diff --git a/src/gui/components/layout/juce_ScrollBar.h b/src/gui/components/layout/juce_ScrollBar.h index 1171bc5355..4c26445f34 100644 --- a/src/gui/components/layout/juce_ScrollBar.h +++ b/src/gui/components/layout/juce_ScrollBar.h @@ -27,6 +27,7 @@ #define __JUCE_SCROLLBAR_JUCEHEADER__ #include "../../../events/juce_AsyncUpdater.h" +#include "../../../containers/juce_Range.h" #include "../../../events/juce_Timer.h" #include "../buttons/juce_Button.h" class ScrollBar; @@ -105,7 +106,7 @@ public: @param shouldBeVertical true makes it vertical; false makes it horizontal. */ - void setOrientation (bool shouldBeVertical) throw(); + void setOrientation (bool shouldBeVertical); /** Shows or hides the scrollbar's buttons. */ void setButtonVisibility (bool buttonsAreVisible); @@ -121,27 +122,50 @@ public: //============================================================================== /** Sets the minimum and maximum values that the bar will move between. - The bar's thumb will always be constrained so that the top of the thumb - will be >= minimum, and the bottom of the thumb <= maximum. + The bar's thumb will always be constrained so that the entire thumb lies + within this range. @see setCurrentRange */ - void setRangeLimits (double minimum, - double maximum) throw(); + void setRangeLimits (const Range& newRangeLimit); + + /** Sets the minimum and maximum values that the bar will move between. + + The bar's thumb will always be constrained so that the entire thumb lies + within this range. + + @see setCurrentRange + */ + void setRangeLimits (double minimum, double maximum); + + /** Returns the current limits on the thumb position. + @see setRangeLimits + */ + const Range getRangeLimit() const throw() { return totalRange; } /** Returns the lower value that the thumb can be set to. This is the value set by setRangeLimits(). */ - double getMinimumRangeLimit() const throw() { return minimum; } + double getMinimumRangeLimit() const throw() { return totalRange.getStart(); } /** Returns the upper value that the thumb can be set to. This is the value set by setRangeLimits(). */ - double getMaximumRangeLimit() const throw() { return maximum; } + double getMaximumRangeLimit() const throw() { return totalRange.getEnd(); } //============================================================================== + /** Changes the position of the scrollbar's 'thumb'. + + If this method call actually changes the scrollbar's position, it will trigger an + asynchronous call to ScrollBarListener::scrollBarMoved() for all the listeners that + are registered. + + @see getCurrentRange. setCurrentRangeStart + */ + void setCurrentRange (const Range& newRange); + /** Changes the position of the scrollbar's 'thumb'. This sets both the position and size of the thumb - to just set the position without @@ -159,8 +183,7 @@ public: size is beyond these limits, it will be clipped. @see setCurrentRangeStart, getCurrentRangeStart, getCurrentRangeSize */ - void setCurrentRange (double newStart, - double newSize) throw(); + void setCurrentRange (double newStart, double newSize); /** Moves the bar's thumb position. @@ -173,19 +196,22 @@ public: @see setCurrentRange */ - void setCurrentRangeStart (double newStart) throw(); + void setCurrentRangeStart (double newStart); + + /** Returns the current thumb range. + @see getCurrentRange, setCurrentRange + */ + const Range getCurrentRange() const throw() { return visibleRange; } /** Returns the position of the top of the thumb. - - @see setCurrentRangeStart + @see getCurrentRange, setCurrentRangeStart */ - double getCurrentRangeStart() const throw() { return rangeStart; } + double getCurrentRangeStart() const throw() { return visibleRange.getStart(); } /** Returns the current size of the thumb. - - @see setCurrentRange + @see getCurrentRange, setCurrentRange */ - double getCurrentRangeSize() const throw() { return rangeSize; } + double getCurrentRangeSize() const throw() { return visibleRange.getLength(); } //============================================================================== /** Sets the amount by which the up and down buttons will move the bar. @@ -193,7 +219,7 @@ public: The value here is in terms of the total range, and is added or subtracted from the thumb position when the user clicks an up/down (or left/right) button. */ - void setSingleStepSize (double newSingleStepSize) throw(); + void setSingleStepSize (double newSingleStepSize); /** Moves the scrollbar by a number of single-steps. @@ -203,7 +229,7 @@ public: A positive value here will move the bar down or to the right, a negative value moves it up or to the left. */ - void moveScrollbarInSteps (int howManySteps) throw(); + void moveScrollbarInSteps (int howManySteps); /** Moves the scroll bar up or down in pages. @@ -213,19 +239,19 @@ public: A positive value here will move the bar down or to the right, a negative value moves it up or to the left. */ - void moveScrollbarInPages (int howManyPages) throw(); + void moveScrollbarInPages (int howManyPages); /** Scrolls to the top (or left). This is the same as calling setCurrentRangeStart (getMinimumRangeLimit()); */ - void scrollToTop() throw(); + void scrollToTop(); /** Scrolls to the bottom (or right). This is the same as calling setCurrentRangeStart (getMaximumRangeLimit() - getCurrentRangeSize()); */ - void scrollToBottom() throw(); + void scrollToBottom(); /** Changes the delay before the up and down buttons autorepeat when they are held down. @@ -236,7 +262,7 @@ public: */ void setButtonRepeatSpeed (int initialDelayInMillisecs, int repeatDelayInMillisecs, - int minimumDelayInMillisecs = -1) throw(); + int minimumDelayInMillisecs = -1); //============================================================================== /** A set of colour IDs to use to change the colour of various aspects of the component. @@ -255,10 +281,10 @@ public: //============================================================================== /** Registers a listener that will be called when the scrollbar is moved. */ - void addListener (ScrollBarListener* listener) throw(); + void addListener (ScrollBarListener* listener); /** Deregisters a previously-registered listener. */ - void removeListener (ScrollBarListener* listener) throw(); + void removeListener (ScrollBarListener* listener); //============================================================================== /** @internal */ @@ -284,8 +310,7 @@ public: private: //============================================================================== - double minimum, maximum; - double rangeStart, rangeSize; + Range totalRange, visibleRange; double singleStepSize, dragStartRange; int thumbAreaStart, thumbAreaSize, thumbStart, thumbSize; int dragStartMousePos, lastMousePos; @@ -295,7 +320,7 @@ private: Button* downButton; ListenerList listeners; - void updateThumbPosition() throw(); + void updateThumbPosition(); void timerCallback(); ScrollBar (const ScrollBar&); diff --git a/src/native/linux/juce_linux_Windowing.cpp b/src/native/linux/juce_linux_Windowing.cpp index 60fb0679db..c0bd2bbbd4 100644 --- a/src/native/linux/juce_linux_Windowing.cpp +++ b/src/native/linux/juce_linux_Windowing.cpp @@ -119,7 +119,7 @@ namespace Keys static const int extendedKeyModifier = 0x10000000; } -bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() +bool KeyPress::isKeyCurrentlyDown (const int keyCode) { int keysym; diff --git a/src/native/mac/juce_iphone_UIViewComponentPeer.mm b/src/native/mac/juce_iphone_UIViewComponentPeer.mm index 0b66656d57..3d7679f5bc 100644 --- a/src/native/mac/juce_iphone_UIViewComponentPeer.mm +++ b/src/native/mac/juce_iphone_UIViewComponentPeer.mm @@ -192,7 +192,7 @@ END_JUCE_NAMESPACE } //============================================================================== -bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() +bool KeyPress::isKeyCurrentlyDown (const int keyCode) { return false; } diff --git a/src/native/mac/juce_mac_NSViewComponentPeer.mm b/src/native/mac/juce_mac_NSViewComponentPeer.mm index 8fc09fcb8c..f1979fc09d 100644 --- a/src/native/mac/juce_mac_NSViewComponentPeer.mm +++ b/src/native/mac/juce_mac_NSViewComponentPeer.mm @@ -758,7 +758,7 @@ ComponentPeer* NSViewComponentPeer::currentlyFocusedPeer = 0; VoidArray NSViewComponentPeer::keysCurrentlyDown; //============================================================================== -bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() +bool KeyPress::isKeyCurrentlyDown (const int keyCode) { if (NSViewComponentPeer::keysCurrentlyDown.contains ((void*) keyCode)) return true; diff --git a/src/native/windows/juce_win32_Windowing.cpp b/src/native/windows/juce_win32_Windowing.cpp index 4fa6a2c2ab..207d7cf1ef 100644 --- a/src/native/windows/juce_win32_Windowing.cpp +++ b/src/native/windows/juce_win32_Windowing.cpp @@ -330,7 +330,7 @@ long improbableWindowNumber = 0xf965aa01; // also referenced by messaging.cpp //============================================================================== -bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() +bool KeyPress::isKeyCurrentlyDown (const int keyCode) { SHORT k = (SHORT) keyCode;