View Single Post

  #1 (permalink)  
Old 04-29-2004
Anonymous Anonymous is offline
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Locating the name of a Shape selected

Hello

I'm trying to find the name of a shape by clicking on it.

I've succesfully created an event when the mouse pointer is on the shape by using the "SelectionChange" event, but how do I find the name of the shape I've just selected, so it's ready to place into a string variable.

The code I used to select the shape is shown below: -

procedure TMainForm.MappointSelectionChange(Sender: TObject; const pNewSelection, pOldSelection: IDispatch);
var
oShape: Shape;
begin
If assigned(pNewSelection) Then
Begin
pNewSelection.QueryInterface(IID_Shape, oShape);
If assigned(oShape) Then
Begin
Showmessage('Its a Shape');
// Now I need the name of the shape !!!!!!
End;
End;
end;

Note, I'm not using a commercial database, and have not imported data, I'm using my own comma delimited data to add the shapes.

Each shape has a name representing its place in the database. i.e. a number converted into a string.

I'm using Delphi but do understand VB (slightly), so any help in either language would be of great benefit.

Thank you

Regards
Les
Reply With Quote