Procedure

TfrmProcedures.UpdateControls

Directives

Override

Module

fProcedure

Last Modified

7/15/2014 3:26:36 PM

Visibility

Protected

Overrides

TfrmPCEBaseMain.UpdateControls

Owner

TfrmProcedures

Declaration

procedure UpdateControls; override;

Calls Hierarchy


TfrmProcedures.UpdateControls
 ├TfrmPCEBaseMain.NotUpdating
 ├TfrmPCEBaseMain.BeginUpdate
 ├ExternalName
 ├TPCEProviderList.PCEProviderName
 │ ├TPCEProviderList.PCEProvider
 │ │ ├Check
 │ │ │ └TPCEProviderList.IndexOfProvider
 │ │ └TPCEProviderList.PrimaryIEN
 │ │   └TPCEProviderList.GetPrimaryIdx
 │ └ExternalName
 └TfrmPCEBaseMain.EndUpdate

Called-By Hierarchy


TfrmProcedures.UpdateControls
TfrmProcedures.clbListClick┘ 

Calls

Name Declaration Comments
TfrmPCEBaseMain.BeginUpdate procedure BeginUpdate; -
TfrmPCEBaseMain.EndUpdate procedure EndUpdate; -
ExternalName function ExternalName(IEN: Int64; FileNumber: Double): string; -
TfrmPCEBaseMain.NotUpdating function NotUpdating: boolean; -
TPCEProviderList.PCEProviderName function PCEProviderName: string; -

Called-By

Name Declaration Comments
TfrmProcedures.clbListClick procedure clbListClick(Sender: TObject); -


Source

124   procedure TfrmProcedures.UpdateControls;
125   var
126     ok, First: boolean;
127     SameQty: boolean;
128     SameProv: boolean;
129     i: integer;
130     Qty: integer;
131     Prov: int64;
132     Obj: TPCEProc;
133   
134   begin
135     inherited;
136     if(NotUpdating) then
137     begin
138       BeginUpdate;
139       try
140         ok := (lbGrid.SelCount > 0);
141         lblProcQty.Enabled := ok;
142         txtProcQty.Enabled := ok;
143         spnProcQty.Enabled := ok;
144         cboProvider.Enabled := ok;
145         lblProvider.Enabled := ok;
146         if(ok) then
147         begin
148           First := TRUE;
149           SameQty := TRUE;
150           SameProv := TRUE;
151           Prov := 0;
152           Qty := 1;
153           for i := 0 to lbGrid.Items.Count-1 do
154           begin
155             if lbGrid.Selected[i] then
156             begin
157               Obj := TPCEProc(lbGrid.Items.Objects[i]);
158               if(First) then
159               begin
160                 First := FALSE;
161                 Qty := Obj.Quantity;
162                 Prov := Obj.Provider;
163               end
164               else
165               begin
166                 if(SameQty) then
167                   SameQty := (Qty = Obj.Quantity);
168                 if(SameProv) then
169                   SameProv := (Prov = Obj.Provider);
170               end;
171             end;
172           end;
173           if(SameQty) then
174           begin
175             spnProcQty.Position := Qty;
176             txtProcQty.Text := IntToStr(Qty);
177             txtProcQty.SelStart := length(txtProcQty.Text);
178           end
179           else
180           begin
181             spnProcQty.Position := 1;
182             txtProcQty.Text := '';
183           end;
184           if not FProviderChanging then // CQ 11707
185           begin
186             if(SameProv) then
187               cboProvider.SetExactByIEN(Prov, ExternalName(Prov, 200))
188             else
189               cboProvider.SetExactByIEN(uProviders.PCEProvider, uProviders.PCEProviderName);
190               //cboProvider.ItemIndex := -1;     v22.8 - RV
191           end;
192         end
193         else
194         begin
195           txtProcQty.Text := '';
196           cboProvider.ItemIndex := -1;
197         end;
198   //      ShowModifiers;
199       finally
200         EndUpdate;
201       end;
202     end;
203   end;