TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::ScrollManagement Class Reference

Scroll containers' offsets (pixels), kept across frames by ID behind handles. More...

#include <gui_core/state/gui_scroll_management.h>

Public Member Functions

void BeginFrame ()
void EndFrame (IDManager &idManager)
ScrollOffsetHandle GetOrCreateScrollOffsetHandle (ID id)
ScrollOffsetHandle GetScrollOffsetHandle (ID id)
bool IsScrollOffsetHandleValid (ScrollOffsetHandle handle) const
int2 GetScrollOffset (ScrollOffsetHandle handle)
void SetScrollOffset (ScrollOffsetHandle handle, int2 offset)
bool MakeRectVisibleInScroll (ScrollOffsetHandle scrollHandle, int2 rectMin, int2 rectMax, int2 containerSize, ScrollAxis axis=ScrollAxis::Both)
 Scrolls just enough to show rectMin..rectMax (content space) in a container of containerSize; true when it scrolled.
bool MakeRectVisibleHierarchically (ElementStorage &elementStorage, int2 targetRectMin, int2 targetRectMax, const ElementRef &elementRef, ScrollAxis axis=ScrollAxis::Both)
 Scrolls elementRef's scroll ancestors to show the target rect (screen space).
bool MakeRectVisibleHierarchically (ElementStorage &elementStorage, IntRect targetRect, const ElementRef &elementRef, ScrollAxis axis=ScrollAxis::Both)
bool MakeElementVisibleHierarchically (ElementStorage &elementStorage, const ElementRef &elementRef, ScrollAxis axis=ScrollAxis::Both)
bool MakeTextCursorVisibleInTextBox (ElementStorage &elementStorage, const ElementRef &textEditorRef, int2 cursorPos, int cursorHeight=1)
 Scrolls a text editor to show its cursor; cursorPos is in the editor's content space.

Detailed Description

Scroll containers' offsets (pixels), kept across frames by ID behind handles.

EndFrame drops the offsets of static IDs that were released and of other IDs not used this frame.

Member Function Documentation

◆ BeginFrame()

void tachyon::ScrollManagement::BeginFrame ( )

◆ EndFrame()

void tachyon::ScrollManagement::EndFrame ( IDManager & idManager)

◆ GetOrCreateScrollOffsetHandle()

ScrollOffsetHandle tachyon::ScrollManagement::GetOrCreateScrollOffsetHandle ( ID id)

◆ GetScrollOffsetHandle()

ScrollOffsetHandle tachyon::ScrollManagement::GetScrollOffsetHandle ( ID id)

◆ IsScrollOffsetHandleValid()

bool tachyon::ScrollManagement::IsScrollOffsetHandleValid ( ScrollOffsetHandle handle) const

◆ GetScrollOffset()

int2 tachyon::ScrollManagement::GetScrollOffset ( ScrollOffsetHandle handle)

◆ SetScrollOffset()

void tachyon::ScrollManagement::SetScrollOffset ( ScrollOffsetHandle handle,
int2 offset )

◆ MakeRectVisibleInScroll()

bool tachyon::ScrollManagement::MakeRectVisibleInScroll ( ScrollOffsetHandle scrollHandle,
int2 rectMin,
int2 rectMax,
int2 containerSize,
ScrollAxis axis = ScrollAxis::Both )

Scrolls just enough to show rectMin..rectMax (content space) in a container of containerSize; true when it scrolled.

Oversized, partly visible rects stay put.

◆ MakeRectVisibleHierarchically() [1/2]

bool tachyon::ScrollManagement::MakeRectVisibleHierarchically ( ElementStorage & elementStorage,
int2 targetRectMin,
int2 targetRectMax,
const ElementRef & elementRef,
ScrollAxis axis = ScrollAxis::Both )

Scrolls elementRef's scroll ancestors to show the target rect (screen space).

◆ MakeRectVisibleHierarchically() [2/2]

bool tachyon::ScrollManagement::MakeRectVisibleHierarchically ( ElementStorage & elementStorage,
IntRect targetRect,
const ElementRef & elementRef,
ScrollAxis axis = ScrollAxis::Both )
inline

◆ MakeElementVisibleHierarchically()

bool tachyon::ScrollManagement::MakeElementVisibleHierarchically ( ElementStorage & elementStorage,
const ElementRef & elementRef,
ScrollAxis axis = ScrollAxis::Both )

◆ MakeTextCursorVisibleInTextBox()

bool tachyon::ScrollManagement::MakeTextCursorVisibleInTextBox ( ElementStorage & elementStorage,
const ElementRef & textEditorRef,
int2 cursorPos,
int cursorHeight = 1 )

Scrolls a text editor to show its cursor; cursorPos is in the editor's content space.


The documentation for this class was generated from the following file: