Class IntField
A VisualElement that displays a numeric value and allows the user to edit it.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class IntField : NumericalField<int>, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IInputElement<int>, IValidatableElement<int>, ISizeableElement, INotifyValueChanging<int>, INotifyValueChanged<int>
Constructors
IntField()
Default constructor.
Declaration
public IntField()
Methods
AreEqual(int, int)
Check if two values of type TValueType are equal.
Declaration
protected override bool AreEqual(int a, int b)
Parameters
Type | Name | Description |
---|---|---|
int | a | The first value to test. |
int | b | The second value to test. |
Returns
Type | Description |
---|---|
bool | True if both values are considered equals, false otherwise. |
Overrides
GetIncrementFactor(int)
Calculate the increment factor based on a base value.
Declaration
protected override float GetIncrementFactor(int baseValue)
Parameters
Type | Name | Description |
---|---|---|
int | baseValue | The base value. |
Returns
Type | Description |
---|---|
float | The increment factor. |
Overrides
Increment(int, float)
Increment a given value with a given delta.
Declaration
protected override int Increment(int originalValue, float delta)
Parameters
Type | Name | Description |
---|---|---|
int | originalValue | The original value. |
float | delta | The delta used for increment. |
Returns
Type | Description |
---|---|
int | The incremented value. |
Overrides
Max(int, int)
Return the biggest value between a and b.
Declaration
protected override int Max(int a, int b)
Parameters
Type | Name | Description |
---|---|---|
int | a | The first value to test. |
int | b | The second value to test. |
Returns
Type | Description |
---|---|
int | The biggest value. |
Overrides
Min(int, int)
Return the smallest value between a and b.
Declaration
protected override int Min(int a, int b)
Parameters
Type | Name | Description |
---|---|---|
int | a | The first value to test. |
int | b | The second value to test. |
Returns
Type | Description |
---|---|
int | The smallest value. |
Overrides
ParseRawValueToString(int)
Define the conversion from a TValueType value to a string value.
Declaration
protected override string ParseRawValueToString(int val)
Parameters
Type | Name | Description |
---|---|---|
int | val | The TValueType value to convert. |
Returns
Type | Description |
---|---|
string | The converted value. |
Overrides
Remarks
This method is used to convert the value to a string without any formatting.
ParseStringToValue(string, out int)
Define the conversion from the string value to a TValueType value.
Declaration
protected override bool ParseStringToValue(string strValue, out int val)
Parameters
Type | Name | Description |
---|---|---|
string | strValue | The string value to convert. |
int | val | The TValueType value returned. |
Returns
Type | Description |
---|---|
bool | True if the conversion is possible, False otherwise. |
Overrides
ParseValueToString(int)
Define the conversion from a TValueType value to a string value.
Declaration
protected override string ParseValueToString(int val)
Parameters
Type | Name | Description |
---|---|---|
int | val | The TValueType value to convert. |
Returns
Type | Description |
---|---|
string | The converted value. |