Function

SelectStatus

Module

fConsultBSt

Last Modified

7/15/2014 3:26:34 PM

Comments

Displays Status select form for consults and returns a record of the selection

Scope

Interfaced

Declaration

function SelectStatus(FontSize: Integer; CurrentContext: TSelectContext; var StatusContext: TStatusContext): boolean ;

Calls Hierarchy


SelectStatus
 ├TfrmBase508Form.Create
 │ ├TfrmBase508Form.UpdateAccessibilityActions
 │ ├UnfocusableControlEnter
 │ └AdjustControls
 │   ├TfrmBase508Form.ModifyUnfocusableControl
 │   └..(rec)..
 └SubSetOfStatus

Called-By Hierarchy


                                  SelectStatus
                   TfrmConsults.mnuViewClick┘ 
               TfrmConsults.SetViewContext┘   
                TfrmConsults.DisplayPage┤     
TfrmConsults.mnuViewReturntoDefaultClick┘     

Calls

Name Declaration Comments
TfrmBase508Form.Create constructor Create(AOwner: TComponent); override; -
SubSetOfStatus function SubSetOfStatus: TStrings; -

Called-By

Name Declaration Comments
TfrmConsults.mnuViewClick procedure mnuViewClick(Sender: TObject); -


Source

46    function SelectStatus(FontSize: Integer; CurrentContext: TSelectContext; var StatusContext: TStatusContext): boolean ;
47    { displays Status select form for consults and returns a record of the selection }
48    var
49      frmConsultsByStatus: TfrmConsultsByStatus;
50      W, H, i, j: Integer;
51      CurrentStatus: string;
52    begin
53      frmConsultsByStatus := TfrmConsultsByStatus.Create(Application);
54      try
55        with frmConsultsByStatus do
56        begin
57          Font.Size := FontSize;
58          W := ClientWidth;
59          H := ClientHeight;
60          ResizeToFont(FontSize, W, H);
61          ClientWidth  := W; pnlBase.Width  := W;
62          ClientHeight := H; pnlBase.Height := H;
63          FChanged := False;
64          with radSort do {if SortConsultsAscending then ItemIndex := 0 else} ItemIndex := 1;
65          FastAssign(SubSetOfStatus, lstStatus.Items);
66          CurrentStatus := CurrentContext.Status;
67          if CurrentStatus <> '' then with lstStatus do
68            begin
69              i := 1;
70              while Piece(CurrentStatus, ',', i) <> '' do
71                begin
72                  j := SelectByID(Piece(CurrentStatus, ',', i));
73                  if j > -1 then Selected[j] := True;
74                  Inc(i);
75                end;
76            end;
77          ShowModal;
78          with StatusContext do
79          begin
80            Changed := FChanged;
81            Status := FStatus;
82            StatusName := FStatusName;
83            Ascending := FAscending;
84            Result := Changed ;
85          end; {with StatusContext}
86        end; {with frmConsultsByStatus}
87      finally
88        frmConsultsByStatus.Release;
89      end;
90    end;