Hi Guys,
To be clear, you don’t want highlit items to be deleted or copied or dragged around independently from the whole CollapsingRecordNode, right?
So the first step is to set this.Selectable = false in the CollapsingRecordNodeItem and CollapsingRecordNodeItemList constructors. That way when the user clicks on any item, only the whole node is selected.
The second step is to change the appearance of the items when the user clicks on it. Add this override to CollapsingRecordNodeItem:
public override bool OnSingleClick(GoInputEventArgs evt, GoView view) {
if (myAppearanceSaved)
RemoveSelectionHandles(view.Selection);
else
AddSelectionHandles(view.Selection, this);
return true;
}
You didn’t say whether when the whole node loses selection whether the items should not appear highlit. If you do want that, that’s easy enough too. Just add an OnLostSelection override in CollapsingRecordNode:
[code] public override void OnLostSelection(GoSelection sel) {
base.OnLostSelection(sel);
RemoveAppearances(this.List, sel);
}
private void RemoveAppearances(CollapsingRecordNodeItemList list, GoSelection sel) {
foreach (GoObject o in list) {
CollapsingRecordNodeItem item = o as CollapsingRecordNodeItem;
if (item != null) {
item.RemoveAppearance(sel);
} else {
CollapsingRecordNodeItemList l = o as CollapsingRecordNodeItemList;
if (l != null) RemoveAppearances(l, sel);
}
}
}[/code]
and the additional method in CollapsingRecordNodeItem:
public void RemoveAppearance(GoSelection sel) {
if (myAppearanceSaved) RemoveSelectionHandles(sel);
}
Thanks Walter,