The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall

UE3:UIScrollbar (UT3)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UT3 Object >> UIRoot >> UIScreenObject >> UIObject >> UIScrollbar
Package: 
Engine
Known classes within UIScrollbar:
UIScrollbarButton, UIScrollbarMarkerButton
This class in other games:
UDK

This component when integrated into a widget allows for scrolling the contents of the widget, i.e. UIList. UIScrollbar has built-in functionality to autoposition itself within the owner widget depending on its orientation

Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.

Properties[edit]

Property group 'Image'[edit]

BackgroundImageComponent[edit]

Type: UIComp_DrawImage

Modifiers: editinline, const, noclear

Component for rendering the background image

Default value: UIComp_DrawImage'ScrollBarBackgroundImageTemplate'

Property group 'UIScrollbar'[edit]

bAddCornerPadding[edit]

Type: bool

Specifies wheather to leave extra space between the bottom/right corner of the scrollbar and its owner widget. Extra space prevents ovelapping if both horizontal and vertical scrollbars exist within one widget

Default value: True

BarWidth[edit]

Type: UIRoot.UIScreenValue_Extent

Determines scrollbar's thickness

Default value:

Member Value
Value 16.0

ButtonsExtent[edit]

Type: UIRoot.UIScreenValue_Extent

Determines the length of the Increment/Decrement buttons

Default value:

Member Value
Orientation UIORIENT_Vertical
Value 16.0

MinimumMarkerSize[edit]

Type: UIRoot.UIScreenValue_Extent

Specifies the minimum size for the scrollbar marker. Useful to prevent the marker from becoming too small if there are lots of items in the list.

Default value:

Member Value
Orientation UIORIENT_Vertical
Value 12.0

NudgeMultiplier[edit]

Type: float

The NudgeMultiplier value indicates by how many NudgeValues will the marker move when the increment or decrement button is pressed, NudgeValue is multiplied by NudgeMultiplier to obtain final pixel amount

Default value: 1.0

ScrollbarOrientation[edit]

Type: UIRoot.EUIOrientation

Controls whether this scrollbar is vertical or horizontal

Default value: UIORIENT_Vertical

Internal variables[edit]

bInitializeMarker[edit]

Type: bool

Modifiers: private, transient

A private flag indicating that the marker needs to be repositioned and resized to the bounds of the uiscrollbar

DecrementButton[edit]

Type: UIScrollbarButton

Modifiers: private, const


DecrementStyle[edit]

Type: UIRoot.UIStyleReference

Modifiers: private


Default value:

Member Value
DefaultStyleTag 'DefaultDecrementButtonStyle'
RequiredStyleClass Class'Engine.UIStyle_Image'

IncrementButton[edit]

Type: UIScrollbarButton

Modifiers: private, const

Buttons that can be used to increment and decrement the marker of the scrollbar.

IncrementStyle[edit]

Type: UIRoot.UIStyleReference

Modifiers: private

The styles used for the increment, decrement and marker buttons

Default value:

Member Value
DefaultStyleTag 'DefaultIncrementButtonStyle'
RequiredStyleClass Class'Engine.UIStyle_Image'

MarkerButton[edit]

Type: UIScrollbarMarkerButton

Modifiers: private, const

The marker which can be manipulated to change the value of the scrollbar

MarkerPosPercent[edit]

Type: float

Modifiers: private, transient


MarkerSizePercent[edit]

Type: float

Modifiers: private, transient


MarkerStyle[edit]

Type: UIRoot.UIStyleReference

Modifiers: private


Default value:

Member Value
DefaultStyleTag 'DefaultScrollBarStyle'
RequiredStyleClass Class'Engine.UIStyle_Image'

MousePosition[edit]

Type: UIRoot.UIScreenValue_Position

Modifiers: transient

The current position of the mouse cursor, used in dragging handling

MousePositionDelta[edit]

Type: float

Modifiers: private, transient

The accumulated mouse position delta during dragging. The change in mouse position is accumulated until it is greater than the nudge value, at which point it will then call the OnScrollActivity delegate to move the content.

NudgePercent[edit]

Type: float

Modifiers: private, transient

Values which store current state of the scrollbar's marker

NudgeValue[edit]

Type: float

Modifiers: private, transient

The nudge value indicates how much marker movement will cause one position update "tick", value is stored in pixels. It can be set to 1 as is the case with the UIScrollframe, or it can be evaluated based on some percentage of the total available size as is the case with the UIList

Default values[edit]

Property Value
bSupportsPrimaryStyle False
DefaultStates[2] Class'Engine.UIState_Focused'
DefaultStates[3] Class'Engine.UIState_Pressed'
DefaultStates[4] Class'Engine.UIState_Active'
PrimaryStyle
Member Value
DefaultStyleTag 'DefaultScrollZoneStyle'
RequiredStyleClass Class'Engine.UIStyle_Image'
PrivateFlags 1044

Subobjects[edit]

ScrollBarBackgroundImageTemplate[edit]

Class: Engine.UIComp_DrawImage

Property Value
ImageStyle
Member Value
DefaultStyleTag 'DefaultScrollZoneStyle'
StyleResolverTag 'Background Image Style'

WidgetEventComponent[edit]

Class: Engine.UIComp_Event

Inherits from: UIObject.WidgetEventComponent

No new values.

Delegates[edit]

OnClickedScrollZone[edit]

delegate OnClickedScrollZone (UIScrollbar Sender, float PositionPerc, int PlayerIndex)

Called when the user clicks anywhere in the scrollbar other than on one of the buttons.

Parameters:

  • Sender - the scrollbar that was clicked.
  • PositionPerc - a value from 0.0 - 1.0, representing the location of the click within the region between the increment and decrement buttons. Values closer to 0.0 means that the user clicked near the decrement button; values closer to 1.0 are nearer the increment button.
  • PlayerIndex - Player that performed the action that issued the event.

OnScrollActivity[edit]

delegate bool OnScrollActivity (UIScrollbar Sender, float PositionChange, optional bool bPositionMaxed)

Delegate invoked on scrolling activity

Parameters:

  • Sender - the scrollbar that generated the event.
  • PositionChange - the number of nudge values by which the marker was moved
  • bPositionMaxed - indicates that the scrollbar's marker has reached its farthest available position, used to obtain pixel exact scrolling

Returns:

currently unused.

Functions[edit]

Native functions[edit]

DragScroll[edit]

native final function DragScroll (UIScrollbarMarkerButton Sender, int PlayerIndex)

Called during the dragging process

Parameters:

  • EventObject - Object that issued the event.
  • PlayerIndex - Player that performed the action that issued the event.

DragScrollBegin[edit]

native final function DragScrollBegin (UIScreenObject Sender, int PlayerIndex)

Initiates mouse drag scrolling. The scroll bar marker will slide on its axis with the mouse cursor until DragScrollEnd is called.

Parameters:

  • EventObject - Object that issued the event.
  • PlayerIndex - Player that performed the action that issued the event.

DragScrollEnd[edit]

native final function DragScrollEnd (UIScreenObject Sender, int PlayerIndex)

Terminates mouse drag scrolling.

Parameters:

  • EventObject - Object that issued the event.
  • PlayerIndex - Player that performed the action that issued the event.

Returns:

return TRUE to prevent the kismet OnClick event from firing.

EnableCornerPadding[edit]

native final function EnableCornerPadding (bool FlagValue)

Sets the value of the bAddCornerPadding flag

GetMarkerButtonPosition[edit]

native final function float GetMarkerButtonPosition () const

Returns the position of this scrollbar's top face (if orientation is vertical) or left face (for horizontal), in pixels.

GetScrollZoneExtent[edit]

native final noexport function float GetScrollZoneExtent (optional out float ScrollZoneStart) const

Returns the size of the scroll-zone (the region between the decrement and increment buttons), along the same orientation as the scrollbar.

Parameters:

  • ScrollZoneStart - receives the value of the location of the beginning of the scroll zone, in pixels relative to the scrollbar.

Returns:

the height (if the scrollbar's orientation is vertical) or width (if horizontal) of the region between the increment and decrement buttons, in pixels.

Note: noexport so that the native implementation can declare the optional out as a * will default value of NULL.

GetScrollZoneWidth[edit]

native final function float GetScrollZoneWidth () const

Returns the size of the scroll-zone (the region between the decrement and increment buttons), for the orientation opposite that of the scrollbar.

Returns:

the height (if the scrollbar's orientation is vertical) or width (if horizontal) of the region between the increment and decrement buttons, in pixels.

ScrollDecrement[edit]

native final function ScrollDecrement (UIScreenObject Sender, int PlayerIndex)

Decrements marker position by the amount of nudges specified in the NudgeMultiplier. Decrement direction is either up or left, depending on marker's orientation

Parameters:

  • EventObject - Object that issued the event.
  • PlayerIndex - Player that performed the action that issued the event.

ScrollIncrement[edit]

native final function ScrollIncrement (UIScreenObject Sender, int PlayerIndex)

Increments marker position by the amount of nudges specified in the NudgeMultiplier. Increment direction is either down or right, depending on scrollbar's orientation.

Parameters:

  • EventObject - Object that issued the event.
  • PlayerIndex - Player that performed the action that issued the event.

SetMarkerPosition[edit]

native final function SetMarkerPosition (float PositionPercentage)

Sets marker's top or left face position to start at some percentage of total scrollbar extent

Parameters:

  • PositionPercentage - determines where the marker should start, value needs to be in the range [ 0 , 1 ] and should correspond to the position of the topmost or leftmost item in the viewing area

SetMarkerSize[edit]

native final function SetMarkerSize (float SizePercentage)

Sets marker's extent to a percentage of scrollbar size, the direction will be vertical or horizontal depending scrollbar's orientation

Parameters:

  • SizePercentage - determines the size of the marker, value needs to be in the range [ 0 , 1 ] and should be equal to the ratio of viewing area to total widget scroll area

SetNudgeSizePercent[edit]

native final function SetNudgeSizePercent (float NudgePercentage)

Sets the amount by which the marker will move to cause one position tick

Parameters:

  • NudgePercentage - percentage of total scrollbar area which will amount to one tick value needs to be in the range [ 0 , 1 ]

SetNudgeSizePixels[edit]

native final function SetNudgeSizePixels (float NudgePixels)

Sets the amount by which the marker will move to cause one position tick

Parameters:

  • NudgePixels - Number of pixels by which the marker will need to be moved to cause one tick

Events[edit]

Initialized[edit]

event Initialized ()

Overrides: UIScreenObject.Initialized

Initializes the clicked delegates in the increment, decrement and marker buttons.

PostInitialize[edit]

event PostInitialize ()

Overrides: UIScreenObject.PostInitialize

Propagate the enabled state of this widget.

Other instance functions[edit]

GetMarkerPosPercent[edit]

final function float GetMarkerPosPercent ()


GetMarkerSizePercent[edit]

final function float GetMarkerSizePercent ()


GetNudgePercent[edit]

final function float GetNudgePercent ()


GetNudgeValue[edit]

final function float GetNudgeValue ()

Simple accessors