Hi,
Do you want this to be in the place of the regular selection highlight of the icon, or in addition to?
Hi,
Try this:
[Serializable]
public class GoIconicNode3 : GoIconicNode {
protected override GoText CreateLabel(string name) {
GoText label = base.CreateLabel(name);
label.BackgroundColor = Color.Red;
label.BackgroundOpaqueWhenSelected = true;
return label;
}
public override GoObject SelectionObject {
get {
return this.Label;
}
}
}
Hi,
To do that, you either need to pop the node to the top of the default layer or create a new layer on top and move the selected items to that… here’s how to do the second of those:
Do this in your initialization for the view/document:
// create a layer in front to hold selected nodes
doc.Layers.CreateNewLayerAfter(doc.Layers.Default).Identifier = “selected”;
and add this to your node class:
// Move the object to the top layer, so it is visible to the user.
public override void OnGotSelection(GoSelection selection) {
this.Document.Layers.Top.Add(this);
base.OnGotSelection(selection);
}
// Move the object to the regular layer, where it can be obscured by selected nodes,
// unless this node is being deleted.
public override void OnLostSelection(GoSelection selection) {
if (!this.BeingRemoved)
this.Document.DefaultLayer.Add(this);
base.OnLostSelection(selection);
}
Hi Jake,