Skip to content

Commit 5096740

Browse files
committed
dnd fix, changed 'UWF_' to 'uwf', license update
1 parent 4ee8c2b commit 5096740

23 files changed

+199
-517
lines changed

LICENSE.txt

Lines changed: 19 additions & 339 deletions
Large diffs are not rendered by default.

System/Drawing/Graphics.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public sealed class Graphics : IDeviceContext, IDisposable
2525
internal Rectangle Group { get; set; }
2626
internal void GroupBegin(Control groupControl)
2727
{
28-
var c_position = Control.Location + Control.UWF_Offset;//Control.PointToScreen(Point.Zero);
28+
var c_position = Control.Location + Control.uwfOffset;//Control.PointToScreen(Point.Zero);
2929
GUI.BeginGroup(new Rect((c_position.X + Group.X), (c_position.Y + Group.Y), Group.Width, Group.Height));
3030
_groupControls.Add(groupControl);
3131
}
@@ -160,7 +160,7 @@ public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
160160

161161
if (x1 != x2 && y1 != y2)
162162
{
163-
Control.UWF_Batches++;
163+
Control.uwfBatches++;
164164

165165
float xDiff = x2 - x1;
166166
float yDiff = y2 - y1;
@@ -208,7 +208,7 @@ public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
208208
switch (pen.DashStyle)
209209
{
210210
case Drawing2D.DashStyle.Solid:
211-
if (Control != null) Control.UWF_Batches++;
211+
if (Control != null) Control.uwfBatches++;
212212
GUI.DrawTexture(new Rect(x, y, width, height), System.Windows.Forms.ApplicationBehaviour.DefaultSprite);
213213
break;
214214
case Drawing2D.DashStyle.Dash:
@@ -219,7 +219,7 @@ public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
219219
float dash_width = dash_step - 2;
220220
if (i + dash_width > width)
221221
dash_width = width - i;
222-
if (Control != null) Control.UWF_Batches++;
222+
if (Control != null) Control.uwfBatches++;
223223
GUI.DrawTexture(new Rect(x + i, y, dash_width, pen.Width), System.Windows.Forms.ApplicationBehaviour.DefaultSprite);
224224
}
225225

@@ -229,7 +229,7 @@ public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
229229
float dash_height = dash_step - 2;
230230
if (i + dash_height > height)
231231
dash_height = height - i;
232-
if (Control != null) Control.UWF_Batches++;
232+
if (Control != null) Control.uwfBatches++;
233233
GUI.DrawTexture(new Rect(x + width - pen.Width, y + i, pen.Width, dash_height), System.Windows.Forms.ApplicationBehaviour.DefaultSprite);
234234
}
235235
break;
@@ -349,22 +349,22 @@ public void DrawRectangle(Color color, float x, float y, float width, float heig
349349
GUI.color = color.ToUColor();
350350

351351
if (Control != null)
352-
Control.UWF_Batches += 2;
352+
Control.uwfBatches += 2;
353353

354354
GUI.DrawTexture(new Rect(x, y, width, 1), System.Windows.Forms.ApplicationBehaviour.DefaultSprite);
355355
GUI.DrawTexture(new Rect(x + width - 1, y + 1, 1, height - 2), System.Windows.Forms.ApplicationBehaviour.DefaultSprite);
356356
FillRate += width + height - 2;
357357
if (height > 1)
358358
{
359359
if (Control != null)
360-
Control.UWF_Batches++;
360+
Control.uwfBatches++;
361361
GUI.DrawTexture(new Rect(x, y + height - 1, width, 1), System.Windows.Forms.ApplicationBehaviour.DefaultSprite);
362362
FillRate += width * 1 + 1;
363363
}
364364
if (width > 1)
365365
{
366366
if (Control != null)
367-
Control.UWF_Batches++;
367+
Control.uwfBatches++;
368368
GUI.DrawTexture(new Rect(x, y + 1, 1, height - 2), System.Windows.Forms.ApplicationBehaviour.DefaultSprite);
369369
FillRate += height - 2;
370370
}
@@ -387,22 +387,22 @@ public void DrawRectangle(Pen pen, float x, float y, float width, float height)
387387
{
388388
case Drawing2D.DashStyle.Solid:
389389
if (Control != null)
390-
Control.UWF_Batches += 2;
390+
Control.uwfBatches += 2;
391391

392392
GUI.DrawTexture(new Rect(x, y, width, pen.Width), System.Windows.Forms.ApplicationBehaviour.DefaultSprite);
393393
GUI.DrawTexture(new Rect(x + width - pen.Width, y + pen.Width, pen.Width, height - pen.Width * 2), System.Windows.Forms.ApplicationBehaviour.DefaultSprite);
394394
FillRate += width * pen.Width + pen.Width * (height - pen.Width * 2);
395395
if (height > 1)
396396
{
397397
if (Control != null)
398-
Control.UWF_Batches++;
398+
Control.uwfBatches++;
399399
GUI.DrawTexture(new Rect(x, y + height - pen.Width, width, pen.Width), System.Windows.Forms.ApplicationBehaviour.DefaultSprite);
400400
FillRate += width * pen.Width + pen.Width;
401401
}
402402
if (width > 1)
403403
{
404404
if (Control != null)
405-
Control.UWF_Batches++;
405+
Control.uwfBatches++;
406406
GUI.DrawTexture(new Rect(x, y + pen.Width, pen.Width, height - pen.Width * 2), System.Windows.Forms.ApplicationBehaviour.DefaultSprite);
407407
FillRate += pen.Width * (height - pen.Width * 2);
408408
}
@@ -416,7 +416,7 @@ public void DrawRectangle(Pen pen, float x, float y, float width, float height)
416416
if (i + dash_width > width)
417417
dash_width = width - i;
418418
if (Control != null)
419-
Control.UWF_Batches += 2;
419+
Control.uwfBatches += 2;
420420
GUI.DrawTexture(new Rect(x + i, y, dash_width, pen.Width), System.Windows.Forms.ApplicationBehaviour.DefaultSprite); // Top.
421421
GUI.DrawTexture(new Rect(x + i, y + height - pen.Width, dash_width, pen.Width), System.Windows.Forms.ApplicationBehaviour.DefaultSprite); // Bottom.
422422
FillRate += dash_width * pen.Width * 2;
@@ -427,7 +427,7 @@ public void DrawRectangle(Pen pen, float x, float y, float width, float height)
427427
if (i + dash_height > height)
428428
dash_height = height - i;
429429
if (Control != null)
430-
Control.UWF_Batches += 2;
430+
Control.uwfBatches += 2;
431431
GUI.DrawTexture(new Rect(x + width - pen.Width, y + i, pen.Width, dash_height), System.Windows.Forms.ApplicationBehaviour.DefaultSprite); // Right.
432432
GUI.DrawTexture(new Rect(x, y + i, pen.Width, dash_height), System.Windows.Forms.ApplicationBehaviour.DefaultSprite); // Left.
433433
FillRate += pen.Width * dash_height * 2;
@@ -470,7 +470,7 @@ public void DrawString(string s, Font font, Color color, float x, float y, float
470470
if (string.IsNullOrEmpty(s)) return;
471471

472472
if (Control != null)
473-
Control.UWF_Batches += 1;
473+
Control.uwfBatches += 1;
474474
FillRate += width * height;
475475

476476
GUI.skin.label.alignment = TextAnchor.UpperLeft;
@@ -583,7 +583,7 @@ public string DrawTextArea(string s, Font font, Color color, float x, float y, f
583583
if (Control == null) return s;
584584
if (s == null) s = "";
585585

586-
Control.UWF_Batches++;
586+
Control.uwfBatches++;
587587

588588
GUI.skin.textArea.alignment = TextAnchor.UpperLeft;
589589

@@ -619,7 +619,7 @@ public string DrawTextField(string s, Font font, Color color, float x, float y,
619619
if (Control == null) return s;
620620
if (s == null) s = "";
621621

622-
Control.UWF_Batches++;
622+
Control.uwfBatches++;
623623

624624
GUI.skin.textField.alignment = TextAnchor.UpperLeft;
625625
switch (alignment)
@@ -681,7 +681,7 @@ public void DrawTexture(Texture texture, float x, float y, float width, float he
681681
if (texture == null) return;
682682

683683
if (Control != null)
684-
Control.UWF_Batches++;
684+
Control.uwfBatches++;
685685

686686
FillRate += width * height;
687687

@@ -705,7 +705,7 @@ public void DrawTexture(Texture texture, float x, float y, float width, float he
705705
{
706706
if (Control == null) return;
707707

708-
Control.UWF_Batches++;
708+
Control.uwfBatches++;
709709
FillRate += width * height;
710710

711711
mat.color = color.ToUColor();
@@ -775,7 +775,7 @@ public void FillRectangle(Color color, float x, float y, float width, float heig
775775
if (color.A <= 0) return;
776776

777777
if (Control != null)
778-
Control.UWF_Batches += 1;
778+
Control.uwfBatches += 1;
779779
FillRate += width * height;
780780

781781
GUI.color = color.ToUColor();

System/Windows/Forms/Application.cs

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ namespace System.Windows.Forms
1010
{
1111
public class Application
1212
{
13-
private static bool _dragndrop;
14-
private static object _dragData;
13+
internal static bool _dragndrop;
14+
internal static object _dragData;
1515
private static DragDropEffects _dragControlEffects;
1616
private static DragDropRenderHandler _dragRender;
1717
private static KeyCode _currentKeyDown = KeyCode.None;
@@ -118,12 +118,12 @@ private static Control FindControlAt(Control currentControl, System.Drawing.Poin
118118
internal static bool ControlIsVisible(Control control)
119119
{
120120
if (control.Visible == false) return false;
121-
if (control.Location.X + control.UWF_Offset.X + control.Width < 0) return false;
122-
if (control.Location.Y + control.UWF_Offset.Y + control.Height < 0) return false;
121+
if (control.Location.X + control.uwfOffset.X + control.Width < 0) return false;
122+
if (control.Location.Y + control.uwfOffset.Y + control.Height < 0) return false;
123123
if (control.Parent != null)
124124
{
125-
if (control.Location.X + control.UWF_Offset.X > control.Parent.Width) return false;
126-
if (control.Location.Y + control.UWF_Offset.Y > control.Parent.Height) return false;
125+
if (control.Location.X + control.uwfOffset.X > control.Parent.Width) return false;
126+
if (control.Location.Y + control.uwfOffset.Y > control.Parent.Height) return false;
127127
}
128128
return true;
129129
}
@@ -278,6 +278,7 @@ private static bool _ProcessControl(System.Drawing.PointF mousePosition, Control
278278
}
279279
_dragData = null;
280280
_dragndrop = false;
281+
return true;
281282
}
282283
MouseEventArgs mu_args = new MouseEventArgs(_mouseButton, 1, (int)client_mpos.X, (int)client_mpos.Y, 0);
283284
control.RaiseOnMouseUp(mu_args);
@@ -580,7 +581,7 @@ public void ProccessMouse(float mouseX, float mouseY)
580581
// Dispose context first.
581582
for (int i = 0; i < Contexts.Count; i++)
582583
{
583-
if (!Contexts[i].UWF_Context) continue;
584+
if (!Contexts[i].uwfContext) continue;
584585

585586
var contextControl = Contexts[i];
586587
if (Contains(contextControl, hoveredControl)) continue;
@@ -618,7 +619,7 @@ public void RaiseMouseEvent(MouseEvents mEv, MouseEventArgs mArgs)
618619
}
619620
public void Run(Control control)
620621
{
621-
control.UWF_AppOwner = this;
622+
control.uwfAppOwner = this;
622623
//this.Controls.Add(control);
623624
}
624625
public void Update()
@@ -712,7 +713,7 @@ public void Update()
712713

713714
UpdateEvent();
714715
}
715-
716+
716717
internal static void DoDragDrop(object data, DragDropEffects effect, DragDropRenderHandler render = null)
717718
{
718719
_dragData = data;
@@ -753,13 +754,10 @@ public static void NextTabControl(Control control)
753754
_FillListWithVisibleControls(controlForm, formControls);
754755

755756
var possibleControls = formControls.FindAll(x => x.IsDisposed == false && x.CanSelect && x.TabStop);
756-
if (possibleControls.Find(x => x.TabIndex > 0) != null)
757-
{
758-
possibleControls.Sort((x, y) => x.TabIndex.CompareTo(y.TabIndex));
759-
//possibleControls.Reverse();
760-
}
761757
if (possibleControls.Count == 0) return;
762758

759+
possibleControls.Sort((x, y) => x.TabIndex.CompareTo(y.TabIndex));
760+
763761
int controlIndex = possibleControls.FindIndex(x => x == control);
764762

765763
var nextControlIndex = controlIndex + 1;
@@ -776,13 +774,10 @@ public static void PrevTabControl(Control control)
776774
_FillListWithVisibleControls(controlForm, formControls);
777775

778776
var possibleControls = formControls.FindAll(x => x.Visible && x.IsDisposed == false && x.CanSelect && x.TabStop);
779-
if (possibleControls.Find(x => x.TabIndex > 0) != null)
780-
{
781-
possibleControls.Sort((x, y) => x.TabIndex.CompareTo(y.TabIndex));
782-
//possibleControls.Reverse();
783-
}
784777
if (possibleControls.Count == 0) return;
785778

779+
possibleControls.Sort((x, y) => x.TabIndex.CompareTo(y.TabIndex));
780+
786781
int controlIndex = possibleControls.FindIndex(x => x == control);
787782

788783
var nextControlIndex = controlIndex - 1;

System/Windows/Forms/ApplicationBehaviour.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ private void Update()
5454
(int)(_lastWidth - UnityEngine.Screen.width),
5555
(int)(_lastHeight - UnityEngine.Screen.height));
5656
for (int i = 0; i < _controller.ModalForms.Count; i++)
57-
_controller.ModalForms[i].UWF_AddjustSizeToScreen(deltaSize);
57+
_controller.ModalForms[i].uwfAddjustSizeToScreen(deltaSize);
5858
for (int i = 0; i < _controller.Forms.Count; i++)
59-
_controller.Forms[i].UWF_AddjustSizeToScreen(deltaSize);
59+
_controller.Forms[i].uwfAddjustSizeToScreen(deltaSize);
6060
_controller.UpdatePaintClipRect();
6161
}
6262
_lastWidth = UnityEngine.Screen.width;

System/Windows/Forms/BitmapLabel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ protected override void OnPaint(PaintEventArgs e)
5858
e.Graphics.FillRectangle(BackColor, 0, 0, Width, Height);
5959
e.Graphics.DrawTexture(bmText.uTexture, 0, 0, bmText.Width, bmText.Height, ForeColor);
6060
}
61-
protected override object UWF_OnPaintEditor(float width)
61+
protected override object uwfOnPaintEditor(float width)
6262
{
63-
var control = base.UWF_OnPaintEditor(width);
63+
var control = base.uwfOnPaintEditor(width);
6464

6565
Editor.NewLine(1);
6666

System/Windows/Forms/Button.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ protected override void OnPaint(PaintEventArgs e)
149149
Width - Padding.Left - Padding.Right,
150150
Height - Padding.Top - Padding.Bottom, TextAlign);
151151
}
152-
protected override object UWF_OnPaintEditor(float width)
152+
protected override object uwfOnPaintEditor(float width)
153153
{
154-
var control = base.UWF_OnPaintEditor(width);
154+
var control = base.uwfOnPaintEditor(width);
155155

156156
Editor.BeginVertical();
157157
Editor.NewLine(1);

System/Windows/Forms/ColorPicker.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public BrightnessSaturationPicker(int w, int h)
436436
_image = new Bitmap(w, h);
437437
_UpdateImage();
438438

439-
UWF_AppOwner.UpClick += Application_UpClick;
439+
uwfAppOwner.UpClick += Application_UpClick;
440440
}
441441

442442
void Application_UpClick(object sender, MouseEventArgs e)
@@ -497,7 +497,7 @@ public void SetHue(float value)
497497

498498
public override void Dispose()
499499
{
500-
UWF_AppOwner.UpClick -= Application_UpClick;
500+
uwfAppOwner.UpClick -= Application_UpClick;
501501
base.Dispose();
502502
}
503503
protected override void OnMouseDown(MouseEventArgs e)

System/Windows/Forms/ComboBox.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,9 @@ protected override void OnPaint(PaintEventArgs e)
301301
g.DrawTexture(ApplicationBehaviour.Resources.Images.CurvedArrowDown, Width - 16 - 1, Height / 2 - 8, 16, 16, arrowColor);
302302
g.DrawRectangle(borderColor, 0, 0, Width, Height);
303303
}
304-
protected override object UWF_OnPaintEditor(float width)
304+
protected override object uwfOnPaintEditor(float width)
305305
{
306-
var component = base.UWF_OnPaintEditor(width);
306+
var component = base.uwfOnPaintEditor(width);
307307

308308
#if UNITY_EDITOR
309309
Editor.NewLine(2);
@@ -356,12 +356,12 @@ private void CreateListBox(string listFilter)
356356
{
357357
listBox = new ListBox();
358358
listBox.Font = Font;
359-
listBox.UWF_Context = true;
359+
listBox.uwfContext = true;
360360
listBox.Width = Width;
361361
listBox.ItemHeight = ItemHeight;
362362
listBox.Height = listBox.ItemHeight * (Items.Count > MaxDropDownItems ? MaxDropDownItems : Items.Count);
363363
listBox.WrapText = false;
364-
listBox.UWF_ShadowBox = true;
364+
listBox.uwfShadowBox = true;
365365
listBox.BorderColor = listBox.BorderSelectColor;
366366
if (listBox.Height < listBox.ItemHeight) listBox.Height = listBox.ItemHeight;
367367

System/Windows/Forms/ContextMenuStrip.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public class ContextMenuStrip : ToolStripDropDownMenu
1212
public ContextMenuStrip()
1313
{
1414
BackColor = Color.FromArgb(246, 246, 246);
15-
UWF_Context = true;
16-
UWF_ShadowBox = true;
15+
uwfContext = true;
16+
uwfShadowBox = true;
1717
}
1818
}
1919
}

0 commit comments

Comments
 (0)