7 [Obsolete($
"LegacyTextBoxWidget is obsolete, please use {nameof(LegacyTextBoxWidget)} instead.")]
35 public string Title {
get;
set; }
81 delegate(
string text) {
118 public event Action<LegacyTextBoxWidget>
Enter;
120 public event Action<LegacyTextBoxWidget>
Escape;
134 Title =
string.Empty;
142 if (
Input.LastChar.HasValue
144 && !
char.IsControl(
Input.LastChar.Value)) {
148 if (
Input.LastKey.HasValue) {
156 else if (value ==
Key.BackSpace
208 if (
Text.Length > 0) {
219 inputString =
string.Empty;
222 if (!
string.IsNullOrEmpty(inputString)) {
227 if (
Input.Click.HasValue) {
236 else if (
Input.IsKeyDownOnce(
Key.C)) {
239 else if (
Input.IsKeyDownOnce(
Key.X)) {
247 if (
Input.IsKeyDownRepeat(
Key.LeftArrow)) {
250 if (
Input.IsKeyDownRepeat(
Key.RightArrow)) {
253 if (
Input.IsKeyDownRepeat(
Key.UpArrow)) {
256 if (
Input.IsKeyDownRepeat(
Key.DownArrow)) {
259 if (
Input.IsKeyDownRepeat(
Key.Enter)) {
262 if (
Input.IsKeyDownRepeat(
Key.Escape)) {
269 foreach (
Widget widget
in widgets) {
276 textBox.HasFocus =
true;
299 if (!
string.IsNullOrEmpty(
m_text)) {
322 if (caretCenter.
X < 0f) {
326 m_scroll += caretCenter.X - ActualSize.X + 1f;
readonly DynamicArray< VertexPositionColor > TriangleVertices
void TransformTriangles(Matrix matrix, int start=0, int end=-1)
void TransformTriangles(Matrix matrix, int start=0, int end=-1)
readonly DynamicArray< VertexPositionColorTexture > TriangleVertices
static readonly DepthStencilState None
void QueueQuad(Vector2 corner1, Vector2 corner2, float depth, Color color)
void QueueText(string text, Vector2 position, float depth, Color color, TextAnchor anchor=TextAnchor.Default)
FlatBatch2D FlatBatch(int layer=0, DepthStencilState depthStencilState=null, RasterizerState rasterizerState=null, BlendState blendState=null)
FontBatch2D FontBatch(BitmapFont font=null, int layer=0, DepthStencilState depthStencilState=null, RasterizerState rasterizerState=null, BlendState blendState=null, SamplerState samplerState=null)
static SamplerState PointClamp
static SamplerState LinearClamp
static float Remainder(float x, float y)
static int Min(int x1, int x2)
static int Max(int x1, int x2)
static string ClipboardString
static object Get(Type type, string name)
Action< LegacyTextBoxWidget > Enter
Action< LegacyTextBoxWidget > Escape
Action< LegacyTextBoxWidget > TextChanged
Action< LegacyTextBoxWidget > FocusLost
override void MeasureOverride(Vector2 parentAvailableSize)
override void Draw(DrawContext dc)
void MoveNext(WidgetsList widgets)
static Screen CurrentScreen
readonly PrimitivesRenderer2D PrimitivesRenderer2D
static readonly Vector2 Zero