public TFlag AddFlag(TFlagShape AFlag, TBaseShape AShape, TRectLine ALine, int APosition, ref bool AFlagExits) { TFlag Member; TBaseLine MLine; int APos; AFlagExits = true; for (int i = List.Count - 1; i >= 0; i--) { Member = (TFlag)(List.ElementAt(i)); if (Member.Flag == AFlag) { return(Member); } } Member = new TFlag(); Member.Position = APosition; Member.Shape = AShape; Member.Line = ALine; Member.Flag = AFlag; List.Add(Member); AFlagExits = false; return(Member); }
public int NilFlag(TFlagShape AFlag) { if (AFlag == null) { return(-1); } if (AFlag == F_FlagS) { F_FlagS = null; F_DrawFlagS = false; return(0); } if (AFlag == F_Flag) { F_Flag = null; F_DrawFlag = false; return(1); } if (AFlag == F_FlagE) { F_FlagE = null; F_DrawFlagE = false; return(2); } return(-1); }
public TFlag() { F_Position = -1; F_Shape = null; F_Line = null; F_Flag = null; }
void SetDrawFlag(bool Value) { int pos = 1; F_DrawFlag = Value; if (F_DrawFlag && (F_Flag == null)) { F_Flag = new TFlagShape(F_Step, this, 0); F_Flag.LEControl = true; // F_Flag.WndHandler = F_WndHandler; F_Flag.BrushColor = F_FlagColor; if (FOnFlagCreate != null) { OnFlagCreate(this, F_Flag, pos); } } if ((F_DrawFlag) && (F_Flag != null)) { if (FOnFlagDestroy != null) { OnFlagDestroy(this, F_Flag, pos); } F_Flag = null; } }
void FlagDestroy(TRectLine ASender, TFlagShape AFlag, int APosFlag) { TFlag Flag = ListFlag.DeleteFlagByShape(AFlag); if (Flag != null && FOnWSFlagDestroy != null) { OnWSFlagDestroy(Flag, this); } }
public void FlagDestroy(TBaseLine ASender, TFlagShape AFlag, int APosFlag) { if (APosFlag == 1) { F_MiddleFlag = null; } if (FOnRctFlagDestroy != null) { FOnRctFlagDestroy(this, AFlag, APosFlag); } }
public void FlagCreate(TBaseLine ASender, TFlagShape AFlag, int APosFlag) { if (APosFlag == 1) { F_MiddleFlag = AFlag; } if (FOnRctFlagCreate != null) { FOnRctFlagCreate(this, AFlag, APosFlag); } }
/* void DoSetFlag(); * void DoSetFlagS(); * void DoSetFlagE();*/ void FlagCreate(TRectLine ASender, TFlagShape AFlag, int APosFlag) { bool res = false; TBaseShape Shape = GetShapeByLine(ASender, APosFlag); TFlag Flag = ListFlag.AddFlag(AFlag, Shape, ASender, APosFlag, ref res); if (!res && FOnWSFlagCreate != null) { OnWSFlagCreate(Flag, this); } }
public TFlag DeleteFlagByShape(TFlagShape AFlag) { TFlag Member, Res = null; for (int i = List.Count - 1; i >= 0; i--) { Member = (TFlag)(List.ElementAt(i)); if (Member.Flag == AFlag) { List.RemoveAt(i); } } return(Res); }
// public: public TBaseLine(int x0, int y0, int x1, int y1, int step) { ApplyCoord(x0, y0, x1, y1); Pen = new Pen(Color.Black); // OldPenParent = new Graphics::TPen; F_Step = step; F_Flag = null; F_FlagS = null; F_FlagE = null; F_DrawFlag = false; F_DrawFlagS = false; F_DrawFlagE = false; F_FlagColor = Color.White; F_DrawFlagS = false; F_FlagSColor = Color.White; F_DrawFlagE = false; F_FlagEColor = Color.White; F_FlagType = 0; F_FlagSType = 0; F_FlagEType = 0; F_FlagRadius = 0.7; F_FlagSRadius = 0.7; F_FlagERadius = 0.7; // F_WndHandler = 0; F_UnderControl = null; F_Visible = true; FOnFlagCreate = null; FOnFlagDestroy = null; FOnFlagImport = null; f_LEControl = false; f_Tag = 0; f_Tag2 = 0; }
void FlagImport(TBaseLine ASource, TBaseLine ADest, TFlagShape AFlag, int APosFlag) { ASource.NilFlag(AFlag); }
public bool ImportFlag(TFlagShape AFlag, int APos, int ATypeFlag, double ARadius, Color ABrushColor) { if ((APos > 2) || (APos < 0)) { return(false); } if (AFlag == null) { return(false); } if (APos == 0) { if (F_FlagS == AFlag) { return(true); } F_FlagS = AFlag; F_FlagSType = ATypeFlag; F_FlagSRadius = ARadius; if (FOnFlagImport != null) { OnFlagImport(AFlag.Owner, this, AFlag, 0); } AFlag.Owner = this; } if (APos == 1) { if (F_Flag == AFlag) { return(true); } F_Flag = AFlag; F_FlagType = ATypeFlag; F_FlagRadius = ARadius; F_FlagColor = ABrushColor; if (FOnFlagImport != null) { OnFlagImport(AFlag.Owner, this, AFlag, 1); } AFlag.Owner = this; } if (APos == 2) { if (F_FlagE == AFlag) { return(true); } F_FlagE = AFlag; F_FlagEType = ATypeFlag; F_FlagERadius = ARadius; F_FlagEColor = ABrushColor; if (FOnFlagImport != null) { OnFlagImport(AFlag.Owner, this, AFlag, 2); } AFlag.Owner = this; } return(true); }