Procedure

TfrmReview.lstCSReviewClickCheck

Module

fReview

Last Modified

7/15/2014 3:26:38 PM

Comments

Prevent grayed checkboxes from being changed to anything else

Visibility

Public/Published

Owner

TfrmReview

Declaration

procedure lstCSReviewClickCheck(Sender: TObject);

Calls Hierarchy


TfrmReview.lstCSReviewClickCheck
 ├TSigItems.EnableSettings
 │ └TSigItems.TagToItem
 ├updateAllChilds
 │ └TSigItems.EnableSettings...
 ├TfrmReview.CSItemsAreChecked
 ├TfrmReview.nonDCCSItemsAreChecked
 ├TfrmReview.IsSignatureRequired
 └TfrmReview.txtESCodeChange
   └TfrmReview.AnyItemsAreChecked
     ├TfrmReview.ItemsAreChecked
     └TfrmReview.CSItemsAreChecked

Calls

Name Declaration Comments
TfrmReview.CSItemsAreChecked function CSItemsAreChecked: Boolean; -
TSigItems.EnableSettings procedure EnableSettings(Index: integer; Checked: boolean); -
TfrmReview.IsSignatureRequired function IsSignatureRequired:boolean; -
TfrmReview.nonDCCSItemsAreChecked function nonDCCSItemsAreChecked: Boolean; -
TfrmReview.txtESCodeChange procedure txtESCodeChange(Sender: TObject); -
updateAllChilds procedure updateAllChilds(CheckedStatus: boolean; ParentOrderId: string); -


Source

2285  procedure TfrmReview.lstCSReviewClickCheck(Sender: TObject);
2286  { prevent grayed checkboxes from being changed to anything else }
2287  var
2288    ChangeItem: TChangeItem;
2289  
2290    procedure updateAllChilds(CheckedStatus: boolean; ParentOrderId: string);
2291    var
2292      idx: integer;
2293      AChangeItem: TChangeItem;
2294    begin
2295      for idx := 0 to lstCSReview.Items.Count - 1 do
2296      begin
2297        AChangeItem := TChangeItem(lstCSReview.Items.Objects[idx]);
2298        if Assigned(AChangeItem) and (AChangeItem.ParentID = ParentOrderId) then
2299            if lstCSReview.Checked[idx] <> CheckedStatus then
2300            begin
2301              lstCSReview.Checked[idx] := CheckedStatus;
2302              SigItemsCS.EnableSettings(idx, lstCSReview.checked[Idx]);
2303            end;
2304      end;
2305    end;
2306  
2307  begin
2308    with lstCSReview do
2309    begin
2310      ChangeItem := TChangeItem(Items.Objects[ItemIndex]);
2311      if ChangeItem = nil then Exit;
2312      
2313      if ItemIndex > 0 then
2314      begin
2315        if (ChangeItem <> nil) then
2316        begin
2317          if (ChangeItem.SignState = CH_SIGN_NA) then State[ItemIndex] := cbGrayed
2318          else
2319          begin
2320            SigItemsCS.EnableSettings(ItemIndex, checked[ItemIndex]);
2321            if Length(ChangeItem.ParentID) > 0 then
2322              updateAllChilds(checked[ItemIndex], ChangeItem.ParentID);
2323          end;
2324        end;
2325      end;
2326      if CSItemsAreChecked and nonDCCSItemsAreChecked then
2327      begin
2328         lblDeaText.Visible := TRUE;
2329         lblSmartCardNeeded.Visible := TRUE;
2330      end
2331      else
2332      begin
2333         lblDeaText.Visible := FALSE;
2334         lblSmartCardNeeded.Visible := FALSE;
2335      end;
2336      pnlSignature.Visible := IsSignatureRequired;
2337    end;
2338    if pnlSignature.Visible then
2339    begin
2340      txtESCode.SetFocus;
2341      txtESCodeChange(Self);
2342    end;
2343  end;