public void Redraw() { if (frame.Child != null) { frame.Child.Destroy(); } if (frame.LabelWidget != null) { frame.LabelWidget.Destroy(); } frame.Add(obj.GetCellContents(context)); frame.LabelWidget = obj.GetHeader(context); ShowAll(); redrawQueued = false; }
public Cell(Context context, IGUIComplete obj) : base(obj, context) { //Basic setup this.obj = obj; frame = new Frame(); Child = frame; prelight = false; MyDragDrop.SourceSet(this, obj); // "Removing by dragging away to nothing" functionality should be implemented manually when the Cell is created. // It should be implemented via MyDragDrop.SourceSetFailAction // The object should generally be removed from the parent list ONLY in this case. // Rationale for removing only if drag had no target: // - If cellObject is dragged from an aggregative list to another aggregative list, // the Add() function on the second automatically removes it from the first, so calling Remove() is unnecessary. // - If cellObject is dragged from an associative list to an aggregative list or vice versa, // We reasonably assume that user doesn't want it removed from the first list since the concept of "moving" doesn't apply in this context. // - Only if the user has dragged cellObject from any list to *nothing* can it be assumed that they need it manually removed by us. frame.Add(obj.GetCellContents(this.context)); frame.LabelWidget = obj.GetHeader(this.context); InspectableBox inspectableBox = frame.LabelWidget as InspectableBox; ShowAll(); }