/* public bool ReactMouse(TPoint APoint); * public void ApplyOffset(int Ax, int Ay);*/ public virtual bool CopyObject(TBaseShape ASource) { if (ASource == null) { return(false); } ASource.BrushColor = F_BrushColor; ASource.PenColor = F_PenColor; ASource.F_FrameColor = F_FrameColor; //цвет обрамляющего прямоугольника // ASource.F_Font.Assign(F_Font); ASource.F_PenWidth = F_PenWidth; // ширина пена ASource.F_PenStyle = F_PenStyle; //стиль пена ASource.F_BrushStyle = F_BrushStyle; //стиль браша ASource.Caption = F_Caption; //подпись фигуры ASource.F_PenMode = F_PenMode; ASource.F_Old_BrushColor = F_Old_BrushColor; ASource.F_Old_PenColor = F_Old_PenColor; ASource.F_Old_BrushStyle = F_Old_BrushStyle; // ASource.F_Old_Font.Assign(F_Old_Font); ASource.F_Old_PenWidth = F_Old_PenWidth; ASource.F_Old_PenStyle = F_Old_PenStyle; ASource.F_Old_PenMode = F_Old_PenMode; ASource.F_Id = F_Id; //номер фигуры ASource.F_DrawCaption = F_DrawCaption; ASource.F_FrameRect = F_FrameRect; ASource.F_Rect = F_Rect; ASource.F_Step = F_Step; ASource.F_TypeShape = F_TypeShape; ASource.F_RealRect = F_RealRect; //реальный пр¤моугольник рисовани¤ return(true); }
public TFlag() { F_Position = -1; F_Shape = null; F_Line = null; F_Flag = null; }
bool OPM_Inorder(object A) { TBaseShape m_A = (TBaseShape)(A); SharedConst.opt_sadacha.MassWork.Append((object)m_A.ID); return(true); }
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 TBaseShape CloneShape(TBaseShape ADest) { TBaseShape mShape = null; if (ADest == null) { return(null); } switch (ADest.TypeShape) { case 5: mShape = new TTfeRectShape(0, 0, 0, 0); break; case 6: mShape = new TTfeRhombShape(0, 0, 0, 0); break; case 7: mShape = new TTfeEllShape(0, 0, 0, 0); break; case 8: mShape = new TTfeHexahedronShape(0, 0, 0, 0); break; } if (mShape == null) { return(null); } mShape.Clon = ADest; ADest.CopyObject(mShape); return(mShape); }
public bool MakeFlagForShape(TBaseShape AShape, bool ACreate, int APos, int AType, Color AColor) { TRectLine Line; TBaseShape Shape; Shape = (TBaseShape)(GetWorkShape(0)); if (Shape != AShape) { return(false); } if (APos == 0) { Line = (TRectLine)(GetWorkLine(1)); Line.DrawFlagE = ACreate; Line.FlagEType = AType; Line.FlagEColor = AColor; Line.Prepare(); return(true); } if (APos == 1) { Line = (TRectLine)(GetWorkLine(2)); Line.DrawFlagS = ACreate; Line.FlagSType = AType; Line.FlagSColor = AColor; Line.Prepare(); return(true); } return(false); }
override public bool CopyObject(TBaseShape ASource) { /* base.CopyObject(ASource); * dynamic_cast<TTfeRhombShape)(ASource).TailLeft = F_TailLeft; * dynamic_cast<TTfeRhombShape)(ASource).TailTop = F_TailTop; * dynamic_cast<TTfeRhombShape)(ASource).TailBottom = F_TailBottom; * dynamic_cast<TTfeRhombShape)(ASource).TailRight = F_TailRight;*/ return(true); }
void ShapeCopy(TBaseShape Shape, int Num_Shape) { if (Num_Shape == 1) { Shape.PenColor = Color.Green; Shape.BrushColor = Color.Yellow; Shape.PenWidth = 2; // Shape.BrushStyle = bsSolid; } }
override public bool CopyObject(TBaseShape ASource) { base.CopyObject(ASource); /* (TTfeEllShape)(ASource).TailLeft = F_TailLeft; * (TTfeEllShape)(ASource).TailTop = F_TailTop; * (TTfeEllShape)(ASource).TailBottom = F_TailBottom; * (TTfeEllShape)(ASource).TailRight = F_TailRight;*/ return(true); }
TBaseShape GetWorkNode(int num) { TBaseShape N = null; if ((num >= 0) || (num < WorkShapes.Count)) { N = (TBaseShape)(WorkShapes.ElementAt(num)); } return(N); }
public TBaseShape GetWorkShape(int num) { TBaseShape Res = null; if ((num >= 0) || (num < WorkShapes.Count)) { Res = (TBaseShape)(WorkShapes.ElementAt(num)); } return(Res); }
public TPredicateTreeItem() { f_ParentID = 0; f_TypeWorkShape = 0; f_NumAlt = 0; f_BaseWorkShape = null; f_ParentShape = null; f_TReated = false; f_List = new TDynamicArray(); }
public TFlagShape(int Step, TBaseLine Owner, int number) : base(0, 0, Step, number) { DrawCaption = false; F_Center = new Point(0, 0); F_Radius = 0; F_TypeFlag = 0; F_Owner = Owner; // BrushStyle = bsSolid; F_ShOwner = null; F_ShPos = -1; }
/* 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 TPaintGrid(FrmMain AOwnerForm /*TCanvas* ACanvas, HWND AOwnerForm*/) { f_Width = f_Height = 0; f_StepPixels = 6; f_StepPixelsGrid = 8; f_FonColor = Color.White; f_PixelColor = Color.Black; f_PaintPixels = true; f_OwnerForm = AOwnerForm; f_LEControl = false; f_WndHandler = new IntPtr(); f_UnderControl = null; f_RefreshFon = true; f_CurrEndPoint = new Point(80, 100); f_X_offs = 0; //смещение по Х f_Y_offs = 0; //смещение по Y f_WSPenWidth = 1; f_X_offsSum = f_Y_offsSum = 0; f_LineColor = Color.Black; f_BrushTFE = false; f_BrushColor = Color.White; f_LeaveFlagColor = Color.Red; f_EnterFlagColor = Color.Lime; f_CurrentCommand = 0; f_FlagType = 0; f_TypMouseOperation = 0; f_SelectedTFE = null; f_SelectedTFS = null; // f_FrameColorTFE = null; // f_FrameColorTFS = null; f_WSMoving = false; // f_SelectedFlag = null; f_Regim = 0; f_SelectedAlternateFirst = null; //первая выбранная ТФС для альтернативы f_SelectedAlternateLast = null; //первая выбранная ТФС для альтернативы f_SelectedDeleteTFSFirst = null; //первая выбранная ТФС для альтернативы f_SelectedDeleteTFSLast = null; //первая выбранная ТФС для альтернативы /* f_FontTFE = new Font(); * ScrBitmap = new Graphics::TBitmap; * ScrBitmapCopy = new Graphics::TBitmap;*/ f_ClipPath = new TClipPath(); g_PainterList = new TPainterList(); f_ListForPaint = new TListForPaint(); /* f_FlagController = new TFlagController();*/ f_InvalidateList = new TInvalidateList(); f_LineCutting = new TLineCutting(f_Canvas); g_AlternateList = new TAlternateList(); f_AltWSList = new TAltWSList(); f_localVisiblearrowall = false; }
void ShowParamAlternativeEditor(TBaseShape ATFE, TParamAlternativeItem AItem, int AType_Char, bool ACan_list) { FmTredactChar redact_char = new FmTredactChar(); // Application.CreateForm(__classid(Tredact_char), &redact_char); redact_char.TFE = ATFE; redact_char.PAItem = AItem; redact_char.Type_Char = AType_Char; redact_char.Can_list = ACan_list; redact_char.ShowDialog(); /* redact_char.ShowModal(); * redact_char.Release();*/ }
void BuildGlp(TBaseWorkShape AWN, DrawObject Glp, TBaseShape ASel) { TBaseShape BS; FmParamAlternative fmParamAlternative = new FmParamAlternative(); Glp.SetBitMap(fmParamAlternative.pbTfs.Width, fmParamAlternative.pbTfs.Height); // Glp.Canvas.Brush.Color = f_FonColor; // Glp.Canvas.FillRect(TRect(0, 0, Glp.Width, Glp.Height)); AWN.StartPoint = new Point(0, 0); AWN.Init(); AWN.Prepare(); /* if (f_BrushTFE) * AWN.BrushStyle = bsSolid; * else * AWN.BrushStyle = bsClear;*/ AWN.BrushColor = f_BrushColor; AWN.LineWidth = f_WSPenWidth; AWN.PenWidth = f_WSPenWidth; // AWN.Font.Assign(f_FontTFE); AWN.FrameColorTFE = f_FrameColorTFE; AWN.PenColor = f_LineColor; Rectangle R = AWN.GetFrameRectWithLines(); int rx = (Glp.bmp.Width - R.Width) / 2 - R.Left; int ry = (Glp.bmp.Height - R.Height) / 2 - R.Top; AWN.SetOffsetPosition(rx, ry); AWN.StartPoint = new Point(rx, ry); if (ASel.Clon != null) { BS = ASel.Clon; } else { BS = ASel; } BS = AWN.ShapeSupportID(BS.ID); if (BS != null) { BS.DrawFrame = true; } AWN.Prepare(); AWN.Paint(Glp.gr); }
/* TBaseWorkShape* FindTFS(int Ax, int Ay);*/ /* TAlternateItem FindAlternateItem(int Ax, int Ay) * { * TAlternateItem Item; * Item = g_AlternateList.First(); * while (Item!=null) * { * if (PtInRect(&Item.ArrowWorkShape.GetSmallRegionRect(), new Point(Ax, Ay))) * return Item; * Item = g_AlternateList.Next(); * } * return null; * }*/ public void ClearAll() { f_SelectedTFE = null; f_SelectedTFS = null; f_ClipPath.Clear(); g_PainterList.ClearAll(); f_ListForPaint.Clear(); // f_FlagController.ClearAll(); f_InvalidateList.Clear(); f_LineCutting.ClearAll(); g_AlternateList.ClearAll(); f_AltWSList.Clear(); f_localVisiblearrowall = false; f_CurrEndPoint = new Point(80, 100); }
/* bool SelectTFS(int Ax, int Ay);*/ void NilTFE() { if (f_SelectedTFE != null) { if (f_SelectedTFE.DrawFrame) { f_SelectedTFE.DrawFrame = false; f_OwnerForm.SetPanelActiveVisible(false); f_ClipPath.Clear(); f_ClipPath.Add(f_SelectedTFE.GetFrameRect(), 4); // SendMessage(f_OwnerForm, WM_GD_PAINT, 1, LPARAM(f_ClipPath.GetCliptRgn())); } f_SelectedTFE = null; } }
int OPM_CompareNode(object A, object B) { TBaseShape m_A = (TBaseShape)(A); TBaseShape m_B = (TBaseShape)(B); if (m_A.ID > m_B.ID) { return(1); } if (m_A.ID < m_B.ID) { return(-1); } return(0); }
bool KeepFlag(TBaseShape Flag, ref int type) { type = -1; if (Flag == (TBaseShape)F_FlagS) { type = 0; } if (Flag == (TBaseShape)F_Flag) { type = 1; } if (Flag == (TBaseShape)F_FlagE) { type = 2; } return(type != -1); }
/* void SetLEActive(bool AValue); * virtual TBaseLine GetBaseLine(int AIndex); * int virtual GetBaseLineCount(); * virtual Point GetPointTailStartShape(); * virtual Point GetPointTailEndShape();*/ public TBaseShape(int X, int Y, int step, int number = 0) { F_BrushColor = Color.White; F_PenColor = Color.Black; F_FrameColor = Color.Red; F_BrushStyle = null; // F_PenMode = pmCopy; // F_Font = new Graphics::TFont; F_PenWidth = 1; // F_PenStyle = psSolid; F_DrawFrame = false; // F_Old_Font = new Graphics::TFont; F_Id = number; F_Caption = F_Id.ToString(); F_TypeShape = 0; F_Rect = new Rectangle(X, Y - step * 2, step * 4, step * 4); F_Step = step; F_DrawLastFlag = F_DrawFirstFlag = false; F_FrameRect = new Rectangle(F_Rect.Left - SharedConst.OFFS_FRAME * F_PenWidth, F_Rect.Top - SharedConst.OFFS_FRAME * F_PenWidth, F_Rect.Right - F_Rect.Left + 2 * SharedConst.OFFS_FRAME * F_PenWidth, F_Rect.Bottom - F_Rect.Top + 2 * SharedConst.OFFS_FRAME * F_PenWidth); F_DrawCaption = true; // F_LEControl = NULL; // F_WndHandler = 0; F_LEFrame = 0; // F_UnderControl = NULL; f_LEControl = false; f_ApplyAttribute = true; f_LEActive = true; f_WorkLines = new List <object>(); f_Tag = 0; f_IdAlternative = 0; f_NumAlternative = 0; f_IdAlternativeParent = 0; f_NumAlternativeParent = 0; f_ParamAlt = null; f_Clon = null; }
void ShapeCopy(TBaseShape Shape, int Num_Shape) { if (MainList.IsContainsChildShape(Shape.ID)) { Shape.PenColor = f_HaveChildColor; } if (Shape.ParamAlt != null) { if (f_AltParamShapeColorEnable) { Shape.BrushStyle = new SolidBrush(Color.Black); Shape.BrushColor = f_AltParamShapeColor; } else { Shape.BrushStyle = null; } Shape.PenColor = f_AltParamLineColor; } }
/* void WsFlagCreate(TFlag AFlag, TBaseWorkShape WS); * void WsFlagDestroy(TFlag AFlag, TBaseWorkShape WS);*/ bool SelectTFE(int Ax, int Ay) { bool res; TBaseShape mTFE = FindTFE(Ax, Ay); res = (mTFE != null && (f_SelectedTFE != mTFE)); if (res) { f_ClipPath.Clear(); if (f_SelectedTFE != null) { f_SelectedTFE.DrawFrame = false; f_ClipPath.Add(f_SelectedTFE.GetFrameRect(), 4); } f_SelectedTFE = mTFE; f_SelectedTFE.DrawFrame = true; f_ClipPath.Add(f_SelectedTFE.GetFrameRect(), 4); f_OwnerForm.SetPanelActiveVisible(true); // SendMessage(f_OwnerForm, WM_GD_PAINT, 1, LPARAM(f_ClipPath.GetCliptRgn())); } return(res); }
void ShowParamAlternative(TBaseShape ATFE, int AParentID, int AType_Char, DrawObject AGlp, bool AReadOnly) { // Application.CreateForm(__classid(TfmParamAlternative), &fmParamAlternative); FmParamAlternative fmParamAlternative = new FmParamAlternative(); if (ATFE.Clon != null) { fmParamAlternative.TFE = ATFE.Clon; } else { fmParamAlternative.TFE = ATFE; } fmParamAlternative.Type_Char = AType_Char; fmParamAlternative.ParentShapeID = AParentID; fmParamAlternative.Glp = AGlp.gr; fmParamAlternative.FReadOnly = AReadOnly; // fmParamAlternative.acAdd.Enabled = !AReadOnly; // fmParamAlternative.acDel.Enabled = !AReadOnly; fmParamAlternative.pbTfs.Image = AGlp.bmp; fmParamAlternative.ShowDialog(); // fmParamAlternative.Release(); }
public TBaseShape FindTFE(int Ax, int Ay) { TBaseShape Res = null; if (f_Shape != null) { if (SharedConst.PtInRect(f_Shape.GetRect(), new Point(Ax, Ay))) { return(f_Shape); } } TCompositeBaseWork Item; for (int i = CompositeWork.Count - 1; i >= 0; i--) { Item = (TCompositeBaseWork)(CompositeWork.ElementAt(i)); Res = Item.FindTFE(Ax, Ay); if (Res != null) { return(Res); } } return(null); }
public void AddBaseShape(TBaseShape AShape, int AID) { f_List.AppendInteger(AID, AShape); }
public void AddShape(TBaseShape N) { WorkShapes.Add(N); }
public TTreeListItem(TBaseShape ABaseShape) { f_BaseShape = ABaseShape; f_MainNode = null; }