Procedure

TfrmOptionsLists.btnDeleteListClick

Module

fOptionsLists

Last Modified

7/15/2014 3:26:40 PM

Visibility

Public/Published

Owner

TfrmOptionsLists

Declaration

procedure btnDeleteListClick(Sender: TObject);

Calls Hierarchy


TfrmOptionsLists.btnDeleteListClick
 ├rpcDeleteList
 ├TfrmOptionsLists.btnPersonalPatientRAClick
 └TfrmOptionsLists.lstPersonalListsChange
   ├TfrmOptionsLists.btnListSaveChangesClick
   │ ├rpcSaveListChanges
   │ ├rpcGetPersonalLists
   │ └TfrmOptionsLists.lstPersonalListsChange...
   └ListPtByTeam

Calls

Name Declaration Comments
TfrmOptionsLists.btnPersonalPatientRAClick procedure btnPersonalPatientRAClick(Sender: TObject); -
TfrmOptionsLists.lstPersonalListsChange procedure lstPersonalListsChange(Sender: TObject); -
rpcDeleteList procedure rpcDeleteList(aString: String); -


Source

349   procedure TfrmOptionsLists.btnDeleteListClick(Sender: TObject);
350   var
351     oldindex: integer;
352     deletemsg: string;
353   begin
354     with lstPersonalLists do
355       deletemsg := 'You have selected "' + DisplayText[ItemIndex]
356         + '" to be deleted.' + CRLF + 'Are you sure you want to delete this list?';
357     if InfoBox(deletemsg, 'Confirmation', MB_YESNO or MB_ICONQUESTION) = IDYES then
358     begin
359       btnListSaveChanges.Enabled := false;
360       with lstPersonalLists do
361       begin
362         oldindex := ItemIndex;
363         if oldindex > -1 then
364         begin
365           rpcDeleteList(Piece(Items[oldindex], '^', 1));
366           Items.Delete(oldindex);
367           btnPersonalPatientRAClick(self);
368           btnListSaveChanges.Enabled := false;
369         end;
370         if Items.Count > 0 then
371         begin
372           if oldindex = 0 then
373             ItemIndex := 0
374           else if oldindex > (Items.Count - 1) then
375             ItemIndex := Items.Count - 1
376           else
377             ItemIndex := oldindex;
378           btnListSaveChanges.Enabled := false;
379           lstPersonalListsChange(self);
380         end;
381       end;
382     end;
383   end;