no more windows?
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace _2DGAMELIB;
|
||||
|
||||
@@ -18,8 +17,6 @@ public class Lab
|
||||
|
||||
private double Min;
|
||||
|
||||
private TextBox tb;
|
||||
|
||||
public ParT ParT => parT;
|
||||
|
||||
public string Text
|
||||
@@ -46,6 +43,7 @@ public class Lab
|
||||
|
||||
public Lab(Med Med, Are Are, string Name, ref Vector2D Position, double Size, double Width, Font Font, double TextSize, string Text, ref Color TextColor, ref Color ShadColor, ref Color BackColor, ref Color FramColor, bool Input)
|
||||
{
|
||||
//Note: Input is always false
|
||||
Setting(Med, Are, Name, ref Position, Size, Width, Font, TextSize, Text, ref TextColor, ref ShadColor, ref BackColor, ref FramColor, Input);
|
||||
}
|
||||
|
||||
@@ -60,45 +58,7 @@ public class Lab
|
||||
this.Are = Are;
|
||||
this.Width = Width;
|
||||
this.Input = Input;
|
||||
if (Input)
|
||||
{
|
||||
tb = new TextBox();
|
||||
tb.WordWrap = true;
|
||||
tb.Multiline = true;
|
||||
tb.Text = Text;
|
||||
tb.ForeColor = TextColor;
|
||||
tb.BackColor = Color.FromArgb(255, BackColor);
|
||||
tb.KeyUp += delegate
|
||||
{
|
||||
lock (Med.obj)
|
||||
{
|
||||
SetText(tb.Text);
|
||||
parT.Text = "";
|
||||
SetRectT();
|
||||
}
|
||||
};
|
||||
tb.KeyDown += delegate(object s, KeyEventArgs e)
|
||||
{
|
||||
lock (Med.obj)
|
||||
{
|
||||
if (e.KeyCode == Keys.Return)
|
||||
{
|
||||
//TODO fix?
|
||||
//this.Med.BaseControl.Controls.Remove(tb);
|
||||
SetText(tb.Text);
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
tb.PreviewKeyDown += delegate(object s, PreviewKeyDownEventArgs e)
|
||||
{
|
||||
e.IsInputKey = true;
|
||||
};
|
||||
//TODO fix?
|
||||
//Med.BaseControl.Controls.Add(tb);
|
||||
//Med.BaseControl.Controls.Remove(tb);
|
||||
//((Control)Med.BaseControl).Resize += Lab_Resize;
|
||||
}
|
||||
|
||||
Out[] array = new Out[1] { Shas.Get正方形() };
|
||||
if (FramColor == Color.Empty || FramColor == Color.Transparent)
|
||||
{
|
||||
@@ -132,7 +92,7 @@ public class Lab
|
||||
{
|
||||
//TODO fix?
|
||||
//Med.BaseControl.Controls.Remove(tb);
|
||||
SetText(tb.Text);
|
||||
//SetText(tb.Text);
|
||||
}
|
||||
|
||||
public void SetHitColor(Med Med)
|
||||
@@ -166,24 +126,27 @@ public class Lab
|
||||
|
||||
private void SetRectT()
|
||||
{
|
||||
/*
|
||||
double resMag = Med.ResMag;
|
||||
Vector2D vector2D = (parT.Position + Are.GetPosition()) * Med.Unit / resMag + Med.ResVector;
|
||||
|
||||
tb.Location = new Point((int)vector2D.X - 1, (int)vector2D.Y - 1);
|
||||
double num = parT.Size * Med.Unit;
|
||||
|
||||
if (tb.Font != null)
|
||||
{
|
||||
tb.Font.Dispose();
|
||||
}
|
||||
tb.Font = new Font(parT.Font.FontFamily, (float)(parT.FontSize * num / resMag));
|
||||
Vector2D vector2D2 = parT.RectSize * num / resMag;
|
||||
tb.Size = new Size((int)(vector2D2.X + 2.0), (int)(vector2D2.Y + 10.0));
|
||||
tb.Size = new Size((int)(vector2D2.X + 2.0), (int)(vector2D2.Y + 10.0));*/
|
||||
}
|
||||
|
||||
public bool Double(ref Color HitColor)
|
||||
{
|
||||
//TODO fix?
|
||||
//if (Input && parT.HitColor == HitColor && !Med.BaseControl.Controls.Contains(tb))
|
||||
{
|
||||
/*{
|
||||
tb.Text = parT.Text;
|
||||
parT.Text = "";
|
||||
SetRectT();
|
||||
@@ -192,18 +155,18 @@ public class Lab
|
||||
tb.Focus();
|
||||
tb.BringToFront();
|
||||
return true;
|
||||
}
|
||||
}*/
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Click(ref Color HitColor)
|
||||
{
|
||||
//TODO fix?
|
||||
//if (Input && parT.HitColor != HitColor && Med.BaseControl.Controls.Contains(tb))
|
||||
/*if (Input && parT.HitColor != HitColor && Med.BaseControl.Controls.Contains(tb))
|
||||
{
|
||||
//Med.BaseControl.Controls.Remove(tb);
|
||||
SetText(tb.Text);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
@@ -214,9 +177,5 @@ public class Lab
|
||||
//TODO fix?
|
||||
//((Control)Med.BaseControl).Resize -= Lab_Resize;
|
||||
}
|
||||
if (tb != null)
|
||||
{
|
||||
tb.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user