47 lines
1.7 KiB
C#
47 lines
1.7 KiB
C#
using System;
|
|
|
|
namespace UnityEngine.Experimental.UIElements
|
|
{
|
|
// Token: 0x02000329 RID: 809
|
|
internal abstract class IMTextField : IMElement
|
|
{
|
|
// Token: 0x17000B89 RID: 2953
|
|
// (get) Token: 0x060032F4 RID: 13044 RVA: 0x0004EBA4 File Offset: 0x0004CDA4
|
|
// (set) Token: 0x060032F5 RID: 13045 RVA: 0x0004EBC0 File Offset: 0x0004CDC0
|
|
public TextEditor editor { get; protected set; }
|
|
|
|
// Token: 0x17000B8A RID: 2954
|
|
// (get) Token: 0x060032F6 RID: 13046 RVA: 0x0004EBCC File Offset: 0x0004CDCC
|
|
// (set) Token: 0x060032F7 RID: 13047 RVA: 0x0004EBE8 File Offset: 0x0004CDE8
|
|
public int maxLength { get; set; }
|
|
|
|
// Token: 0x17000B8B RID: 2955
|
|
// (get) Token: 0x060032F8 RID: 13048 RVA: 0x0004EBF4 File Offset: 0x0004CDF4
|
|
// (set) Token: 0x060032F9 RID: 13049 RVA: 0x0004EC10 File Offset: 0x0004CE10
|
|
public bool multiline { get; set; }
|
|
|
|
// Token: 0x060032FA RID: 13050 RVA: 0x0004EC1C File Offset: 0x0004CE1C
|
|
protected override int DoGenerateControlID()
|
|
{
|
|
return GUIUtility.GetControlID("IMTextField".GetHashCode(), base.focusType, base.position);
|
|
}
|
|
|
|
// Token: 0x060032FB RID: 13051 RVA: 0x0004EC4C File Offset: 0x0004CE4C
|
|
protected void SyncTextEditor()
|
|
{
|
|
if (this.maxLength >= 0 && base.text != null && base.text.Length > this.maxLength)
|
|
{
|
|
base.text = base.text.Substring(0, this.maxLength);
|
|
}
|
|
this.editor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), base.id);
|
|
this.editor.text = base.text;
|
|
this.editor.SaveBackup();
|
|
this.editor.position = base.position;
|
|
this.editor.style = base.style;
|
|
this.editor.multiline = this.multiline;
|
|
this.editor.controlID = base.id;
|
|
this.editor.DetectFocusChange();
|
|
}
|
|
}
|
|
}
|