public GeneralLengthAction(LengthProperty lengthProperty, GeoPoint linePoint, GeoVector lineDirection, IGeoObject ignoreSnap) : this(lengthProperty, linePoint, lineDirection) { if (ignoreSnap != null) { base.IgnoreForSnap = new GeoObjectList(ignoreSnap); } }
public GeneralLengthAction(LengthProperty lengthProperty, GeoPoint linePoint, GeoVector lineDirection) { this.lengthProperty = lengthProperty; this.linePoint = linePoint; this.lineDirection = lineDirection; mode = Mode.fromLine; }
public GeneralLengthAction(LengthProperty lengthProperty, GeoPoint fixPoint, IGeoObject ignoreSnap) : this(lengthProperty, fixPoint) { if (ignoreSnap != null) { base.IgnoreForSnap = new GeoObjectList(ignoreSnap); } }
private void OnPropertySetDistance(LengthProperty sender, double l) { double oldLineDistance = lineDistance; lineDistance = l; FireDidChange("LineDistance", oldLineDistance); }
void OnSetWidth(LengthProperty sender, double l) { if (l != 0.0) { picture.SetWidth(l, keepAspectRatio.BooleanValue); } }
private void OnPropertySetMarginOffset(LengthProperty sender, double l) { double oldMarginOffset = marginOffset; marginOffset = l; FireDidChange("MarginOffset", oldMarginOffset); }
public ConstructDistanceOfCurve(LengthProperty lengthProperty) { this.lengthProperty = lengthProperty; if (lengthProperty != null) { cancelLength = lengthProperty.GetLength(); } measure = (lengthProperty == null); succeeded = false; }
private GeoVectorHotSpot dirWidthHotSpot, dirHeightHotSpot; // Hotspot für Richtung public ShowPropertyPicture(Picture picture, IFrame Frame) : base(Frame) { this.picture = picture; attributeProperties = picture.GetAttributeProperties(Frame); base.resourceId = "Picture.Object"; location = new GeoPointProperty("Picture.Location", Frame, true); location.GetGeoPointEvent += new CADability.UserInterface.GeoPointProperty.GetGeoPointDelegate(OnGetRefPoint); location.SetGeoPointEvent += new CADability.UserInterface.GeoPointProperty.SetGeoPointDelegate(OnSetRefPoint); location.ModifyWithMouseEvent += new ModifyWithMouseDelegate(OnModifyLocationWithMouse); width = new LengthProperty("Picture.Width", Frame, true); width.GetLengthEvent += new LengthProperty.GetLengthDelegate(OnGetWidth); width.SetLengthEvent += new LengthProperty.SetLengthDelegate(OnSetWidth); height = new LengthProperty("Picture.Height", Frame, true); height.GetLengthEvent += new LengthProperty.GetLengthDelegate(OnGetHeight); height.SetLengthEvent += new LengthProperty.SetLengthDelegate(OnSetHeight); dirWidth = new GeoVectorProperty("Picture.DirWidth", Frame, true); dirWidth.GetGeoVectorEvent += new GeoVectorProperty.GetGeoVectorDelegate(OnGetDirWidth); dirWidth.SetGeoVectorEvent += new GeoVectorProperty.SetGeoVectorDelegate(OnSetDirWidth); dirWidth.ModifyWithMouseEvent += new ModifyWithMouseDelegate(OnModifyDirWidthWithMouse); dirHeight = new GeoVectorProperty("Picture.DirHeight", Frame, true); dirHeight.GetGeoVectorEvent += new GeoVectorProperty.GetGeoVectorDelegate(OnGetDirHeight); dirHeight.SetGeoVectorEvent += new GeoVectorProperty.SetGeoVectorDelegate(OnSetDirHeight); dirHeight.ModifyWithMouseEvent += new ModifyWithMouseDelegate(OnModifyDirHeightWithMouse); path = new StringProperty(picture.Path, "Picture.Path"); path.GetStringEvent += new StringProperty.GetStringDelegate(OnGetPath); path.SetStringEvent += new StringProperty.SetStringDelegate(OnSetPath); path.SetContextMenu("MenuId.Picture.Path", this); keepAspectRatio = new BooleanProperty("Picture.KeepAspectRatio", "YesNo.Values"); double p = picture.DirectionWidth.Length / picture.Bitmap.Width * picture.Bitmap.Height / picture.DirectionHeight.Length; keepAspectRatio.BooleanValue = Math.Abs(1.0 - p) < 1e-6; keepAspectRatio.BooleanChangedEvent += new BooleanChangedDelegate(OnKeepAspectRatioChanged); rectangular = new BooleanProperty("Picture.Rectangular", "YesNo.Values"); rectangular.BooleanValue = Precision.IsPerpendicular(picture.DirectionWidth, picture.DirectionHeight, false); rectangular.BooleanChangedEvent += new BooleanChangedDelegate(OnRectangularChanged); dirWidthHotSpot = new GeoVectorHotSpot(dirWidth); dirWidthHotSpot.Position = picture.Location + picture.DirectionWidth; dirHeightHotSpot = new GeoVectorHotSpot(dirHeight); dirHeightHotSpot.Position = picture.Location + picture.DirectionHeight; }
private double OnPropertyGetMarginOffset(LengthProperty sender) { return(marginOffset); }
double OnGetHeight(LengthProperty sender) { return(picture.DirectionHeight.Length); }
set => SetValue(LengthProperty, value);
public ConstructDistanceTwoPoints(LengthProperty lengthProperty) { this.lengthProperty = lengthProperty; measure = (lengthProperty == null); succeeded = false; }
get => (double)GetValue(LengthProperty); set => SetValue(LengthProperty, value);
public GeneralLengthAction(LengthProperty lengthProperty, GeoPoint fixPoint) { this.lengthProperty = lengthProperty; this.fixPoint = fixPoint; mode = Mode.fromPoint; }
double OnGetWidth(LengthProperty sender) { return(picture.DirectionWidth.Length); }
private double OnPropertyGetDistance(LengthProperty sender) { return(lineDistance); }
private void OnSetLength(LengthProperty sender, double l) { string name = sender.UserData.GetData("Name") as string; namedValues[name] = l; }
private double OnGetLength(LengthProperty sender) { string name = sender.UserData.GetData("Name") as string; return (double)namedValues[name]; }
private Property parsePrimaryExpr() { Property prop; switch (currentToken) { case TOK_LPAR: next(); prop = parseAdditiveExpr(); expectRpar(); return(prop); case TOK_LITERAL: prop = new StringProperty(currentTokenValue); break; case TOK_NCNAME: prop = new NCnameProperty(currentTokenValue); break; case TOK_FLOAT: prop = new NumberProperty(ParseDouble(currentTokenValue)); break; case TOK_INTEGER: prop = new NumberProperty(Int32.Parse(currentTokenValue)); break; case TOK_PERCENT: double pcval = ParseDouble( currentTokenValue.Substring(0, currentTokenValue.Length - 1)) / 100.0; IPercentBase pcBase = this.propInfo.GetPercentBase(); if (pcBase != null) { if (pcBase.GetDimension() == 0) { prop = new NumberProperty(pcval * pcBase.GetBaseValue()); } else if (pcBase.GetDimension() == 1) { prop = new LengthProperty(new PercentLength(pcval, pcBase)); } else { throw new PropertyException("Illegal percent dimension value"); } } else { prop = new NumberProperty(pcval); } break; case TOK_NUMERIC: int numLen = currentTokenValue.Length - currentUnitLength; string unitPart = currentTokenValue.Substring(numLen); double numPart = ParseDouble(currentTokenValue.Substring(0, numLen)); Length length = null; if (unitPart.Equals(RELUNIT)) { length = new FixedLength(numPart, propInfo.currentFontSize()); } else { length = new FixedLength(numPart, unitPart); } if (length == null) { throw new PropertyException("unrecognized unit name: " + currentTokenValue); } else { prop = new LengthProperty(length); } break; case TOK_COLORSPEC: prop = new ColorTypeProperty(new ColorType(currentTokenValue)); break; case TOK_FUNCTION_LPAR: { IFunction function = (IFunction)functionTable[currentTokenValue]; if (function == null) { throw new PropertyException("no such function: " + currentTokenValue); } next(); propInfo.pushFunction(function); prop = function.Eval(parseArgs(function.NumArgs), propInfo); propInfo.popFunction(); return(prop); } default: throw new PropertyException("syntax error"); } next(); return(prop); }
private Property parsePrimaryExpr() { Property prop; switch (currentToken) { case TOK_LPAR: next(); prop = parseAdditiveExpr(); expectRpar(); return prop; case TOK_LITERAL: prop = new StringProperty(currentTokenValue); break; case TOK_NCNAME: prop = new NCnameProperty(currentTokenValue); break; case TOK_FLOAT: prop = new NumberProperty(ParseDouble(currentTokenValue)); break; case TOK_INTEGER: prop = new NumberProperty(Int32.Parse(currentTokenValue)); break; case TOK_PERCENT: double pcval = ParseDouble( currentTokenValue.Substring(0, currentTokenValue.Length - 1)) / 100.0; IPercentBase pcBase = this.propInfo.GetPercentBase(); if (pcBase != null) { if (pcBase.GetDimension() == 0) { prop = new NumberProperty(pcval * pcBase.GetBaseValue()); } else if (pcBase.GetDimension() == 1) { prop = new LengthProperty(new PercentLength(pcval, pcBase)); } else { throw new PropertyException("Illegal percent dimension value"); } } else { prop = new NumberProperty(pcval); } break; case TOK_NUMERIC: int numLen = currentTokenValue.Length - currentUnitLength; string unitPart = currentTokenValue.Substring(numLen); double numPart = ParseDouble(currentTokenValue.Substring(0, numLen)); Length length = null; if (unitPart.Equals(RELUNIT)) { length = new FixedLength(numPart, propInfo.currentFontSize()); } else { length = new FixedLength(numPart, unitPart); } if (length == null) { throw new PropertyException("unrecognized unit name: " + currentTokenValue); } else { prop = new LengthProperty(length); } break; case TOK_COLORSPEC: prop = new ColorTypeProperty(new ColorType(currentTokenValue)); break; case TOK_FUNCTION_LPAR: { IFunction function = (IFunction)functionTable[currentTokenValue]; if (function == null) { throw new PropertyException("no such function: " + currentTokenValue); } next(); propInfo.pushFunction(function); prop = function.Eval(parseArgs(function.NumArgs), propInfo); propInfo.popFunction(); return prop; } default: throw new PropertyException("syntax error"); } next(); return prop; }