Skip to content

Commit 82ead06

Browse files
committed
Added BaseNode.IsWrapped.
1 parent d180bb7 commit 82ead06

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

ReClass.NET/Nodes/BaseNode.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ public abstract class BaseNode
4040
/// <summary>Gets or sets the parent node.</summary>
4141
public BaseContainerNode ParentNode { get; internal set; }
4242

43-
/// <summary>Gets or sets a value indicating whether this object is hidden.</summary>
43+
/// <summary>Gets or sets a value indicating whether this node is wrapped into an other node.</summary>
44+
public bool IsWrapped { get; internal set; }
45+
46+
/// <summary>Gets or sets a value indicating whether this node is hidden.</summary>
4447
public bool IsHidden { get; set; }
4548

46-
/// <summary>Gets or sets a value indicating whether this object is selected.</summary>
49+
/// <summary>Gets or sets a value indicating whether this node is selected.</summary>
4750
public bool IsSelected { get; set; }
4851

4952
/// <summary>Size of the node in bytes.</summary>
@@ -273,7 +276,7 @@ protected void AddSelection(ViewInfo view, int x, int y, int height)
273276
Contract.Requires(view != null);
274277
Contract.Requires(view.Context != null);
275278

276-
if (y > view.ClientArea.Bottom || y + height < 0)
279+
if (y > view.ClientArea.Bottom || y + height < 0 || IsWrapped)
277280
{
278281
return;
279282
}
@@ -286,7 +289,7 @@ protected void AddSelection(ViewInfo view, int x, int y, int height)
286289
}
287290
}
288291

289-
AddHotSpot(view, new Rectangle(0, y, view.ClientArea.Right - (IsSelected ? 16 : 0), height), string.Empty, -1, HotSpotType.Select);
292+
AddHotSpot(view, new Rectangle(0, y, view.ClientArea.Right - (IsSelected ? 16 : 0), height), string.Empty, HotSpot.NoneId, HotSpotType.Select);
290293
}
291294

292295
/// <summary>Draws an icon and adds a <see cref="HotSpot"/> if <paramref name="id"/> is not <see cref="HotSpot.NoneId"/>.</summary>
@@ -310,7 +313,7 @@ protected int AddIcon(ViewInfo view, int x, int y, Image icon, int id, HotSpotTy
310313

311314
view.Context.DrawImage(icon, x + 2, y, Icons.Dimensions, Icons.Dimensions);
312315

313-
if (id != -1)
316+
if (id != HotSpot.NoneId)
314317
{
315318
AddHotSpot(view, new Rectangle(x, y, Icons.Dimensions, Icons.Dimensions), string.Empty, id, type);
316319
}
@@ -344,7 +347,7 @@ protected void AddTypeDrop(ViewInfo view, int y)
344347
Contract.Requires(view != null);
345348
Contract.Requires(view.Context != null);
346349

347-
if (view.MultipleNodesSelected || (y > view.ClientArea.Bottom || y + Icons.Dimensions < 0))
350+
if (view.MultipleNodesSelected || y > view.ClientArea.Bottom || y + Icons.Dimensions < 0 || IsWrapped)
348351
{
349352
return;
350353
}
@@ -363,7 +366,7 @@ protected void AddDelete(ViewInfo view, int y)
363366
Contract.Requires(view != null);
364367
Contract.Requires(view.Context != null);
365368

366-
if (y > view.ClientArea.Bottom || y + Icons.Dimensions < 0)
369+
if (y > view.ClientArea.Bottom || y + Icons.Dimensions < 0 || IsWrapped)
367370
{
368371
return;
369372
}

ReClass.NET/Nodes/BaseNumericNode.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected Size DrawNumeric(ViewInfo view, int x, int y, Image icon, string type,
2222
Contract.Requires(type != null);
2323
Contract.Requires(value != null);
2424

25-
if (IsHidden)
25+
if (IsHidden && !IsWrapped)
2626
{
2727
return DrawHidden(view, x, y);
2828
}
@@ -39,7 +39,10 @@ protected Size DrawNumeric(ViewInfo view, int x, int y, Image icon, string type,
3939
x = AddAddressOffset(view, x, y);
4040

4141
x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width;
42-
x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width;
42+
if (!IsWrapped)
43+
{
44+
x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width;
45+
}
4346
x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NoneId, "=") + view.Font.Width;
4447
x = AddText(view, x, y, view.Settings.ValueColor, 0, value) + view.Font.Width;
4548
if (alternativeValue != null)

ReClass.NET/Nodes/BaseWrapperNode.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public void ChangeInnerNode(BaseNode node)
2626
{
2727
InnerNode = node;
2828

29+
node.IsWrapped = true;
30+
2931
InnerNodeChanged?.Invoke(this);
3032

3133
ParentNode?.ChildHasChanged(this);

0 commit comments

Comments
 (0)