|
ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
|
A visible, draggable vertical scrollbar, owned by a ScrollView. More...
#include <ObjectivelyMVC/Control.h>#include <ObjectivelyMVC/View.h>#include <ObjectivelyMVC/ScrollHandle.h>Go to the source code of this file.
Data Structures | |
| struct | ScrollBar |
| A draggable scrollbar, owned by a ScrollView. More... | |
Enumerations | |
| enum | ScrollBarVisibility { ScrollBarHide , ScrollBarShow , ScrollBarAuto } |
| Governs whether a ScrollView's ScrollBar is shown. More... | |
Functions | |
| OBJECTIVELYMVC_EXPORT Class * | _ScrollBar (void) |
Variables | |
| OBJECTIVELYMVC_EXPORT const EnumName | ScrollBarVisibilityNames [] |
String <-> ScrollBarVisibility mapping for the scrollbar attribute. | |
A visible, draggable vertical scrollbar, owned by a ScrollView.
ScrollBar is a hideable subview a ScrollView owns internally (see ScrollView::setShowsScrollBar / the scrollbar style attribute) – it is not meant to be instantiated directly by consumers. No arrows (matches modern conventions, e.g. macOS/Xcode's own overlay scrollbars): ScrollBar itself IS the track (clips its own subviews, fills the whole bar), and clicking it above or below the handle pages the content by one viewport's worth in that direction.
Anatomy (AppKit-inspired: NSScroller's knob / knob slot):
ScrollBar (bar base + track, vertical View) `– handle the ScrollHandle grabby-widget
The handle's size tracks the visible/content ratio and its position tracks the ScrollView's contentOffset; dragging the handle scrolls the content. Anything that changes either just flags needsLayout – ScrollBar's own layoutSubviews is what actually repositions/resizes the handle.
Styling is plain View attributes, set in the stylesheet like any other View – no ScrollBar-specific CSS at all: width/background-color on ScrollBar for the bar/track, and background-color/min-height on ScrollBar > .handle for the handle and its minimum size.
Definition in file ScrollBar.h.
| enum ScrollBarVisibility |
Governs whether a ScrollView's ScrollBar is shown.
| Enumerator | |
|---|---|
| ScrollBarHide | |
| ScrollBarShow | |
| ScrollBarAuto | |
Definition at line 67 of file ScrollBar.h.
| OBJECTIVELYMVC_EXPORT Class * _ScrollBar | ( | void | ) |
Definition at line 225 of file ScrollBar.c.
| OBJECTIVELYMVC_EXPORT const EnumName ScrollBarVisibilityNames[] |
String <-> ScrollBarVisibility mapping for the scrollbar attribute.
Definition at line 76 of file ScrollBar.h.