scrollbar

package
v0.0.0-...-955f326 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2020 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScrollBar

type ScrollBar struct {
	ux.Panel
	// contains filtered or unexported fields
}

ScrollBar is a widget that controls scrolling.

func New

func New(horizontal bool) *ScrollBar

New creates a new scrollbar.

func NewHorizontal

func NewHorizontal() *ScrollBar

NewHorizontal creates a new horizontal scrollbar.

func NewVertical

func NewVertical() *ScrollBar

NewVertical creates a new vertical scrollbar.

func (*ScrollBar) BackgroundInk

func (s *ScrollBar) BackgroundInk() draw.Ink

BackgroundInk returns the ink that will be used for the background when enabled but not pressed or focused.

func (*ScrollBar) BarSize

func (s *ScrollBar) BarSize() float64

BarSize returns the height of a horizontal scrollbar or the width of a vertical scrollbar.

func (*ScrollBar) DefaultDraw

func (s *ScrollBar) DefaultDraw(gc draw.Context, dirty geom.Rect, inLiveResize bool)

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

func (s *ScrollBar) DefaultMouseDrag(where geom.Point, button int, mod keys.Modifiers)

DefaultMouseDrag provides the default mouse drag handling.

func (*ScrollBar) DefaultMouseUp

func (s *ScrollBar) DefaultMouseUp(where geom.Point, button int, mod keys.Modifiers)

DefaultMouseUp provides the default mouse up handling.

func (*ScrollBar) DefaultSizes

func (s *ScrollBar) DefaultSizes(hint geom.Size) (min, pref, max geom.Size)

DefaultSizes provides the default sizing.

func (*ScrollBar) DisabledMarkInk

func (s *ScrollBar) DisabledMarkInk() draw.Ink

DisabledMarkInk returns the ink that will be used for control marks when disabled.

func (*ScrollBar) EdgeInk

func (s *ScrollBar) EdgeInk() draw.Ink

EdgeInk returns the ink that will be used for the edges.

func (*ScrollBar) FocusedBackgroundInk

func (s *ScrollBar) FocusedBackgroundInk() draw.Ink

FocusedBackgroundInk returns the ink that will be used for the background when enabled and focused.

func (*ScrollBar) InitialRepeatDelay

func (s *ScrollBar) InitialRepeatDelay() time.Duration

InitialRepeatDelay returns the amount of time to wait before triggering the first repeating event.

func (*ScrollBar) MarkInk

func (s *ScrollBar) MarkInk() draw.Ink

MarkInk returns the ink that will be used for control marks when enabled.

func (*ScrollBar) PressedBackgroundInk

func (s *ScrollBar) PressedBackgroundInk() draw.Ink

PressedBackgroundInk returns the ink that will be used for the background when enabled and pressed.

func (*ScrollBar) RepeatDelay

func (s *ScrollBar) RepeatDelay() time.Duration

RepeatDelay returns the amount of time to wait before triggering a repeating event.

func (*ScrollBar) SetBackgroundInk

func (s *ScrollBar) SetBackgroundInk(value draw.Ink) *ScrollBar

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

func (s *ScrollBar) SetBarSize(value float64) *ScrollBar

SetBarSize sets the height of a horizontal scrollbar or the width of a vertical scrollbar.

func (*ScrollBar) SetBorder

func (s *ScrollBar) SetBorder(value border.Border) *ScrollBar

SetBorder sets the border. May be nil.

func (*ScrollBar) SetDisabledMarkInk

func (s *ScrollBar) SetDisabledMarkInk(value draw.Ink) *ScrollBar

SetDisabledMarkInk sets the ink that will be used for control marks when disabled. Pass in nil to use the default.

func (*ScrollBar) SetEdgeInk

func (s *ScrollBar) SetEdgeInk(value draw.Ink) *ScrollBar

SetEdgeInk sets the ink that will be used for the edges. Pass in nil to use the default.

func (*ScrollBar) SetEnabled

func (s *ScrollBar) SetEnabled(enabled bool) *ScrollBar

SetEnabled sets enabled state.

func (*ScrollBar) SetFocusable

func (s *ScrollBar) SetFocusable(focusable bool) *ScrollBar

SetFocusable whether it can have the keyboard focus.

func (*ScrollBar) SetFocusedBackgroundInk

func (s *ScrollBar) SetFocusedBackgroundInk(value draw.Ink) *ScrollBar

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

func (s *ScrollBar) SetInitialRepeatDelay(value time.Duration) *ScrollBar

SetInitialRepeatDelay sets the amount of time to wait before triggering the first repeating event.

func (*ScrollBar) SetMarkInk

func (s *ScrollBar) SetMarkInk(value draw.Ink) *ScrollBar

SetMarkInk sets the ink that will be used for control marks when enabled. Pass in nil to use the default.

func (*ScrollBar) SetPressedBackgroundInk

func (s *ScrollBar) SetPressedBackgroundInk(value draw.Ink) *ScrollBar

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

func (s *ScrollBar) SetRepeatDelay(value time.Duration) *ScrollBar

SetRepeatDelay sets the amount of time to wait before triggering a repeating event.

func (*ScrollBar) SetScrolledPosition

func (s *ScrollBar) SetScrolledPosition(position float64)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL