Class GenGrid
Definition
- Namespace:
- ElmSharp
- Assembly:
- ElmSharp.dll
- API Level:
- preview
It inherits Layout. The GenGrid is a widget that aims to position objects in a grid layout, while actually creating and rendering only the visible ones. It has two directions in which a given GenGrid widget expands while placing its items, horizontal and vertical. The gengrid items are represented through the GenItemClass definition field details.
C#Copypublic class GenGrid : Layout, IAccessibleObject
- Inheritance
- Implements
Constructors
Declaration
C#Copypublic GenGrid(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent | The parent is a given container which will be attached by GenGrid as a child. It's the EvasObject type. |
API Level: preview
Properties
FillItems
Gets or sets the manner in which the items grid is filled within a given GenGrid widget. It is filled if true, otherwise not filled if false.
Declaration
C#Copypublic bool FillItems { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
Declaration
C#Copypublic GenGridItem FirstItem { get; }
Property Value
Type | Description |
---|---|
GenGridItem |
API Level: preview
HorizontalScrollBarVisiblePolicy
Sets or gets the value of HorizontalScrollBarVisiblePolicy.
Declaration
C#Copypublic 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
IsHighlight
Gets or sets whether the gengrid items should be highlighted when an item is selected.
Declaration
C#Copypublic bool IsHighlight { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
IsHorizontal
Gets or sets the direction for which a given GenGrid widget expands while placing its items.
Declaration
C#Copypublic bool IsHorizontal { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
If true, items are placed in columns from top to bottom and when the space for a column is filled, another one is started on the right, thus expanding the grid horizontally. If false, items are placed in rows from left to right, and when the space for a row is filled, another one is started below, thus expanding the grid vertically.
API Level: preview
ItemAlignmentX
Gets or sets the item's grid alignment along X-axis within a given GenGrid widget. Accepted values are in the 0.0 to 1.0 range, with the special value -1.0 used to specify "justify" or "fill" by some users. By default, value is 0.0, meaning that the gengrid has its items grid placed exactly in the left along X-axis.
Declaration
C#Copypublic double ItemAlignmentX { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: preview
ItemAlignmentY
Gets or sets the item's grid alignment on Y-axis within a given GenGrid widget. Accepted values are in the 0.0 to 1.0 range, with the special value -1.0 used to specify "justify" or "fill" by some users. By default, value is 0.0, meaning that the gengrid has its items grid placed exactly in the top along Y-axis.
Declaration
C#Copypublic double ItemAlignmentY { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: preview
Declaration
C#Copypublic uint ItemCount { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
API Level: preview
Declaration
C#Copypublic int ItemHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
A gengrid, after creation, still has no information on the size to give to each of its cells. The default width and height just are one finger wide. Use this property to force a custom height for your items, making them as big as you wish.
API Level: preview
Declaration
C#Copypublic int ItemWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
A gengrid, after creation, still has no information on the size to give to each of its cells. The default width and height just are one finger wide. Use this property to force a custom width for your items, making them as big as you wish.
API Level: preview
Declaration
C#Copypublic GenGridItem LastItem { get; }
Property Value
Type | Description |
---|---|
GenGridItem |
API Level: preview
MultipleSelection
Gets or sets whether multi-selection is enabled or disabled for a given GenGrid widget.
Declaration
C#Copypublic bool MultipleSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Multi-selection is the ability to have more than one item selected, on a given gengrid, simultaneously. When it is enabled, a sequence of clicks on different items makes them all selected, progressively. A click on an already selected item unselects it. If interacting via the keyboard, multi-selection is enabled while holding the "Shift" key. By default, multi-selection is disabled.
API Level: preview
ReorderMode
Gets or sets whether a given GenGrid widget is able to or not able to have items reordered.
Declaration
C#Copypublic bool ReorderMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
Declaration
C#Copypublic GenGridItem SelectedItem { get; }
Property Value
Type | Description |
---|---|
GenGridItem |
API Level: preview
Declaration
C#Copypublic GenItemSelectionMode SelectionMode { get; set; }
Property Value
Type | Description |
---|---|
GenItemSelectionMode |
API Level: preview
VerticalScrollBarVisiblePolicy
Sets or gets the value of VerticalScrollBarVisiblePolicy.
Declaration
C#Copypublic 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
Methods
Append(GenItemClass, Object)
Appends a new item to a given GenGrid widget. This adds an item to the end of the gengrid.
Declaration
C#Copypublic GenGridItem Append(GenItemClass itemClass, object data)
Parameters
Type | Name | Description |
---|---|---|
GenItemClass | itemClass | The itemClass defines how to display the data. |
System.Object | data | The item data. |
Returns
Type | Description |
---|---|
GenGridItem | Return a gengrid item that contains the data and itemClass. |
API Level: preview
Clear()
Removes all the items from a given GenGrid widget. This removes (and deletes) all the items in the object, making it empty.
Declaration
C#Copypublic void Clear()
Remarks
Delete() to delete just one item.
API Level: preview
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
GetItemByPosition(Int32, Int32, out Int32, out Int32)
Gets the item that is at the X, Y canvas coordinates.
Declaration
C#Copypublic GenGridItem GetItemByPosition(int x, int y, out int portionX, out int portionY)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The input X coordinate. |
System.Int32 | y | The input Y coordinate. |
System.Int32 | portionX | The position relative to the item returned here. -1, 0, or 1, depending if the coordinate is on the left portion of that item(-1), on the middle section(0), or on the right part(1). |
System.Int32 | portionY | The position relative to the item returned here. -1, 0, or 1, depending if the coordinate is on the upper portion of that item (-1), on the middle section (0), or on the lower part (1). |
Returns
Type | Description |
---|---|
GenGridItem |
API Level: preview
InsertAfter(GenItemClass, Object, GenGridItem)
Inserts an item after another in a GenGrid widget. This inserts an item after another in the gengrid.
Declaration
C#Copypublic GenGridItem InsertAfter(GenItemClass itemClass, object data, GenGridItem after)
Parameters
Type | Name | Description |
---|---|---|
GenItemClass | itemClass | The itemClass defines how to display the data. |
System.Object | data | The item data. |
GenGridItem | after | The item after which to place this new one. |
Returns
Type | Description |
---|---|
GenGridItem | Return a gengrid item that contains the data and itemClass. |
API Level: preview
InsertBefore(GenItemClass, Object, GenGridItem)
Inserts an item before another in a GenGrid widget. This inserts an item before another in the gengrid.
Declaration
C#Copypublic GenGridItem InsertBefore(GenItemClass itemClass, object data, GenGridItem before)
Parameters
Type | Name | Description |
---|---|---|
GenItemClass | itemClass | The itemClass defines how to display the data. |
System.Object | data | The item data. |
GenGridItem | before | The item before which to place this new one. |
Returns
Type | Description |
---|---|
GenGridItem | Return a gengrid item that contains the data and itemClass. |
API Level: preview
InsertSorted(GenItemClass, Object, Comparison<Object>)
Inserts an item in a GenGrid widget using a user-defined sort function.
Declaration
C#Copypublic GenGridItem InsertSorted(GenItemClass itemClass, object data, Comparison<object> comparison)
Parameters
Type | Name | Description |
---|---|---|
GenItemClass | itemClass | The itemClass defines how to display the data. |
System.Object | data | The item data. |
System.Comparison<System.Object> | comparison | User defined comparison function that defines the sort order based on the gengrid item and its data. |
Returns
Type | Description |
---|---|
GenGridItem | Return a gengrid item that contains the data and itemClass. |
API Level: preview
Prepend(GenItemClass, Object)
Prepends a new item to a given GenGrid widget. This adds an item to the beginning of the gengrid.
Declaration
C#Copypublic GenGridItem Prepend(GenItemClass itemClass, object data)
Parameters
Type | Name | Description |
---|---|---|
GenItemClass | itemClass | The itemClass defines how to display the data. |
System.Object | data | The item data. |
Returns
Type | Description |
---|---|
GenGridItem | Return a gengrid item that contains the data and itemClass. |
API Level: preview
ScrollTo(GenGridItem, ScrollToPosition, Boolean)
Shows a given item to the visible area of a gengrid.
Declaration
C#Copypublic void ScrollTo(GenGridItem item, ScrollToPosition position, bool animated)
Parameters
Type | Name | Description |
---|---|---|
GenGridItem | item | The gengrid item to display. |
ScrollToPosition | position | The position of the item in the viewport. |
System.Boolean | animated | The type of how to show the item. |
Remarks
If animated is true, the gengrid shows the item by scrolling if it's not fully visible. If animated is false, the gengrid shows the item by jumping if it's not fully visible.
See Also
API Level: preview
UpdateRealizedItems()
Updates the contents of all the realized items. This updates all realized items by calling all the GenItemClass again to get the content, text, and states. Use this when the original item data has changed and the changes are desired to reflect.
Declaration
C#Copypublic void UpdateRealizedItems()
Remarks
Update() to update just one item.
API Level: preview
Events
Changed
Changed is raised when an item is added, removed, resized or moved and when the gengrid is resized or gets "horizontal" property changes.
Declaration
C#Copypublic event EventHandler Changed
Event Type
Type | Description |
---|---|
System.EventHandler |
API Level: preview
ItemActivated
ItemActivated is raised when a new gengrid item is double-clicked or pressed (enter|return|spacebar).
Declaration
C#Copypublic event EventHandler<GenGridItemEventArgs> ItemActivated
Event Type
Type | Description |
---|---|
System.EventHandler<GenGridItemEventArgs> |
API Level: preview
ItemDoubleClicked
ItemDoubleClicked is raised when a new gengrid item is double-clicked.
Declaration
C#Copypublic event EventHandler<GenGridItemEventArgs> ItemDoubleClicked
Event Type
Type | Description |
---|---|
System.EventHandler<GenGridItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenGridItemEventArgs> ItemFocused
Event Type
Type | Description |
---|---|
System.EventHandler<GenGridItemEventArgs> |
API Level: preview
ItemLongPressed
ItemLongPressed is raised when a gengrid item is pressed for a certain amount of time. By default it's 1 second.
Declaration
C#Copypublic event EventHandler<GenGridItemEventArgs> ItemLongPressed
Event Type
Type | Description |
---|---|
System.EventHandler<GenGridItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenGridItemEventArgs> ItemPressed
Event Type
Type | Description |
---|---|
System.EventHandler<GenGridItemEventArgs> |
API Level: preview
ItemRealized
ItemRealized is raised when a gengrid item is implemented through GenItemClass.
Declaration
C#Copypublic event EventHandler<GenGridItemEventArgs> ItemRealized
Event Type
Type | Description |
---|---|
System.EventHandler<GenGridItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenGridItemEventArgs> ItemReleased
Event Type
Type | Description |
---|---|
System.EventHandler<GenGridItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenGridItemEventArgs> ItemSelected
Event Type
Type | Description |
---|---|
System.EventHandler<GenGridItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenGridItemEventArgs> ItemUnfocused
Event Type
Type | Description |
---|---|
System.EventHandler<GenGridItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenGridItemEventArgs> ItemUnrealized
Event Type
Type | Description |
---|---|
System.EventHandler<GenGridItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenGridItemEventArgs> ItemUnselected
Event Type
Type | Description |
---|---|
System.EventHandler<GenGridItemEventArgs> |