Procedure

TfrmRemCoverSheet.sbCopyRightClick

Module

fRemCoverSheet

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public/Published

Owner

TfrmRemCoverSheet

Declaration

procedure sbCopyRightClick(Sender: TObject);

Calls Hierarchy


TfrmRemCoverSheet.sbCopyRightClick
 ├TfrmRemCoverSheet.ListHasData
 ├TfrmRemCoverSheet.GetCurrent
 │ └TfrmRemCoverSheet.GetCoverSheetLvlData
 │   └GetCoverSheetLevelData
 ├TfrmRemCoverSheet.MarkListAsChanged
 │ └TfrmRemCoverSheet.UpdateView
 │   └TfrmRemCoverSheet.GetCurrent...
 └TfrmRemCoverSheet.UpdateMasterListView
   ├TfrmRemCoverSheet.GetCurrent...
   └TfrmRemCoverSheet.UpdateButtons
     ├TfrmRemCoverSheet.GetCurrent...
     ├TfrmRemCoverSheet.GetIndex
     └TfrmRemCoverSheet.LockButtonUpdate
       ├TfrmRemCoverSheet.btnLockClick
       │ └TfrmRemCoverSheet.ChangeStatus
       │   ├TfrmRemCoverSheet.GetCurrent...
       │   ├TfrmRemCoverSheet.GetIndex
       │   ├TfrmRemCoverSheet.MarkListAsChanged...
       │   ├TfrmRemCoverSheet.SetupItem
       │   └TfrmRemCoverSheet.LockButtonUpdate...
       └TfrmRemCoverSheet.btnAddClick
         └TfrmRemCoverSheet.ChangeStatus...

Calls

Name Declaration Comments
TfrmRemCoverSheet.GetCurrent function GetCurrent(IEN: Int64; Level: TRemCoverDataLevel; Show: boolean; Add: boolean = FALSE): TORStringList; -
TfrmRemCoverSheet.ListHasData function ListHasData(Seq: string; SubIdx: integer): boolean; -
TfrmRemCoverSheet.MarkListAsChanged procedure MarkListAsChanged; -
TfrmRemCoverSheet.UpdateMasterListView procedure UpdateMasterListView; -


Source

1388  procedure TfrmRemCoverSheet.sbCopyRightClick(Sender: TObject);
1389  var
1390    i: integer;
1391    Seq, Cur, Idx: integer;
1392    tmpSL: TORStringList;
1393    IEN: string;
1394  
1395  begin
1396    if assigned(tvAll.Selected) then
1397    begin
1398      IEN := Piece(TORTreeNode(tvAll.Selected).StringData, U, 1);
1399      if ListHasData(IEN, IdxIEN) then
1400      begin
1401        ShowMsg('List already contains this Reminder');
1402        exit;
1403      end;
1404      if lvCover.Items.Count = 0 then
1405        Seq := 10
1406      else
1407      begin
1408        Seq := 0;
1409        for i := 0 to lvCover.Items.Count-1 do
1410        begin
1411          Cur := StrToIntDef(lvCover.Items[i].SubItems[IdxSeq], 0);
1412          if Seq < Cur then
1413            Seq := Cur;
1414        end;
1415        inc(Seq,10);
1416        if Seq > 999 then
1417        begin
1418          Seq := 999;
1419          while (Seq > 0) and ListHasData(IntToStr(Seq), IdxSeq) do dec(Seq);
1420        end;
1421      end;
1422      if Seq > 0 then
1423      begin
1424        tmpSL := GetCurrent(FEditingIEN, FEditingLevel, FALSE, TRUE);
1425        Idx := tmpSL.IndexOfPiece(IEN,U,2);
1426        if Idx < 0 then
1427        begin
1428          tmpSL.Add(IntToStr(Seq) + U + CVAddCode + TORTreeNode(tvAll.Selected).StringData);
1429          MarkListAsChanged;
1430          UpdateMasterListView;
1431          for i := 0 to lvCover.Items.Count-1 do
1432            if IEN = lvCover.Items[i].SubItems[IdxIEN] then
1433            begin
1434              lvCover.Selected := lvCover.Items[i];
1435              break;
1436            end;
1437        end;
1438        if ScreenReaderSystemActive then
1439          GetScreenReader.Speak('Reminder Added to ' + DataName[FEditingLevel] + ' Level Reminders List');
1440      end;
1441    end;
1442  end;