Procedure

TfrmPCEBaseMain.lbxSectionClickCheck

Module

fPCEBaseMain

Last Modified

8/5/2014 10:18:06 AM

Visibility

Public/Published

Owner

TfrmPCEBaseMain

Declaration

procedure lbxSectionClickCheck(Sender: TObject; Index: Integer);

Calls Hierarchy


TfrmPCEBaseMain.lbxSectionClickCheck
 ├TfrmPCEBaseMain.GetCat
 ├TPCEProviderList.PCEProvider
 │ ├Check
 │ │ └TPCEProviderList.IndexOfProvider
 │ └TPCEProviderList.PrimaryIEN
 │   └TPCEProviderList.GetPrimaryIdx
 ├TfrmPCEBaseMain.UpdateNewItemStr
 ├TPCEItem.SetFromString
 │ └TPCEItem.SetComment
 ├TfrmPCEBaseGrid.SetGridIndex
 │ └TfrmPCEBaseGrid.UpdateControls
 ├TfrmPCEBaseGrid.SyncGridData
 │ ├TfrmPCEBaseGrid.SaveGridSelected
 │ ├TfrmPCEBaseGrid.RestoreGridSelected
 │ └TfrmPCEBaseGrid.SyncGridHeader
 └TfrmPCEBaseMain.UpdateControls
   ├TfrmPCEBaseMain.NotUpdating
   ├TfrmPCEBaseMain.BeginUpdate
   ├TfrmPCEBaseGrid.GetGridIndex
   └TfrmPCEBaseMain.EndUpdate

Calls

Name Declaration Comments
TfrmPCEBaseMain.GetCat function GetCat: string; -
TPCEProviderList.PCEProvider function PCEProvider: Int64; -
TPCEItem.SetFromString procedure SetFromString(const x: string); virtual; -
TfrmPCEBaseGrid.SetGridIndex procedure SetGridIndex(const Value: integer); -
TfrmPCEBaseGrid.SyncGridData procedure SyncGridData; -
TfrmPCEBaseMain.UpdateControls procedure UpdateControls; override; -
TfrmPCEBaseMain.UpdateNewItemStr procedure UpdateNewItemStr(var x: string); virtual; -


Source

445   procedure TfrmPCEBaseMain.lbxSectionClickCheck(Sender: TObject;
446     Index: Integer);
447   var
448     i, j: Integer;
449     x, SCat, SCode, SNarr, CodeCatNarr: string;
450     APCEItem: TPCEItem;
451     Found, DoSync: boolean;
452   begin
453     inherited;
454     if FUpdatingGrid or FClosing then exit;
455     DoSync := FALSE;
456     SCat := GetCat;
457     for i := 0 to lbxSection.Items.Count-1 do
458     begin
459       x := ORFn.Pieces(lbxSection.Items[i], U, 1, 2);
460       SCode := Piece(x, U, 1);
461       SNarr := Piece(x, U, 2);
462       CodeCatNarr := SCode + U + SCat + U + SNarr;
463       Found := FALSE;
464       for j := lbGrid.Items.Count - 1 downto 0 do
465       begin
466         APCEItem := TPCEItem(lbGrid.Items.Objects[j]);
467         if (SCat = APCEItem.Category) and (Pos(APCEItem.Code, SCode) > 0) and (Pos(SNarr, APCEItem.Narrative) > 0) then
468   //      if (SCat = APCEItem.Category) and (Pos(APCEItem.Code, SCode) > 0) then
469         begin
470           Found := TRUE;
471           if(lbxSection.Checked[i]) then break;
472           APCEItem.Free;
473           lbGrid.Items.Delete(j);
474         end;
475       end;
476       if(lbxSection.Checked[i] and (not Found)) then
477       begin
478         x := FPCECode + U + CodeCatNarr;
479         if FPCEItemClass = TPCEProc then
480           SetPiece(x, U, pnumProvider, IntToStr(uProviders.PCEProvider));
481         UpdateNewItemStr(x);
482         APCEItem := FPCEItemClass.Create;
483         APCEItem.SetFromString(x);
484         GridIndex := lbGrid.Items.AddObject(APCEItem.ItemStr, APCEItem);
485         DoSync := TRUE;
486       end;
487     end;
488     if(DoSync) then
489       SyncGridData;
490     UpdateControls;
491   end;