void NilTFS() { if (f_SelectedTFS != null) { if (f_SelectedTFS.DrawFrame) { f_SelectedTFS.DrawFrame = false; f_ClipPath.Clear(); f_ClipPath.Add(f_SelectedTFS.GetFrameRectWithLines(), 4); //SendMessage(f_OwnerForm, WM_GD_PAINT, 1, LPARAM(f_ClipPath.GetCliptRgn())); } f_SelectedTFS = null; } }
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); }
public void AddWorkShape(TBaseWorkShape AShape) { Rectangle R; Rectangle Bounds = new Rectangle(0, 0, f_Width, f_Heigth); Point P1, P2; TBaseWorkShape Tmp; for (int i = 0; i <= Items.Count - 1; i++) { Tmp = (TBaseWorkShape)Items.ElementAt(i); if (Tmp == AShape) { return; } } R = AShape.GetFrameRectWithLines(); P1 = new Point(R.Left, R.Top); P2 = new Point(R.Right, R.Bottom); // if (PtInRect(&Bounds, P1) || PtInRect(&Bounds, P2) ) if ((R.Top <= f_Heigth) || (R.Bottom <= f_Heigth) || (R.Left != 0)) { Items.Add(AShape); } }