diff options
Diffstat (limited to 'extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas')
-rw-r--r-- | extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas index dd5029e5..374a971a 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas @@ -89,15 +89,13 @@ end; procedure TMainForm.miEditEditClick(Sender: TObject); var c: TContact; - rowmed: TStringGridRowMediator; begin if grdContacts.FocusRow < 0 then begin tiAppError('You need to select a Contact first'); Exit; end; - rowmed := TStringGridRowMediator(TStringGridMediator(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); - c := TContact(rowmed.Model); + c := TContact(TStringGridMediator(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); if not Assigned(c) then Exit; //==> @@ -111,15 +109,13 @@ end; procedure TMainForm.miEditDeleteClick(Sender: TObject); var c: TContact; - rowmed: TStringGridRowMediator; begin if grdContacts.FocusRow < 0 then begin tiAppError('You need to select a Contact first'); Exit; end; - rowmed := TStringGridRowMediator(TStringGridMediator(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); - c := TContact(rowmed.Model); + c := TContact(TStringGridMediator(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); if tiAppConfirmation('Are you sure you want to delete <%s>', [c.FirstName + ' ' + c.LastName]) then begin |