Documentation
¶
Index ¶
- type ScrollBar
- func (s *ScrollBar) BackgroundInk() draw.Ink
- func (s *ScrollBar) BarSize() float64
- func (s *ScrollBar) DefaultDraw(gc draw.Context, dirty geom.Rect, inLiveResize bool)
- func (s *ScrollBar) DefaultMouseDown(where geom.Point, button, clickCount int, mod keys.Modifiers) bool
- func (s *ScrollBar) DefaultMouseDrag(where geom.Point, button int, mod keys.Modifiers)
- func (s *ScrollBar) DefaultMouseUp(where geom.Point, button int, mod keys.Modifiers)
- func (s *ScrollBar) DefaultSizes(hint geom.Size) (min, pref, max geom.Size)
- func (s *ScrollBar) DisabledMarkInk() draw.Ink
- func (s *ScrollBar) EdgeInk() draw.Ink
- func (s *ScrollBar) FocusedBackgroundInk() draw.Ink
- func (s *ScrollBar) InitialRepeatDelay() time.Duration
- func (s *ScrollBar) MarkInk() draw.Ink
- func (s *ScrollBar) PressedBackgroundInk() draw.Ink
- func (s *ScrollBar) RepeatDelay() time.Duration
- func (s *ScrollBar) SetBackgroundInk(value draw.Ink) *ScrollBar
- func (s *ScrollBar) SetBarSize(value float64) *ScrollBar
- func (s *ScrollBar) SetBorder(value border.Border) *ScrollBar
- func (s *ScrollBar) SetDisabledMarkInk(value draw.Ink) *ScrollBar
- func (s *ScrollBar) SetEdgeInk(value draw.Ink) *ScrollBar
- func (s *ScrollBar) SetEnabled(enabled bool) *ScrollBar
- func (s *ScrollBar) SetFocusable(focusable bool) *ScrollBar
- func (s *ScrollBar) SetFocusedBackgroundInk(value draw.Ink) *ScrollBar
- func (s *ScrollBar) SetInitialRepeatDelay(value time.Duration) *ScrollBar
- func (s *ScrollBar) SetMarkInk(value draw.Ink) *ScrollBar
- func (s *ScrollBar) SetPressedBackgroundInk(value draw.Ink) *ScrollBar
- func (s *ScrollBar) SetRepeatDelay(value time.Duration) *ScrollBar
- func (s *ScrollBar) SetScrolledPosition(position float64)
- func (s *ScrollBar) SetTarget(target Scrollable) *ScrollBar
- func (s *ScrollBar) Target() Scrollable
- type ScrollPager
- type Scrollable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScrollBar ¶
ScrollBar is a widget that controls scrolling.
func NewHorizontal ¶
func NewHorizontal() *ScrollBar
NewHorizontal creates a new horizontal scrollbar.
func (*ScrollBar) BackgroundInk ¶
BackgroundInk returns the ink that will be used for the background when enabled but not pressed or focused.
func (*ScrollBar) BarSize ¶
BarSize returns the height of a horizontal scrollbar or the width of a vertical scrollbar.
func (*ScrollBar) DefaultDraw ¶
DefaultDraw provides the default drawing.
func (*ScrollBar) DefaultMouseDown ¶
func (s *ScrollBar) DefaultMouseDown(where geom.Point, button, clickCount int, mod keys.Modifiers) bool
DefaultMouseDown provides the default mouse down handling.
func (*ScrollBar) DefaultMouseDrag ¶
DefaultMouseDrag provides the default mouse drag handling.
func (*ScrollBar) DefaultMouseUp ¶
DefaultMouseUp provides the default mouse up handling.
func (*ScrollBar) DefaultSizes ¶
DefaultSizes provides the default sizing.
func (*ScrollBar) DisabledMarkInk ¶
DisabledMarkInk returns the ink that will be used for control marks when disabled.
func (*ScrollBar) FocusedBackgroundInk ¶
FocusedBackgroundInk returns the ink that will be used for the background when enabled and focused.
func (*ScrollBar) InitialRepeatDelay ¶
InitialRepeatDelay returns the amount of time to wait before triggering the first repeating event.
func (*ScrollBar) MarkInk ¶
MarkInk returns the ink that will be used for control marks when enabled.
func (*ScrollBar) PressedBackgroundInk ¶
PressedBackgroundInk returns the ink that will be used for the background when enabled and pressed.
func (*ScrollBar) RepeatDelay ¶
RepeatDelay returns the amount of time to wait before triggering a repeating event.
func (*ScrollBar) SetBackgroundInk ¶
SetBackgroundInk sets the ink that will be used for the background when enabled but not pressed or focused. Pass in nil to use the default.
func (*ScrollBar) SetBarSize ¶
SetBarSize sets the height of a horizontal scrollbar or the width of a vertical scrollbar.
func (*ScrollBar) SetDisabledMarkInk ¶
SetDisabledMarkInk sets the ink that will be used for control marks when disabled. Pass in nil to use the default.
func (*ScrollBar) SetEdgeInk ¶
SetEdgeInk sets the ink that will be used for the edges. Pass in nil to use the default.
func (*ScrollBar) SetEnabled ¶
SetEnabled sets enabled state.
func (*ScrollBar) SetFocusable ¶
SetFocusable whether it can have the keyboard focus.
func (*ScrollBar) SetFocusedBackgroundInk ¶
SetFocusedBackgroundInk sets the ink that will be used for the background when enabled and focused. Pass in nil to use the default.
func (*ScrollBar) SetInitialRepeatDelay ¶
SetInitialRepeatDelay sets the amount of time to wait before triggering the first repeating event.
func (*ScrollBar) SetMarkInk ¶
SetMarkInk sets the ink that will be used for control marks when enabled. Pass in nil to use the default.
func (*ScrollBar) SetPressedBackgroundInk ¶
SetPressedBackgroundInk sets the ink that will be used for the background when enabled and pressed. Pass in nil to use the default.
func (*ScrollBar) SetRepeatDelay ¶
SetRepeatDelay sets the amount of time to wait before triggering a repeating event.
func (*ScrollBar) SetScrolledPosition ¶
SetScrolledPosition attempts to set the current scrolled position of this ScrollBar to the specified value. The value will be clipped to the available range. If no target has been set, then nothing will happen.
func (*ScrollBar) SetTarget ¶
func (s *ScrollBar) SetTarget(target Scrollable) *ScrollBar
SetTarget sets the scrollable target. May be nil.
func (*ScrollBar) Target ¶
func (s *ScrollBar) Target() Scrollable
Target returns the scrollable target. May be nil.
type ScrollPager ¶
type ScrollPager interface { // ScrollAmount is called to determine how far to scroll in the given // direction. 'page' is true if the desire is to reveal a full page of // content, or false to reveal a full line of content. A positive value // should be returned regardless of the direction, although negative // values will behave as if they were positive. ScrollAmount(horizontal, towardsStart, page bool) float64 }
ScrollPager objects can provide line and page information for scrolling.
type Scrollable ¶
type Scrollable interface { ScrollPager // ScrolledPosition is called to determine the current position of the // Scrollable. ScrolledPosition(horizontal bool) float64 // SetScrolledPosition is called to set the current position of the // Scrollable. SetScrolledPosition(horizontal bool, position float64) // VisibleSize is called to determine the size of the visible portion of // the Scrollable. VisibleSize(horizontal bool) float64 // ContentSize is called to determine the total size of the Scrollable. ContentSize(horizontal bool) float64 }
Scrollable objects can respond to ScrollBars.