Class Scroller
Definition
- Namespace:
- ElmSharp
- Assembly:
- ElmSharp.dll
- API Level:
- preview
The Scroller is a container that holds and clips a single object and allows you to scroll across it.
C#Copypublic class Scroller : Layout, IAccessibleObject
- Inheritance
- Derived
- Implements
Constructors
Declaration
C#Copypublic Scroller()
API Level: preview
Declaration
C#Copypublic Scroller(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent | The EvasObject to which the new Scroller will be attached as a child. |
API Level: preview
Properties
Declaration
C#Copypublic int ChildHeight { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: preview
Declaration
C#Copypublic int ChildWidth { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: preview
ContentPropagateEvents
Gets or sets the event propagation for a scroller. This enables or disables event propagation from the scroller content to the scroller and its parent. By default, event propagation is enabled.
Declaration
C#Copypublic bool ContentPropagateEvents { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
CurrentRegion
Gets the current region in the content object that is visible through the scroller.
Declaration
C#Copypublic Rect CurrentRegion { get; }
Property Value
Type | Description |
---|---|
Rect |
API Level: preview
HorizontalBounce
Sets or gets the horizontal bounce behaviour. When scrolling, the scroller may "bounce" when reaching an edge of the content object. This is a visual way to indicate the end has been reached. This is enabled by default for both axis. This API will set if it is enabled for the given axis with the boolean parameters for each axis.
Declaration
C#Copypublic bool HorizontalBounce { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
HorizontalGravity
Sets the scrolling gravity values for a scroller. The gravity defines how the scroller will adjust its view when the size of the scroller contents increase. The scroller will adjust the view to glue itself as follows: x=0.0, for staying where it is relative to the left edge of the content, x=1.0, for staying where it is relative to the rigth edge of the content, y=0.0, for staying where it is relative to the top edge of the content, y=1.0, for staying where it is relative to the bottom edge of the content. Default values for x and y are 0.0.
Declaration
C#Copypublic double HorizontalGravity { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: preview
HorizontalLoop
Sets an infinite loop_ for a scroller. This function sets the infinite loop horizontally. If the content is set, it will be shown repeatedly.
Declaration
C#Copypublic bool HorizontalLoop { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
Declaration
C#Copypublic int HorizontalPageIndex { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
Current page means the page which meets the left of the viewport. If there are two or more pages in the viewport, it returns the number of the page which meets the left of the viewport. The page number starts from 0. 0 is the first page.
API Level: preview
HorizontalPageScrollLimit
Sets or gets the maximum limit of the movable page at horizontal direction.
Declaration
C#Copypublic int HorizontalPageScrollLimit { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: preview
HorizontalRelativePageSize
Gets or sets a given scroller widget's scrolling page size, relative to its viewport size.
Declaration
C#Copypublic double HorizontalRelativePageSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: preview
HorizontalScrollBarVisiblePolicy
Sets or gets the value of HorizontalScrollBarVisiblePolicy.
Declaration
C#Copypublic virtual ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy { get; set; }
Property Value
Type | Description |
---|---|
ScrollBarVisiblePolicy |
Remarks
ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden. ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
API Level: preview
Declaration
C#Copypublic bool HorizontalSnap { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
When scrolling, if a scroller is paged (see HorizontalRelativePageSize), the scroller may snap to pages when being scrolled, i.e., even if it had momentum to scroll further, it will stop at the next page boundaries. This is disabled, by default, for both axis. This function will set if it that is enabled or not, for each axis.
API Level: preview
Declaration
C#Copypublic int HorizontalStepSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: preview
LastHorizontalPageNumber
Gets the scroll last page number. The page number starts from 0. 0 is the first page. This returns the last page number among the pages.
Declaration
C#Copypublic int LastHorizontalPageNumber { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: preview
LastVerticalPageNumber
Gets the scroll last page number. The page number starts from 0. 0 is the first page. This returns the last page number among the pages.
Declaration
C#Copypublic int LastVerticalPageNumber { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: preview
PageHeight
Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
Declaration
C#Copypublic int PageHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: preview
PageWidth
Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
Declaration
C#Copypublic int PageWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: preview
Declaration
C#Copypublic ScrollBlock ScrollBlock { get; set; }
Property Value
Type | Description |
---|---|
ScrollBlock |
Remarks
This function will block scrolling movement in a given direction. One can disable movements in the X-axis, the Y-axis, or both. The default value is ScrollBlock.None, where movements are allowed in both directions.
API Level: preview
Declaration
C#Copypublic ScrollSingleDirection SingleDirection { get; set; }
Property Value
Type | Description |
---|---|
ScrollSingleDirection |
API Level: preview
VerticalBounce
Sets or gets the vertical bounce behaviour. When scrolling, the scroller may "bounce" when reaching an edge of the content object. This is a visual way to indicate the end has been reached. This is enabled by default for both axis. This API will set if it is enabled for the given axis with the boolean parameters for each axis.
Declaration
C#Copypublic bool VerticalBounce { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
VerticalGravity
Sets the scrolling gravity values for a scroller. The gravity defines how the scroller will adjust its view when the size of the scroller contents increase. The scroller will adjust the view to glue itself as follows: x=0.0, for staying where it is relative to the left edge of the content, x=1.0, for staying where it is relative to the rigth edge of the content, y=0.0, for staying where it is relative to the top edge of the content, y=1.0, for staying where it is relative to the bottom edge of the content. Default values for x and y are 0.0.
Declaration
C#Copypublic double VerticalGravity { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: preview
VerticalLoop
Sets an infinite loop_ for a scroller. This function sets the infinite loop vertically. If the content is set, it will be shown repeatedly.
Declaration
C#Copypublic bool VerticalLoop { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
Declaration
C#Copypublic int VerticalPageIndex { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
Current page means the page which meets the top of the viewport. If there are two or more pages in the viewport, it returns the number of the page which meets the top of the viewport. The page number starts from 0. 0 is the first page.
API Level: preview
VerticalPageScrollLimit
Sets or gets the maximum limit of the movable page at vertical direction.
Declaration
C#Copypublic int VerticalPageScrollLimit { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: preview
VerticalRelativePageSize
Gets or sets a given scroller widget's scrolling page size, relative to its viewport size.
Declaration
C#Copypublic double VerticalRelativePageSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: preview
VerticalScrollBarVisiblePolicy
Sets or gets the value of VerticalScrollBarVisiblePolicy.
Declaration
C#Copypublic virtual ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy { get; set; }
Property Value
Type | Description |
---|---|
ScrollBarVisiblePolicy |
Remarks
ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden. ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
API Level: preview
Declaration
C#Copypublic bool VerticalSnap { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
When scrolling, if a scroller is paged (see VerticalRelativePageSize), the scroller may snap to pages when being scrolled, i.e., even if it had momentum to scroll further, it will stop at the next page boundaries. This is disabled, by default, for both axis. This function will set if it that is enabled or not, for each axis.
API Level: preview
Declaration
C#Copypublic int VerticalStepSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: preview
WheelDisabled
Gets or sets a value whether mouse wheel is enabled or not over the scroller.
Declaration
C#Copypublic bool WheelDisabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
Methods
Declaration
C#Copyprotected override IntPtr CreateHandle(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent | Parent EvasObject. |
Returns
Type | Description |
---|---|
System.IntPtr | Handle IntPtr. |
Overrides
API Level: preview
MinimumLimit(Boolean, Boolean)
Sets the scroller minimum size limited to the minimum size of the content. By default, the scroller will be as small as its design allows, irrespective of its content. This will make the scroller minimum size the right size horizontally and/or vertically to perfectly fit its content in that direction.
Declaration
C#Copypublic void MinimumLimit(bool horizontal, bool vertical)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | horizontal | Enable limiting minimum size horizontally. |
System.Boolean | vertical | Enable limiting minimum size vertically. |
API Level: preview
Declaration
C#Copyprotected override void OnRealized()
Overrides
API Level: preview
ScrollTo(Rect, Boolean)
Shows a specific virtual region within the scroller content object.
Declaration
C#Copypublic void ScrollTo(Rect region, bool animated)
Parameters
Type | Name | Description |
---|---|---|
Rect | region | Rect struct of region. |
System.Boolean | animated | True means allows the scroller to "smoothly slide" to this location. |
Remarks
This ensures that all (or part, if it does not fit) of the designated region in the virtual content object ((0, 0) starting at the top-left of the virtual content object) is shown within the scroller. If set "animated" to true, it will allows the scroller to "smoothly slide" to this location (if configuration in general calls for transitions). It may not jump immediately to the new location and may take a while and show other content along the way.
API Level: preview
ScrollTo(Int32, Int32, Boolean)
Shows a specific virtual region within the scroller content object by the page number. (0, 0) of the indicated page is located at the top-left corner of the viewport.
Declaration
C#Copypublic void ScrollTo(int horizontalPageIndex, int verticalPageIndex, bool animated)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | horizontalPageIndex | The horizontal page number. |
System.Int32 | verticalPageIndex | The vertical page number. |
System.Boolean | animated | True means slider with animation. |
API Level: preview
Declaration
C#Copypublic void SetPageSize(double width, double height)
Parameters
Type | Name | Description |
---|---|---|
System.Double | width | The horizontal page relative size. |
System.Double | height | The vertical page relative size. |
Remarks
The scroller is capable of limiting scrolling by the user to "pages". That is to jump by and only show a "whole page" at a time as if the continuous area of the scroller content is split into page sized pieces. This sets the size of a page relative to the viewport of the scroller. 1.0 is "1 viewport" which is the size (horizontally or vertically). 0.0 turns it off in that axis. This is mutually exclusive with the page size (see elm_scroller_page_size_set() for more information). Likewise 0.5 is "half a viewport". Usable values are normally between 0.0 and 1.0 including 1.0. If you only want 1 axis to be page "limited", use 0.0 for the other axis.
API Level: preview
SetPageSize(Int32, Int32)
Sets the page size to an absolute fixed value, with 0 turning it off for that axis.
Declaration
C#Copypublic void SetPageSize(int width, int height)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width | The horizontal page size. |
System.Int32 | height | The vertical page size. |
API Level: preview
Events
Declaration
C#Copypublic event EventHandler DragStart
Event Type
Type | Description |
---|---|
System.EventHandler |
API Level: preview
Declaration
C#Copypublic event EventHandler DragStop
Event Type
Type | Description |
---|---|
System.EventHandler |
API Level: preview
Declaration
C#Copypublic event EventHandler PageScrolled
Event Type
Type | Description |
---|---|
System.EventHandler |
API Level: preview
ScrollAnimationStarted
ScrollAnimationStarted will be triggered when the content animation has been started.
Declaration
C#Copypublic event EventHandler ScrollAnimationStarted
Event Type
Type | Description |
---|---|
System.EventHandler |
API Level: preview
ScrollAnimationStopped
ScrollAnimationStopped will be triggered when the content animation has been stopped.
Declaration
C#Copypublic event EventHandler ScrollAnimationStopped
Event Type
Type | Description |
---|---|
System.EventHandler |
API Level: preview
Declaration
C#Copypublic event EventHandler Scrolled
Event Type
Type | Description |
---|---|
System.EventHandler |