Procedure

TfrmRemCoverSheet.lvViewSelectItem

Module

fRemCoverSheet

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public/Published

Owner

TfrmRemCoverSheet

Declaration

procedure lvViewSelectItem(Sender: TObject; Item: TListItem;
  Selected: Boolean);

Calls Hierarchy


TfrmRemCoverSheet.lvViewSelectItem
 └TfrmRemCoverSheet.cbxDropDownClose
   ├TfrmRemCoverSheet.UpdateView
   │ └TfrmRemCoverSheet.GetCurrent
   │   └TfrmRemCoverSheet.GetCoverSheetLvlData
   │     └GetCoverSheetLevelData
   └TfrmRemCoverSheet.cbEditLevelClick
     ├TfrmRemCoverSheet.GetExternalName
     │ └GetNameFromList
     │   └ExternalName
     ├TfrmRemCoverSheet.SetButtonHints
     ├TfrmRemCoverSheet.UpdateView...
     └TfrmRemCoverSheet.UpdateMasterListView
       ├TfrmRemCoverSheet.GetCurrent...
       └TfrmRemCoverSheet.UpdateButtons
         ├TfrmRemCoverSheet.GetCurrent...
         ├TfrmRemCoverSheet.GetIndex
         └TfrmRemCoverSheet.LockButtonUpdate
           ├TfrmRemCoverSheet.btnLockClick
           │ └TfrmRemCoverSheet.ChangeStatus
           │   ├TfrmRemCoverSheet.GetCurrent...
           │   ├TfrmRemCoverSheet.GetIndex
           │   ├TfrmRemCoverSheet.MarkListAsChanged
           │   │ └TfrmRemCoverSheet.UpdateView...
           │   ├TfrmRemCoverSheet.SetupItem
           │   └TfrmRemCoverSheet.LockButtonUpdate...
           └TfrmRemCoverSheet.btnAddClick
             └TfrmRemCoverSheet.ChangeStatus...

Called-By Hierarchy


TfrmRemCoverSheet.lvViewSelectItem
  TfrmRemCoverSheet.lvViewChange┘ 

Calls

Name Declaration Comments
TfrmRemCoverSheet.cbxDropDownClose procedure cbxDropDownClose(Sender: TObject); -

Called-By

Name Declaration Comments
TfrmRemCoverSheet.lvViewChange procedure lvViewChange(Sender: TObject; Item: TListItem; Change: TItemChange); -


Source

1625  procedure TfrmRemCoverSheet.lvViewSelectItem(Sender: TObject; Item: TListItem;
1626    Selected: Boolean);
1627  var
1628    lvl: TRemCoverDataLevel;
1629    i: integer;
1630    ClsName, TIEN, IEN, lvlName: string;
1631    ok: boolean;
1632  
1633  begin
1634    if assigned(lvView.Selected) and (not FUpdatingView) then
1635    begin
1636      FUpdatingView := TRUE;
1637      try
1638        lvl := TRemCoverDataLevel(StrToIntDef(lvView.Selected.SubItems[IdxLvl2],ord(dlUser)));
1639        IEN := lvView.Selected.SubItems[IdxIEN];
1640        lvlName := lvView.Selected.SubItems[IdxLvl];
1641        TIEN := lvView.Selected.SubItems[IdxTIEN];
1642        ClsName := lvView.Selected.SubItems[IdxType];
1643        ok := (lvl <> FEditingLevel);
1644        if(not ok) and (lvl = dlUserClass) then
1645          ok := (FEditingIEN <> StrToIntDef(TIEN,0));
1646        if (not FUserMode) and ok and (lvl <> dlPackage) then
1647        begin
1648          case lvl of
1649            dlSystem:    FUpdatePending := cbSystem;
1650            dlDivision:  FUpdatePending := cbDivision;
1651            dlService:   FUpdatePending := cbService;
1652            dlLocation:  FUpdatePending := cbLocation;
1653            dlUserClass: FUpdatePending := cbUserClass;
1654            dlUser:      FUpdatePending := cbUser;
1655          end;
1656          if lvl = dlUserClass then
1657          begin
1658            cbxClass.InitLongList(ClsName);
1659            cbxClass.SelectByID(TIEN);
1660            FCurClass := cbxClass.ItemIEN;
1661          end;
1662          cbxDropDownClose(nil);
1663        end;
1664        if (lvl = FEditingLevel) then
1665        begin
1666          for i := 0 to lvCover.Items.Count-1 do
1667            if IEN = lvCover.Items[i].SubItems[IdxIEN] then
1668            begin
1669              lvCover.Selected := lvCover.Items[i];
1670              break;
1671            end;
1672        end;
1673        for i := 0 to lvView.Items.Count-1 do
1674        begin
1675          if (IEN = lvView.Items[i].SubItems[IdxIEN]) and
1676             (lvlName = lvView.Items[i].SubItems[IdxLvl]) then
1677          begin
1678            lvView.Selected := lvView.Items[i];
1679            break;
1680          end;
1681        end;
1682      finally
1683        FUpdatingView := FALSE;
1684      end;
1685    end;
1686  end;