Class VirtualKeyboardLayout
Represents a class that hosts all IKey instances, the infrastructure to create new keys, organizes them into logical rows and contains the logical layout implementation. This class also has several predefined layouts.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.VirtualKeyboard
Assembly: Telerik.WinControls.UI.dll
Syntax
public class VirtualKeyboardLayout : BaseVirtualKeyboardLayout, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IVirtualKeyboardLayout
Constructors
VirtualKeyboardLayout()
Initializes new instance of the VirtualKeyboardLayout class.
Declaration
public VirtualKeyboardLayout()
Properties
KeySpacing
Gets or sets the logical spacing between keys.
Declaration
public double KeySpacing { get; set; }
Property Value
System.Double
|
Rows
Gets the logical rows collection.
Declaration
public ObservableCollection<Row> Rows { get; }
Property Value
ObservableCollection<Row>
|
TotalColumnsCount
Gets the total number of logical columns.
Declaration
public override double TotalColumnsCount { get; }
Property Value
System.Double
|
Overrides
TotalRowsCount
Gets the total number of logical rows.
Declaration
public override double TotalRowsCount { get; }
Property Value
System.Double
|
Overrides
Methods
AddEmptySpace(Double, Double)
Adds an empty space to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual void AddEmptySpace(double width = 1, double height = 1)
Parameters
System.Double
width
The logical width of the empty space. |
System.Double
height
The logical height of the empty space. |
AddKey(Int32, KeyType, Double, Double, Boolean, Boolean)
Adds a key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddKey(int virtualKeyCode, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false, bool showSecondaryText = false)
Parameters
System.Int32
virtualKeyCode
The virtual key code. |
KeyType
keyType
The type of the key. |
System.Double
width
The logical width of key. |
System.Double
height
The logical height of key. |
System.Boolean
isSharpStyle
Indicates whether the key has more noticeable(sharp) style. |
System.Boolean
showSecondaryText
Indicates whether to show the secondary text element. |
Returns
IKey
The added key. |
AddKey(Keys, KeyType, Double, Double, Boolean, Boolean)
Adds a key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddKey(Keys key, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false, bool showSecondaryText = false)
Parameters
System.Windows.Forms.Keys
key
The key. |
KeyType
keyType
The type of the key. |
System.Double
width
The logical width of key. |
System.Double
height
The logical height of key. |
System.Boolean
isSharpStyle
Indicates whether the key has more noticeable(sharp) style. |
System.Boolean
showSecondaryText
Indicates whether to show the secondary text element. |
Returns
IKey
The added key. |
AddKey(IKey)
Adds a IKey instance to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddKey(IKey key)
Parameters
IKey
key
The key to be added. |
Returns
IKey
The added key. |
AddKey(Key)
Adds a Key instance to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddKey(Key key)
Parameters
Key
key
The key to be added. |
Returns
IKey
The added key. |
AddKey(ToggleKey)
Adds a ToggleKey instance to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddKey(ToggleKey key)
Parameters
ToggleKey
key
The toggle key to be added. |
Returns
IKey
The added key. |
AddKeyInternal(IKey)
Add a key to the VirtualKeyboardLayout.
Declaration
protected virtual IKey AddKeyInternal(IKey key)
Parameters
IKey
key
The key to be added. |
Returns
IKey
|
Exceptions
System.ArgumentException
If the key does not inherit from RadItem. |
AddNewLine()
Adds a new line.
Declaration
public virtual void AddNewLine()
AddNumpadKey(Keys, String, Keys, String, Double, Double, Boolean, Font, Font)
Adds a numpad key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddNumpadKey(Keys numLockActiveKeyCode, string activeKeyText, Keys alternateKeyCode, string alternateKeyText, double width = 1, double height = 1, bool sharpStyle = false, Font activeKeyFont = null, Font alternateKeyFont = null)
Parameters
System.Windows.Forms.Keys
numLockActiveKeyCode
The virtual key code of active state. |
System.String
activeKeyText
The text in active state. |
System.Windows.Forms.Keys
alternateKeyCode
The virtual key code in alternate mode. |
System.String
alternateKeyText
The text in alternate state. |
System.Double
width
The logical width of key. |
System.Double
height
The logical height of key. |
System.Boolean
sharpStyle
Indicates whether the key has more noticeable(sharp) style. |
System.Drawing.Font
activeKeyFont
The font specified to the key element in active state. |
System.Drawing.Font
alternateKeyFont
The font specified to the key element in alternate state. |
Returns
IKey
The added key. |
AddSpecialKey(Int32, String, KeyType, Double, Double, Boolean, Font)
Adds a spacial key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddSpecialKey(int virtualKeyCode, string displayText, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false, Font font = null)
Parameters
System.Int32
virtualKeyCode
The virtual key code. |
System.String
displayText
The display text. |
KeyType
keyType
The type of the key. |
System.Double
width
The logical width of key. |
System.Double
height
The logical height of key. |
System.Boolean
isSharpStyle
Indicates whether the key has more noticeable(sharp) style. |
System.Drawing.Font
font
The font specified to the key element. |
Returns
IKey
The added key. |
AddSpecialKey(Keys, String, KeyType, Double, Double, Boolean, Font)
Adds a special key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddSpecialKey(Keys key, string displayText, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false, Font font = null)
Parameters
System.Windows.Forms.Keys
key
The key. |
System.String
displayText
The display text. |
KeyType
keyType
The type of the key. |
System.Double
width
The logical width of key. |
System.Double
height
The logical height of key. |
System.Boolean
isSharpStyle
Indicates whether the key has more noticeable(sharp) style. |
System.Drawing.Font
font
The font specified to the key element. |
Returns
IKey
The added key. |
AddToggleKey(Int32, String, KeyType, Double, Double, Boolean)
Adds a toggle key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddToggleKey(int virtualKeyCode, string displayText, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false)
Parameters
System.Int32
virtualKeyCode
The virtual key code. |
System.String
displayText
The display text. |
KeyType
keyType
The type of the key. |
System.Double
width
The logical width of key. |
System.Double
height
The logical height of key. |
System.Boolean
isSharpStyle
Indicates whether the key has more noticeable(sharp) style. |
Returns
IKey
The added key. |
AddToggleKey(Keys, String, KeyType, Double, Double, Boolean)
Adds a toggle key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddToggleKey(Keys key, string displayText, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false)
Parameters
System.Windows.Forms.Keys
key
The key. |
System.String
displayText
The display text. |
KeyType
keyType
The type of the key. |
System.Double
width
The logical width of key. |
System.Double
height
The logical height of key. |
System.Boolean
isSharpStyle
Indicates whether the key has more noticeable(sharp) style. |
Returns
IKey
The added key. |
ArrangeOverride(SizeF)
Arranges the VirtualKeyboardLayout to its final location. The element must call the Arrange method of each of its children.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
System.Drawing.SizeF
finalSize
The size that is available for element. |
Returns
System.Drawing.SizeF
The rectangle occupied by the element. Usually |
Overrides
Remarks
In this method call to the Arrange method of each child must be made.
CreateDefaultNumpadLayout()
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the default numpad keyboard group.
Declaration
public static VirtualKeyboardLayout CreateDefaultNumpadLayout()
Returns
VirtualKeyboardLayout
The created instance. |
CreateExtendedKeyboardLayoutPanel(Boolean)
Creates a new instance of the VirtualKeyboardLayoutPanel class with added buttons for extended keyboard layout.
Declaration
public static VirtualKeyboardLayoutPanel CreateExtendedKeyboardLayoutPanel(bool includeFunctionKeys = true)
Parameters
System.Boolean
includeFunctionKeys
A value indicating whether to include the function keys. |
Returns
VirtualKeyboardLayoutPanel
|
CreateFKeysLayout(Boolean)
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the function buttons keyboard group.
Declaration
public static VirtualKeyboardLayout CreateFKeysLayout(bool addEscapeKey = true)
Parameters
System.Boolean
addEscapeKey
A value indicating whether to include the escape key. |
Returns
VirtualKeyboardLayout
The created instance. |
CreateHomeGroupLayout(Boolean)
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the home buttons keyboard group.
Declaration
public static VirtualKeyboardLayout CreateHomeGroupLayout(bool addArrowKeys = true)
Parameters
System.Boolean
addArrowKeys
A value indicating whether to include the arrow keys. |
Returns
VirtualKeyboardLayout
The created instance. |
CreateKeyFactory()
Creates a new object used for KeyFactory.
Declaration
protected virtual IKeyFactory CreateKeyFactory()
Returns
IKeyFactory
The new instance. |
CreateMainButtonsKeyboardLayout(Boolean, Boolean)
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the main buttons keyboard group.
Declaration
public static VirtualKeyboardLayout CreateMainButtonsKeyboardLayout(bool addEscapeKey = true, bool addArrowKeys = false)
Parameters
System.Boolean
addEscapeKey
A value indicating whether to include the escape key on the first row. |
System.Boolean
addArrowKeys
A value indicating whether to include the arrow keys. |
Returns
VirtualKeyboardLayout
The created instance. |
CreateToggleKeyFactory()
Creates a new object used for ToggleKeyFactory.
Declaration
protected virtual IKeyFactory CreateToggleKeyFactory()
Returns
IKeyFactory
The new instance. |
CreateTraditionalNumpadLayout()
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the traditional numpad keyboard group.
Declaration
public static VirtualKeyboardLayout CreateTraditionalNumpadLayout()
Returns
VirtualKeyboardLayout
The created instance. |
GetAllKeys()
Gets a list with all IKey instances in this object and its children.
Declaration
public override IList<IKey> GetAllKeys()
Returns
System.Collections.Generic.IList<IKey>
The IList with all keys. |
Overrides
GetAllRows()
Gets a list with all Row instances in this object and its children.
Declaration
public override IList<Row> GetAllRows()
Returns
System.Collections.Generic.IList<Row>
The IList with all rows. |
Overrides
InitializeFields()
Initializes member fields to their default values. This method is called prior the CreateChildItems one and allows for initialization of members on which child elements depend.
Declaration
protected override void InitializeFields()
Overrides
MeasureOverride(SizeF)
Measures the space required by the VirtualKeyboardLayout
Used by the layout system.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
System.Drawing.SizeF
availableSize
The size that is available to the VirtualKeyboardLayout. The available size can be infinity (to take the full size of the element) |
Returns
System.Drawing.SizeF
The minimum size required by the element to be completely visible. Cannot be infinity. |
Overrides
Remarks
In this method call to the Measure method of each child must be made.
ResetLayout()
ShouldArrangeChild(RadElement)
Gets a value indicating, whether a child will be arranged during the ArrangeOverride.
Declaration
protected override bool ShouldArrangeChild(RadElement child)
Parameters
RadElement
child
The child. |
Returns
System.Boolean
Whether the child will be arranged in ArrangeOverride. |
Overrides
UpdateKeysLayout()
Updates the logical bounds of keys.
Declaration
public void UpdateKeysLayout()