forked from ReClassNET/ReClass.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseNumericNode.cs
More file actions
53 lines (44 loc) · 1.64 KB
/
BaseNumericNode.cs
File metadata and controls
53 lines (44 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Diagnostics.Contracts;
using System.Drawing;
using ReClassNET.UI;
namespace ReClassNET.Nodes
{
public abstract class BaseNumericNode : BaseNode
{
/// <summary>Draws the node.</summary>
/// <param name="view">The view information.</param>
/// <param name="x">The x coordinate.</param>
/// <param name="y">The y coordinate.</param>
/// <param name="icon">The icon of the node.</param>
/// <param name="type">The type of the node.</param>
/// <param name="value">The value of the node.</param>
/// <returns>The height the node occupies.</returns>
protected int DrawNumeric(ViewInfo view, int x, int y, Image icon, string type, string value)
{
Contract.Requires(view != null);
Contract.Requires(icon != null);
Contract.Requires(type != null);
Contract.Requires(value != null);
if (IsHidden)
{
return DrawHidden(view, x, y);
}
AddSelection(view, x, y, view.Font.Height);
AddDelete(view, x, y);
AddTypeDrop(view, x, y);
x = x + TextPadding;
x = AddIcon(view, x, y, icon, HotSpot.NoneId, HotSpotType.None);
x = AddAddressOffset(view, x, y);
x = AddText(view, x, y, Program.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width;
x = AddText(view, x, y, Program.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width;
x = AddText(view, x, y, Program.Settings.NameColor, HotSpot.NoneId, "=") + view.Font.Width;
x = AddText(view, x, y, Program.Settings.ValueColor, 0, value) + view.Font.Width;
AddComment(view, x, y);
return y + view.Font.Height;
}
public override int CalculateHeight(ViewInfo view)
{
return IsHidden ? HiddenHeight : view.Font.Height;
}
}
}