Class Widget
Definition
- Namespace:
- ElmSharp
- Assembly:
- ElmSharp.dll
- API Level:
- preview
The Widget is an abstract class and the parent of other widgets. Inherits from EvasObject.
C#Copypublic abstract class Widget : AccessibleObject, IAccessibleObject
- Inheritance
- Derived
- Implements
Constructors
Declaration
C#Copyprotected Widget()
API Level: preview
Declaration
C#Copyprotected Widget(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent | The parent of the new Widget instance. |
API Level: preview
Properties
Declaration
C#Copypublic bool AllowTreeFocus { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
Declaration
C#Copypublic virtual Color BackgroundColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
Remarks
It could be overridden by special child class.
API Level: preview
IsAutoMirroredMode
Sets or gets the widget's mirrored mode setting. When widget is set to automatic mode(true), it follows the system mirrored mode.
Declaration
C#Copypublic bool IsAutoMirroredMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
Declaration
C#Copypublic virtual bool IsEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
Declaration
C#Copypublic bool IsFocusAllowed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Widgets which are meant to be interacted with by input events, are created able to be focused by default.
API Level: preview
Declaration
C#Copypublic bool IsFocused { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
Declaration
C#Copypublic bool IsMirroredMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: preview
Declaration
C#Copypublic virtual int Opacity { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
It could be overridden by special child class.
API Level: preview
Declaration
C#Copypublic string Style { get; set; }
Property Value
Type | Description |
---|---|
System.String |
API Level: preview
Declaration
C#Copypublic virtual string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
It could be overridden by special child class.
API Level: preview
Methods
Declaration
C#Copypublic void AllowFocus(bool isAllowFocus)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isAllowFocus | true if the object can be focused, false if not(and on errors). |
API Level: preview
Declaration
C#Copypublic void FocusNext(FocusDirection direction)
Parameters
Type | Name | Description |
---|---|---|
FocusDirection | direction | Direction to move the focus. |
API Level: preview
Declaration
C#Copypublic virtual Color GetPartColor(string part)
Parameters
Type | Name | Description |
---|---|---|
System.String | part | The name of the particular part. |
Returns
Type | Description |
---|---|
Color | The color of the particular part. |
Remarks
This method is a virtual method, it could be overridden by special child class.
API Level: preview
Declaration
C#Copypublic int GetPartOpacity(string part)
Parameters
Type | Name | Description |
---|---|---|
System.String | part | The name of the particular part. |
Returns
Type | Description |
---|---|
System.Int32 | Opacity value of the particular part. |
API Level: preview
Declaration
C#Copypublic virtual string GetPartText(string part)
Parameters
Type | Name | Description |
---|---|---|
System.String | part | The name of the particular part. |
Returns
Type | Description |
---|---|
System.String | Text of the particular part of the widget. |
API Level: preview
Declaration
C#Copyprotected override void OnRealized()
Overrides
API Level: preview
SetContent(EvasObject)
Sets content to the widget, and the preserve old content will be deleted.
Declaration
C#Copypublic void SetContent(EvasObject content)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | content | The content. |
See Also
API Level: preview
Declaration
C#Copypublic void SetContent(EvasObject content, bool preserveOldContent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | content | The content. |
System.Boolean | preserveOldContent | true, preserve old content will be unset and not be deleted. false, preserve old content will be deleted. |
See Also
API Level: preview
Declaration
C#Copypublic void SetFocus(bool isFocus)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isFocus | Whether be focused. |
API Level: preview
SetNextFocusObject(EvasObject, FocusDirection)
Sets the next widget with specific focus direction.
Declaration
C#Copypublic void SetNextFocusObject(EvasObject next, FocusDirection direction)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | next | Focus next widget. |
FocusDirection | direction | Focus direction. |
API Level: preview
Declaration
C#Copypublic virtual void SetPartColor(string part, Color color)
Parameters
Type | Name | Description |
---|---|---|
System.String | part | The name of the particular part. |
Color | color | The color to be set to the widget. |
Remarks
This method is a virtual method, it could be overridden by special child class.
API Level: preview
SetPartContent(String, EvasObject)
Sets content to the particular part of the widget, and the preserve old content will be deleted.
Declaration
C#Copypublic virtual bool SetPartContent(string part, EvasObject content)
Parameters
Type | Name | Description |
---|---|---|
System.String | part | The name of the particular part. |
EvasObject | content | The content. |
Returns
Type | Description |
---|---|
System.Boolean |
API Level: preview
SetPartContent(String, EvasObject, Boolean)
Sets content to the particular part of the widget.
Declaration
C#Copypublic virtual bool SetPartContent(string part, EvasObject content, bool preserveOldContent)
Parameters
Type | Name | Description |
---|---|---|
System.String | part | The name of the particular part. |
EvasObject | content | The content. |
System.Boolean | preserveOldContent | true, preserve old content will be unset and not be deleted. false, preserve old content will be deleted. |
Returns
Type | Description |
---|---|
System.Boolean |
See Also
API Level: preview
Declaration
C#Copypublic void SetPartOpacity(string part, int opacity)
Parameters
Type | Name | Description |
---|---|---|
System.String | part | The name of the particular part. |
System.Int32 | opacity | The opacity of the particular part. |
API Level: preview
Declaration
C#Copypublic virtual bool SetPartText(string part, string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | part | The name of the particular part. |
System.String | text | The text. |
Returns
Type | Description |
---|---|
System.Boolean |
API Level: preview
Declaration
C#Copypublic void SignalEmit(string emission, string source)
Parameters
Type | Name | Description |
---|---|---|
System.String | emission | The signal's name. |
System.String | source | The signal's source. |
API Level: preview
Declaration
C#Copyprotected void UpdatePartContents(EvasObject content, string part = "__default__")
Parameters
Type | Name | Description |
---|---|---|
EvasObject | content | The content which is put into the part. |
System.String | part | The updated part. |
API Level: preview
Events
Declaration
C#Copypublic event EventHandler Focused
Event Type
Type | Description |
---|---|
System.EventHandler |
API Level: preview
Declaration
C#Copypublic event EventHandler Unfocused
Event Type
Type | Description |
---|---|
System.EventHandler |