Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 00272 00273 00274 00275 00276 00277 00278 00279 00280 00281 00282 00283 00284 00285 00286 00287 00288 00289 00290 00291 00292 00293 00294 00295 00296 00297 00298 00299 00300 00301 00302 00303 00304 00305 00306 00307 00308 00309 00310 00311 00312 00313 00314 00315 00316 00317 00318 00319 00320 00321 00322 00323 00324 00325 00326 00327 00328 00329 00330 00331 00332 00333 00334 00335 00336 00337 00338 00339 00340 00341 00342 00343 00344 00345 00346 00347 00348 00349 00350 00351 00352 00353 00354 00355 00356 00357 00358 00359 00360 00361 00362 00363 00364 00365 00366 00367 00368 00369 00370 00371 00372 00373 00374 00375 00376 00377 00378 00379 00380 00381 00382 00383 00384 00385 00386 00387 00388 00389 00390 00391 00392 00393 00394 00395 00396 00397 00398 00399 00400 00401 00402 00403 00404 00405 00406 00407 00408 00409 00410 00411 00412 00413 00414 00415 00416 00417 00418 00419 00420 00421 00422 00423 00424 00425 00426 00427 00428 00429 00430 00431 00432 00433 00434 00435 00436 00437 00438 00439 00440 00441 00442 00443 00444 00445 00446 00447 00448 00449 00450 00451 00452 00453 00454 00455 00456 00457 00458 00459 00460 00461 00462 00463 00464 00465 00466 00467 00468 00469 00470 00471 00472 00473 00474 00475 00476 00477 00478 00479 00480 00481 00482 00483 00484 00485 00486 00487 00488 00489 00490 00491 00492 00493 00494 |
/** * 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-2008 Epic Games, Inc. All Rights Reserved. */ class UIScrollbar extends UIObject native(UIPrivate) hidecategories(Object,UIScreenObject,UIObject,Focus,Presentation,Splitscreen,States) notplaceable; // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) /** Component for rendering the background image */ var(Image) editinline const noclear UIComp_DrawImage BackgroundImageComponent; /** * Buttons that can be used to increment and decrement the marker of the scrollbar. */ var private const UIScrollbarButton IncrementButton; var private const UIScrollbarButton DecrementButton; /** * The marker which can be manipulated to change the value of the scrollbar */ var private const UIScrollbarMarkerButton MarkerButton; /** * The styles used for the increment, decrement and marker buttons */ var private UIStyleReference IncrementStyle; var private UIStyleReference DecrementStyle; var private UIStyleReference MarkerStyle; /** * 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 */ var private{private} transient float NudgeValue; /** * 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 */ var() float NudgeMultiplier; /** * Values which store current state of the scrollbar's marker */ var private{private} transient float NudgePercent; var private{private} transient float MarkerPosPercent; var private{private} transient float MarkerSizePercent; /** * Determines scrollbar's thickness */ var() UIScreenValue_Extent BarWidth; /** * 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. */ var() UIScreenValue_Extent MinimumMarkerSize; /** * Determines the length of the Increment/Decrement buttons */ var() UIScreenValue_Extent ButtonsExtent; /** * Controls whether this scrollbar is vertical or horizontal */ var() EUIOrientation ScrollbarOrientation; /** * 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 */ var() bool bAddCornerPadding; /** The current position of the mouse cursor, used in dragging handling */ var transient UIScreenValue_Position MousePosition; /** * 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. */ var private transient float MousePositionDelta; /** A private flag indicating that the marker needs to be repositioned and resized to the bounds of the uiscrollbar */ var private transient bool bInitializeMarker; /* == Delegates == */ /** * Delegate invoked on scrolling activity * * @param Sender the scrollbar that generated the event. * @param PositionChange the number of nudge values by which the marker was moved * @param bPositionMaxed indicates that the scrollbar's marker has reached its farthest available position, * used to obtain pixel exact scrolling * * @return currently unused. */ delegate bool OnScrollActivity( UIScrollbar Sender, float PositionChange, optional bool bPositionMaxed=false ); /** * Called when the user clicks anywhere in the scrollbar other than on one of the buttons. * * @param Sender the scrollbar that was clicked. * @param 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. * @param PlayerIndex Player that performed the action that issued the event. */ delegate OnClickedScrollZone( UIScrollbar Sender, float PositionPerc, int PlayerIndex ); /* == Natives == */ /** * Returns the position of this scrollbar's top face (if orientation is vertical) or left face (for horizontal), in pixels. */ native final function float GetMarkerButtonPosition() const; /** * Returns the size of the scroll-zone (the region between the decrement and increment buttons), along the same orientation as the scrollbar. * * @param ScrollZoneStart receives the value of the location of the beginning of the scroll zone, in pixels relative to the scrollbar. * * @return 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. */ 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), for the orientation opposite that of the scrollbar. * * @return the height (if the scrollbar's orientation is vertical) or width (if horizontal) of the region between the * increment and decrement buttons, in pixels. */ native final function float GetScrollZoneWidth() const; /** * Sets marker's extent to a percentage of scrollbar size, the direction will be vertical or horizontal * depending scrollbar's orientation * * @param 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 */ native final function SetMarkerSize( float SizePercentage ); /** * Sets marker's top or left face position to start at some percentage of total scrollbar extent * * @param 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 */ native final function SetMarkerPosition( float PositionPercentage ); /** * Sets the amount by which the marker will move to cause one position tick * * @param NudgePercentage percentage of total scrollbar area which will amount to one tick * value needs to be in the range [ 0 , 1 ] */ native final function SetNudgeSizePercent( float NudgePercentage ); /** * Sets the amount by which the marker will move to cause one position tick * * @param NudgePixels Number of pixels by which the marker will need to be moved to cause one tick */ native final function SetNudgeSizePixels( float NudgePixels ); /** * Sets the value of the bAddCornerPadding flag */ native final function EnableCornerPadding( bool FlagValue ); /** * Increments marker position by the amount of nudges specified in the NudgeMultiplier. Increment direction is either down or right, * depending on scrollbar's orientation. * * @param EventObject Object that issued the event. * @param PlayerIndex Player that performed the action that issued the event. */ native final function ScrollIncrement( 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 * * @param EventObject Object that issued the event. * @param PlayerIndex Player that performed the action that issued the event. */ native final function ScrollDecrement( 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. * * @param EventObject Object that issued the event. * @param PlayerIndex Player that performed the action that issued the event. */ native final function DragScrollBegin( UIScreenObject Sender, int PlayerIndex ); /** * Terminates mouse drag scrolling. * * @param EventObject Object that issued the event. * @param PlayerIndex Player that performed the action that issued the event. * * @return return TRUE to prevent the kismet OnClick event from firing. */ native final function DragScrollEnd( UIScreenObject Sender, int PlayerIndex ); /** * Called during the dragging process * * @param EventObject Object that issued the event. * @param PlayerIndex Player that performed the action that issued the event. */ native final function DragScroll( UIScrollbarMarkerButton Sender, int PlayerIndex ); /* == Events == */ /** * Initializes the clicked delegates in the increment, decrement and marker buttons. */ event Initialized() { Super.Initialized(); IncrementButton.OnPressed = ScrollIncrement; IncrementButton.OnPressRepeat = ScrollIncrement; DecrementButton.OnPressed = ScrollDecrement; DecrementButton.OnPressRepeat = ScrollDecrement; MarkerButton.OnPressed = DragScrollBegin; MarkerButton.OnPressRelease = DragScrollEnd; MarkerButton.OnButtonDragged = DragScroll; } /** * Propagate the enabled state of this widget. */ event PostInitialize() { Super.PostInitialize(); // when this widget is enabled/disabled, its children should be as well. ConditionalPropagateEnabledState(GetBestPlayerIndex()); } /* == UnrealScript == */ /** Simple accessors */ final function float GetNudgeValue() { return NudgeValue; } final function float GetNudgePercent() { return NudgePercent; } final function float GetMarkerPosPercent() { return MarkerPosPercent; } final function float GetMarkerSizePercent() { return MarkerSizePercent; } /* == SequenceAction handlers == */ defaultproperties { Begin Object Class=UIComp_DrawImage Name=ScrollBarBackgroundImageTemplate ObjName=ScrollBarBackgroundImageTemplate Archetype=UIComp_DrawImage'Engine.Default__UIComp_DrawImage' StyleResolverTag="Background Image Style" ImageStyle=(DefaultStyleTag="DefaultScrollZoneStyle") Name="ScrollBarBackgroundImageTemplate" ObjectArchetype=UIComp_DrawImage'Engine.Default__UIComp_DrawImage' End Object BackgroundImageComponent=ScrollBarBackgroundImageTemplate IncrementStyle=(DefaultStyleTag="DefaultIncrementButtonStyle",RequiredStyleClass=Class'Engine.UIStyle_Image') DecrementStyle=(DefaultStyleTag="DefaultDecrementButtonStyle",RequiredStyleClass=Class'Engine.UIStyle_Image') MarkerStyle=(DefaultStyleTag="DefaultScrollBarStyle",RequiredStyleClass=Class'Engine.UIStyle_Image') NudgeMultiplier=1.000000 BarWidth=(Value=16.000000) MinimumMarkerSize=(Value=12.000000,Orientation=UIORIENT_Vertical) ButtonsExtent=(Value=16.000000,Orientation=UIORIENT_Vertical) ScrollbarOrientation=UIORIENT_Vertical bAddCornerPadding=True PrimaryStyle=(DefaultStyleTag="DefaultScrollZoneStyle",RequiredStyleClass=Class'Engine.UIStyle_Image') PrivateFlags=1044 bSupportsPrimaryStyle=False DefaultStates(2)=Class'Engine.UIState_Focused' DefaultStates(3)=Class'Engine.UIState_Pressed' DefaultStates(4)=Class'Engine.UIState_Active' Begin Object Class=UIComp_Event Name=WidgetEventComponent ObjName=WidgetEventComponent Archetype=UIComp_Event'Engine.Default__UIObject:WidgetEventComponent' ObjectArchetype=UIComp_Event'Engine.Default__UIObject:WidgetEventComponent' End Object EventProvider=WidgetEventComponent Name="Default__UIScrollbar" ObjectArchetype=UIObject'Engine.Default__UIObject' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |