76 void setViewedComponent (
Component* newViewedComponent,
77 bool deleteComponentWhenNoLongerNeeded =
true);
96 void setViewPosition (
int xPixelsOffset,
int yPixelsOffset);
108 void setViewPosition (
Point<int> newPosition);
117 void setViewPositionProportionately (
double proportionX,
double proportionY);
134 bool autoScroll (
int mouseX,
int mouseY,
int distanceFromEdge,
int maximumSpeed);
157 int getViewWidth() const noexcept {
return lastVisibleArea.getWidth(); }
171 int getMaximumVisibleWidth()
const;
178 int getMaximumVisibleHeight()
const;
186 virtual void visibleAreaChanged (
const Rectangle<int>& newVisibleArea);
189 virtual void viewedComponentChanged (
Component* newComponent);
201 void setScrollBarsShown (
bool showVerticalScrollbarIfNeeded,
202 bool showHorizontalScrollbarIfNeeded,
203 bool allowVerticalScrollingWithoutScrollbar =
false,
204 bool allowHorizontalScrollingWithoutScrollbar =
false);
216 void setScrollBarPosition (
bool verticalScrollbarOnRight,
217 bool horizontalScrollbarAtBottom);
239 void setScrollBarThickness (
int thickness);
244 int getScrollBarThickness()
const;
249 void setSingleStepSizes (
int stepX,
int stepY);
262 void recreateScrollbars();
267 bool canScrollVertically() const noexcept;
272 bool canScrollHorizontally() const noexcept;
280 [[deprecated ("Use setScrollOnDragMode instead.")]]
281 void setScrollOnDragEnabled (
bool shouldScrollOnDrag)
283 setScrollOnDragMode (shouldScrollOnDrag ? ScrollOnDragMode::all : ScrollOnDragMode::never);
287 [[deprecated (
"Use getScrollOnDragMode instead.")]]
303 void setScrollOnDragMode (ScrollOnDragMode scrollOnDragMode);
311 bool isCurrentlyScrollingOnDrag() const noexcept;
315 void resized() override;
317 void scrollBarMoved (
ScrollBar*,
double newRangeStart) override;
321 void mouseDown (const
MouseEvent& e) override;
323 bool keyPressed (const
KeyPress&) override;
325 void componentMovedOrResized (
Component&,
bool wasMoved,
bool wasResized) override;
327 void lookAndFeelChanged() override;
331 static
bool respondsToKey (const
KeyPress&);
338 virtual
ScrollBar* createScrollBarComponent (
bool isVertical);
342 class AccessibilityIgnoredComponent : public
Component
349 AccessibilityIgnoredComponent contentHolder;
350 WeakReference<Component> contentComp;
351 Rectangle<int> lastVisibleArea;
352 int scrollBarThickness = 0;
353 int singleStepX = 16, singleStepY = 16;
354 ScrollOnDragMode scrollOnDragMode = ScrollOnDragMode::nonHover;
355 bool showHScrollbar =
true, showVScrollbar =
true, deleteContent =
true;
356 bool customScrollBarThickness =
false;
357 bool allowScrollingWithoutScrollbarV =
false, allowScrollingWithoutScrollbarH =
false;
358 bool vScrollbarRight =
true, hScrollbarBottom =
true;
360 struct DragToScrollListener;
363 Point<int> viewportPosToCompPos (Point<int>)
const;
365 void updateVisibleArea();
366 void deleteOrRemoveContentComp();
Gets informed about changes to a component's hierarchy or position.
The base class for all JUCE user-interface objects.
Represents a key press, including any modifier keys that are needed.
Contains position and status information about a mouse event.
A pair of (x, y) coordinates.
Manages a rectangle and allows geometric operations to be performed on it.
A Viewport is used to contain a larger child component, and allows the child to be automatically scro...
bool isHorizontalScrollbarAtBottom() const noexcept
True if the horizontal scrollbar will appear at the bottom of the content.
int getViewWidth() const noexcept
Returns the width of the visible area of the child component.
Component * getViewedComponent() const noexcept
Returns the component that's currently being used inside the Viewport.
bool isVerticalScrollbarOnTheRight() const noexcept
True if the vertical scrollbar will appear on the right side of the content.
int getViewPositionX() const noexcept
Returns the position within the child component of the top-left of its visible area.
ScrollBar & getVerticalScrollBar() noexcept
Returns a reference to the scrollbar component being used.
ScrollOnDragMode getScrollOnDragMode() const
Returns the current scroll-on-drag mode.
Point< int > getViewPosition() const noexcept
Returns the position within the child component of the top-left of its visible area.
int getViewHeight() const noexcept
Returns the height of the visible area of the child component.
ScrollBar & getHorizontalScrollBar() noexcept
Returns a reference to the scrollbar component being used.
bool isHorizontalScrollBarShown() const noexcept
True if the horizontal scrollbar is enabled.
Rectangle< int > getViewArea() const noexcept
Returns the visible area of the child component, relative to its top-left.
int getViewPositionY() const noexcept
Returns the position within the child component of the top-left of its visible area.
bool isVerticalScrollBarShown() const noexcept
True if the vertical scrollbar is enabled.
bool isScrollOnDragEnabled() const noexcept
Returns true if drag-to-scroll functionality is enabled for mouse input sources.
Contains status information about a mouse wheel event.