public ExpressionConditionNode(ConditionDesigner designer, CompoudConditionNode parent) : base(designer, parent) { LeftExpr = new ConditionExpressionDesigner(this, true); m_disposeList.Add(LeftExpr); Operator = new ComboBox(); m_disposeList.Add(Operator); Designer.Parent.Controls.Add(Operator); string lastgrp = null; foreach (var edef in ConditionOperatorDef.CreateConditions(this)) { if (lastgrp == null || edef.Factory.Group != lastgrp) { lastgrp = edef.Factory.Group; Operator.Items.Add(Texts.Get(lastgrp)); } Operator.Items.Add(edef); m_disposeList.Add(edef); edef.Hide(); } Operator.SelectedIndex = 1; Operator.DropDownStyle = ComboBoxStyle.DropDownList; Operator.SelectedIndexChanged += new EventHandler(Operator_SelectedIndexChanged); }
public override void AssignFrom(ConditionOperatorDef src) { if (src is ValueListExprDef) { Values.Text = ((ValueListExprDef)src).Values.Text; } }
public override void AssignFrom(ConditionOperatorDef src) { if (src is SingleValueExprDef) { Expr.Edit.Text = ((SingleValueExprDef)src).Expr.Edit.Text; } }
public override void AssignFrom(ConditionOperatorDef src) { if (src is DoubleValueExprDef) { Expr1.Edit.Text = ((DoubleValueExprDef)src).Expr1.Edit.Text; Expr2.Edit.Text = ((DoubleValueExprDef)src).Expr2.Edit.Text; } }
protected override void UpdatePlacements_Specific(ref int actx, int acty, ref int linehi, string namePrefix) { LeftExpr.UpdatePlacement(ref actx, acty); Operator.Width = 200; Operator.Top = acty; Operator.Left = actx; actx += Operator.Width; if (m_lastExpr != Operator.SelectedItem && m_lastExpr != null) { m_lastExpr.Hide(); } var newexpr = (ConditionOperatorDef)Operator.SelectedItem; if (m_lastExpr != null && newexpr != null) { newexpr.AssignFrom(m_lastExpr); } m_lastExpr = newexpr; if (m_lastExpr != null) { m_lastExpr.UpdatePlacements(ref actx, acty, ref linehi); } }
public override void AssignFrom(ConditionOperatorDef src) { }
public abstract void AssignFrom(ConditionOperatorDef src);