Skip to content

Commit 9b082ed

Browse files
committed
Made info text selectable.
1 parent c1d00fc commit 9b082ed

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

Nodes/BaseFunctionPtrNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected int Draw(ViewInfo view, int x, int y, string type, string name)
6666
var symbol = symbols.GetSymbolString(value, module);
6767
if (!string.IsNullOrEmpty(symbol))
6868
{
69-
x = AddText(view, x, y, Program.Settings.OffsetColor, HotSpot.NoneId, symbol) + view.Font.Width;
69+
x = AddText(view, x, y, Program.Settings.OffsetColor, HotSpot.ReadOnlyId, symbol) + view.Font.Width;
7070
}
7171
}
7272
}

Nodes/BaseHexCommentNode.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalu
4444
var rtti = view.Memory.Process.ReadRemoteRuntimeTypeInformation(ivalue);
4545
if (!string.IsNullOrEmpty(rtti))
4646
{
47-
x = AddText(view, x, y, Program.Settings.OffsetColor, HotSpot.NoneId, rtti) + view.Font.Width;
47+
x = AddText(view, x, y, Program.Settings.OffsetColor, HotSpot.ReadOnlyId, rtti) + view.Font.Width;
4848
}
4949
}
5050

@@ -59,7 +59,7 @@ protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalu
5959
var symbol = symbols.GetSymbolString(ivalue, module);
6060
if (!string.IsNullOrEmpty(symbol))
6161
{
62-
x = AddText(view, x, y, Program.Settings.OffsetColor, HotSpot.NoneId, symbol) + view.Font.Width;
62+
x = AddText(view, x, y, Program.Settings.OffsetColor, HotSpot.ReadOnlyId, symbol) + view.Font.Width;
6363
}
6464
}
6565
}
@@ -73,12 +73,12 @@ protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalu
7373
if (data.Take(IntPtr.Size).InterpretAsUTF8().IsPrintableData())
7474
{
7575
var text = new string(Encoding.UTF8.GetChars(data).TakeWhile(c => c != 0).ToArray());
76-
x = AddText(view, x, y, Program.Settings.TextColor, HotSpot.NoneId, $"'{text}'") + view.Font.Width;
76+
x = AddText(view, x, y, Program.Settings.TextColor, HotSpot.ReadOnlyId, $"'{text}'") + view.Font.Width;
7777
}
7878
else if(data.Take(IntPtr.Size * 2).InterpretAsUTF16().IsPrintableData())
7979
{
8080
var text = new string(Encoding.Unicode.GetChars(data).TakeWhile(c => c != 0).ToArray());
81-
x = AddText(view, x, y, Program.Settings.TextColor, HotSpot.NoneId, $"L'{text}'") + view.Font.Width;
81+
x = AddText(view, x, y, Program.Settings.TextColor, HotSpot.ReadOnlyId, $"L'{text}'") + view.Font.Width;
8282
}
8383
}
8484

@@ -89,7 +89,7 @@ protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalu
8989
var info = reader.ReadNodeInfo(this, ivalue, view.Memory);
9090
if (info != null)
9191
{
92-
x = AddText(view, x, y, Program.Settings.PluginColor, HotSpot.NoneId, info) + view.Font.Width;
92+
x = AddText(view, x, y, Program.Settings.PluginColor, HotSpot.ReadOnlyId, info) + view.Font.Width;
9393
}
9494
}
9595
}

UI/HotSpot.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class HotSpot
2727
public const int AddressId = 100;
2828
public const int NameId = 101;
2929
public const int CommentId = 102;
30+
public const int ReadOnlyId = 999;
3031

3132
public int Id { get; set; }
3233
public HotSpotType Type { get; set; }

UI/MemoryViewControl.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ protected override void OnMouseDoubleClick(MouseEventArgs e)
381381
editBox.HotSpot = hotSpot;
382382
editBox.Visible = true;
383383

384+
editBox.ReadOnly = hotSpot.Id == HotSpot.ReadOnlyId;
385+
384386
break;
385387
}
386388
}
@@ -566,11 +568,6 @@ private void editBox_Committed(object sender, EventArgs e)
566568
var hotspot = hotspotTextBox.HotSpot;
567569
if (hotspot != null)
568570
{
569-
if (hotspot.Id == HotSpot.NameId && hotspot.Node is ClassNode)
570-
{
571-
// Check name
572-
}
573-
574571
hotspot.Node.Update(hotspot);
575572

576573
Invalidate();

0 commit comments

Comments
 (0)