![]() |
|
#1
|
|||
|
|||
![]() Попробовал такую штуку...
Код:
const px = -194; // то кол. пикс. , на которое откланяется компонент py = -144; type VertexType = record Form_:TShape; Name_:TLabel; End; Var vertex:array of VertexType; Now:byte; procedure TMainForm.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var xn,yn:integer; Begin Inc(now); SetLength(Vertex,Now); Vertex[Now-1].Form_:=TShape.Create(Self); Vertex[Now-1].Name_:=TLabel.Create(Self); Xn:=Mouse.CursorPos.X+px; Yn:=Mouse.CursorPos.Y+py; Vertex[Now-1].Form_.Shape:=stCircle; Vertex[Now-1].Form_.Width:=30; Vertex[Now-1].Form_.Height:=Vertex[Now-1].Form_.Width; Vertex[Now-1].Name_.Caption:=IntToStr(Now); Vertex[Now-1].Name_.Font.Size:=11; Vertex[Now-1].Name_.Font.Style:=[FsBold]; Vertex[Now-1].Form_.Parent:=MainForm; Vertex[Now-1].Name_.Parent:=MainForm; Vertex[Now-1].Name_.Font.Name:='Comic Sans MS'; Vertex[Now-1].Name_.Height:=Vertex[Now-1].Name_.Height-4; Vertex[Now-1].Name_.Color:=Vertex[Now-1].Form_.Brush.Color; Vertex[Now-1].Form_.Left:=Xn; Vertex[Now-1].Form_.Top:=Yn; If (Now > 9) then Begin Vertex[Now-1].Name_.Left:=Xn-9; Vertex[Now-1].Name_.Top:=Yn-11; End Else Begin Vertex[Now-1].Name_.Left:=Xn-5; Vertex[Now-1].Name_.Top:=Yn-11; End; End; Кликаю я на одну область, а фигура строится на ок. 200 писк. левее и ниже... ![]() ![]() Последний раз редактировалось 4EJIOBEK, 20.02.2009 в 14:15. |