public virtual bool associateImage(ImageWindow w) { if (w == null) { if (image == null) return true; w = image; if (!w.associateNode(null)) return false; image = null; } else { if (image != null) return false; if (!w.associateNode(this)) return false; image = w; } if (title != null && image != null) image.Text = title; return true; }
public DisplayNode(NodeDefinition nd, Network net, int instnc) : base(nd, net, instnc) { xpos = ypos = Utils.UnspecifiedPosition; width = height = Utils.UnspecifiedDimension; image = null; // It's makes no sense to even think about creating an image window // for a Display node in a macro. userSpecifiedWhere = net.IsMacro; title = null; panelAccessManager = null; }
public override bool associateImage(ImageWindow w) { bool result = base.associateImage(w); if (result && w != null) w.allowDirectInteraction(false); return result; }
/// <summary> /// Monitor the status of the WHERE param. If the tab is connected, then /// treat it as if the user had supplied a value. /// </summary> /// <param name="input"></param> /// <param name="index"></param> /// <param name="status"></param> protected override void ioParameterStatusChanged(bool input, int index, Node.NodeParameterStatusChange status) { // If Where is wired up, then treat it the way we treat a user supplied window. // This handles wiring, unwiring, and unsetting. The case of setting (thru // the cdb) is handled in this->setInputValue(). DisplayNodes still cling // tenaciously to their ImageWindows. If you run the net and dxui provides // an ImageWindow for the DisplayNode, you won't be able to flip the Where // param tab up and so dxui will always provide the ImageWindow and the only // way to get around that is to delete the DisplayNode and place a new one. if ((input) && (index == WHERE)) { if (status == NodeParameterStatusChange.ParameterArkAdded) { this.userSpecifiedWhere = true; if (this.image != null) { ImageWindow iw = this.image; this.image = null; if (iw.IsAnchor == false) iw = null; } } // Flipping the param tab up, might be considered a way to indicate // that userSpecifiedWhere should be reset to FALSE. This was not // the behavior in 3.1.2. // Set network dirty because changing userSpecifiedWhere requires // a call to DisplayNode::prepareToSend. // else if (status == NodeParameterStatusChange.ParameterArkRemoved) { this.userSpecifiedWhere = false; } else if (status == NodeParameterStatusChange.ParameterSetValueToDefaulting) { this.userSpecifiedWhere = false; this.getNetwork().setDirty(); } } base.ioParameterStatusChanged(input, index, status); }