OnShapeSelected

<< Click to Display Table of Contents >>

Navigation:  TMyCAD > Events >

OnShapeSelected

TShapeSelected = procedure (LastSelectedShape:TMyShape; SelectedShape: TMyShape) of object;

 

property OnShapeSelected: TShapeSelected ;

 

Description:

 

Use OnShapeSelected to handle a shape is selected and also can get the old shape 's infomation.

 

Examples:

 

 

procedure TMainFrm.MyCAD1ShapeSelected(LastSelectedShape, SelectedShape: TMyShape);

begin

 Memo1.Lines.Add('---------Select Event---------------');

if LastSelectedShape = nil then

    Memo1.Lines.Add('No last shape selected')

else

    Memo1.Lines.Add(' Last shape id is ' + inttostr(LastSelectedShape.ShapeID)+

                    ',in Layer ' + inttostr(LastSelectedShape.LayerId) +

                    ' , it is  a ' + LastSelectedShape.ClassName);

 

    Memo1.Lines.Add('Now you selected ' + inttostr(SelectedShape.ShapeID)+

                    ',in Layer ' + inttostr(LayerId) +

                    ', it is  a ' + SelectedShape.ClassName);

end;