diff --git a/modules/juce_gui_basics/layout/juce_ScrollBar.cpp b/modules/juce_gui_basics/layout/juce_ScrollBar.cpp index b6e697c808..4e4866b42b 100644 --- a/modules/juce_gui_basics/layout/juce_ScrollBar.cpp +++ b/modules/juce_gui_basics/layout/juce_ScrollBar.cpp @@ -79,20 +79,20 @@ ScrollBar::~ScrollBar() } //============================================================================== -void ScrollBar::setRangeLimits (const Range& newRangeLimit) +void ScrollBar::setRangeLimits (const Range& newRangeLimit, NotificationType notification) { if (totalRange != newRangeLimit) { totalRange = newRangeLimit; - setCurrentRange (visibleRange); + setCurrentRange (visibleRange, notification); updateThumbPosition(); } } -void ScrollBar::setRangeLimits (const double newMinimum, const double newMaximum) +void ScrollBar::setRangeLimits (const double newMinimum, const double newMaximum, NotificationType notification) { jassert (newMaximum >= newMinimum); // these can't be the wrong way round! - setRangeLimits (Range (newMinimum, newMaximum)); + setRangeLimits (Range (newMinimum, newMaximum), notification); } bool ScrollBar::setCurrentRange (const Range& newRange, @@ -118,14 +118,14 @@ bool ScrollBar::setCurrentRange (const Range& newRange, return false; } -void ScrollBar::setCurrentRange (const double newStart, const double newSize) +void ScrollBar::setCurrentRange (const double newStart, const double newSize, NotificationType notification) { - setCurrentRange (Range (newStart, newStart + newSize)); + setCurrentRange (Range (newStart, newStart + newSize), notification); } -void ScrollBar::setCurrentRangeStart (const double newStart) +void ScrollBar::setCurrentRangeStart (const double newStart, NotificationType notification) { - setCurrentRange (visibleRange.movedToStartAt (newStart)); + setCurrentRange (visibleRange.movedToStartAt (newStart), notification); } void ScrollBar::setSingleStepSize (const double newSingleStepSize) noexcept @@ -133,24 +133,24 @@ void ScrollBar::setSingleStepSize (const double newSingleStepSize) noexcept singleStepSize = newSingleStepSize; } -bool ScrollBar::moveScrollbarInSteps (const int howManySteps) +bool ScrollBar::moveScrollbarInSteps (const int howManySteps, NotificationType notification) { - return setCurrentRange (visibleRange + howManySteps * singleStepSize); + return setCurrentRange (visibleRange + howManySteps * singleStepSize, notification); } -bool ScrollBar::moveScrollbarInPages (const int howManyPages) +bool ScrollBar::moveScrollbarInPages (const int howManyPages, NotificationType notification) { - return setCurrentRange (visibleRange + howManyPages * visibleRange.getLength()); + return setCurrentRange (visibleRange + howManyPages * visibleRange.getLength(), notification); } -bool ScrollBar::scrollToTop() +bool ScrollBar::scrollToTop (NotificationType notification) { - return setCurrentRange (visibleRange.movedToStartAt (getMinimumRangeLimit())); + return setCurrentRange (visibleRange.movedToStartAt (getMinimumRangeLimit()), notification); } -bool ScrollBar::scrollToBottom() +bool ScrollBar::scrollToBottom (NotificationType notification) { - return setCurrentRange (visibleRange.movedToEndAt (getMaximumRangeLimit())); + return setCurrentRange (visibleRange.movedToEndAt (getMaximumRangeLimit()), notification); } void ScrollBar::setButtonRepeatSpeed (const int initialDelayInMillisecs_, diff --git a/modules/juce_gui_basics/layout/juce_ScrollBar.h b/modules/juce_gui_basics/layout/juce_ScrollBar.h index 0309a9de94..48a8071618 100644 --- a/modules/juce_gui_basics/layout/juce_ScrollBar.h +++ b/modules/juce_gui_basics/layout/juce_ScrollBar.h @@ -99,7 +99,8 @@ public: @see setCurrentRange */ - void setRangeLimits (const Range& newRangeLimit); + void setRangeLimits (const Range& newRangeLimit, + NotificationType notification = sendNotificationAsync); /** Sets the minimum and maximum values that the bar will move between. @@ -108,7 +109,8 @@ public: @see setCurrentRange */ - void setRangeLimits (double minimum, double maximum); + void setRangeLimits (double minimum, double maximum, + NotificationType notification = sendNotificationAsync); /** Returns the current limits on the thumb position. @see setRangeLimits @@ -163,7 +165,8 @@ public: size is beyond these limits, it will be clipped. @see setCurrentRangeStart, getCurrentRangeStart, getCurrentRangeSize */ - void setCurrentRange (double newStart, double newSize); + void setCurrentRange (double newStart, double newSize, + NotificationType notification = sendNotificationAsync); /** Moves the bar's thumb position. @@ -176,7 +179,8 @@ public: @see setCurrentRange */ - void setCurrentRangeStart (double newStart); + void setCurrentRangeStart (double newStart, + NotificationType notification = sendNotificationAsync); /** Returns the current thumb range. @see getCurrentRange, setCurrentRange @@ -210,7 +214,8 @@ public: value moves it up or to the left. @returns true if the scrollbar's position actually changed. */ - bool moveScrollbarInSteps (int howManySteps); + bool moveScrollbarInSteps (int howManySteps, + NotificationType notification = sendNotificationAsync); /** Moves the scroll bar up or down in pages. @@ -221,19 +226,20 @@ public: value moves it up or to the left. @returns true if the scrollbar's position actually changed. */ - bool moveScrollbarInPages (int howManyPages); + bool moveScrollbarInPages (int howManyPages, + NotificationType notification = sendNotificationAsync); /** Scrolls to the top (or left). This is the same as calling setCurrentRangeStart (getMinimumRangeLimit()); @returns true if the scrollbar's position actually changed. */ - bool scrollToTop(); + bool scrollToTop (NotificationType notification = sendNotificationAsync); /** Scrolls to the bottom (or right). This is the same as calling setCurrentRangeStart (getMaximumRangeLimit() - getCurrentRangeSize()); @returns true if the scrollbar's position actually changed. */ - bool scrollToBottom(); + bool scrollToBottom (NotificationType notification = sendNotificationAsync); /** Changes the delay before the up and down buttons autorepeat when they are held down.