Confirmation of node deletion

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

Confirmation of node deletion

Postby MrBaseball34 » February 15th, 2007, 9:13 pm

I am trying to confirm deletion of selected nodes and I don't think I'm doing it correctly:

Code: Select all
procedure TMainForm.SimpleGraphKeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Key = VK_DELETE then
  begin
    if (MessageDlg('Are you sure you want to delete the selected object(s)?', mtConfirmation, [mbYes, mbNo], 0) <> mrYes) then
      Key := 0;
  end;
end;


But the node is deleted before the MessageDlg even appears.
Any ideas??
MrBaseball34
Active Member
Active Member
 
Posts: 7
Joined: February 15th, 2007, 9:09 pm

Postby Kambiz » February 16th, 2007, 12:37 am

:? The OnCanRemoveObject event is introduced for this purpose.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 2 guests

cron