Procedure

TfrmODMedIV.cmdRemoveClick

Module

fODMedIV

Last Modified

7/15/2014 3:26:42 PM

Comments

Remove button for grid

Visibility

Public/Published

Owner

TfrmODMedIV

Declaration

procedure cmdRemoveClick(Sender: TObject);

Calls Hierarchy


TfrmODMedIV.cmdRemoveClick
 ├TfrmODMedIV.UpdateRoute
 │ └LoadDosageFormIVRoutes
 ├TfrmODMedIV.ClearAllFields
 │ └TfrmODMedIV.cboTypeChange
 │   ├TfrmODMedIV.UpdateDuration
 │   └TfrmODMedIV.ControlChange
 │     ├TfrmODMedIV.loadExpectFirstDose
 │     │ ├TfrmODMedIV.DisplayDoseNow
 │     │ ├LoadAdminInfo
 │     │ └FMToday
 │     │   └FMNow
 │     ├TResponses.FindResponseByName
 │     ├TResponses.Clear
 │     ├TResponses.Update
 │     │ ├TResponses.FindResponseByName
 │     │ └TResponses.IENForPrompt
 │     ├IsNumericRate
 │     └TResponses.GetOrderText
 │       ├TResponses.NextInstance
 │       ├TResponses.FindResponseByName
 │       ├TResponses.FormatResponse
 │       │ └TResponses.FindResponseByIEN
 │       └TResponses.AppendChildren
 │         ├TResponses.FindPromptByIEN
 │         ├TResponses.FindResponseByIEN
 │         └TResponses.FormatResponse...
 └TfrmODMedIV.ControlChange...

Calls

Name Declaration Comments
TfrmODMedIV.ClearAllFields procedure ClearAllFields; -
TfrmODMedIV.ControlChange procedure ControlChange(Sender: TObject); -
TfrmODMedIV.UpdateRoute procedure UpdateRoute; -


Source

1905  procedure TfrmODMedIV.cmdRemoveClick(Sender: TObject);  // remove button for grid
1906  var
1907    i, stRow, stRowCount: Integer;
1908  begin
1909    inherited;
1910    with grdSelected do
1911    begin
1912      if Row < 0 then Exit;
1913      stRow := Row;
1914      stRowCount := RowCount;
1915      if Objects[0, Row] <> nil then TIVComponent(Objects[0, Row]).Free;
1916      for i := Row to RowCount - 2 do Rows[i] := Rows[i + 1];
1917      Rows[RowCount - 1].Clear;
1918      RowCount := RowCount - 1;
1919    end;
1920    UpdateRoute;
1921    if (stRowCount = 1) and (stRow = 0) then
1922      begin
1923        //self.cboRoute.ItemIndex := -1;
1924        ClearAllFields;
1925      end;
1926    ControlChange(Sender);
1927  end;