Procedure

TfrmGraphProfiles.btnDefinitionsClick

Module

fGraphProfiles

Last Modified

7/15/2014 3:26:36 PM

Visibility

Public/Published

Owner

TfrmGraphProfiles

Declaration

procedure btnDefinitionsClick(Sender: TObject);

Calls Hierarchy


TfrmGraphProfiles.btnDefinitionsClick
 ├TfrmGraphProfiles.AssignProfile
 │ ├TfrmGraphProfiles.AssignProfilePre
 │ │ ├GetATestGroup
 │ │ │ └rpcATestGroup
 │ │ └GetGraphProfiles
 │ │   └rpcGetGraphProfiles
 │ │     └onoff
 │ ├GetATestGroup...
 │ ├GetGraphProfiles...
 │ └TfrmGraphProfiles.AssignProfilePost
 └ReportBox
   └CreateReportBox
     └TfrmBase508Form.Create
       ├TfrmBase508Form.UpdateAccessibilityActions
       ├UnfocusableControlEnter
       └AdjustControls
         ├TfrmBase508Form.ModifyUnfocusableControl
         └..(rec)..

Calls

Name Declaration Comments
TfrmGraphProfiles.AssignProfile procedure AssignProfile(aList: TStrings; aProfile: string; UserNum: int64; allitems: boolean); -
ReportBox procedure ReportBox(ReportText: TStrings; ReportTitle: string; AllowPrint: boolean); -


Source

544   procedure TfrmGraphProfiles.btnDefinitionsClick(Sender: TObject);
545   var
546     firstpublic, firstpersonal, firstlabs: boolean;
547     i, j: integer;
548     aLine, aProfile, filetype, aString, front, back, piece2: string;
549     aList, templist: TStringList;
550   begin
551     front := Piece(LLS_FRONT, '^', 2);
552     back := Piece(LLS_BACK, '^', 1);
553     templist := TStringList.Create;
554     aList := TStringList.Create;
555     lstScratch.Clear;
556     lstScratch.Sorted := false;
557     firstpublic := true;
558     firstpersonal := true;
559     firstlabs := true;
560     for i := 0 to lstSources.Items.Count - 1 do
561     begin
562       aLine :=  lstSources.Items[i];
563       filetype := Piece(aLine, '^', 1);
564       aProfile := Piece(aLine, '^', 2);
565       if (filetype = VIEW_PERSONAL)
566       or (filetype = VIEW_PUBLIC)
567       or (filetype = VIEW_LABS) then
568       begin
569         if (filetype = VIEW_PUBLIC) and firstpublic then
570         begin
571           templist.Add(' ');
572           templist.Add(front + copy('Public Views' + back, 0, 60));
573           firstpublic := false;
574         end
575         else
576         if (filetype = VIEW_PERSONAL) and firstpersonal then
577         begin
578           templist.Add(' ');
579           templist.Add(front + copy('Personal Views' + back, 0, 60));
580           firstpersonal := false;
581         end
582         else
583         if (filetype = VIEW_LABS) and firstlabs then
584         begin
585           templist.Add(' ');
586           templist.Add(front + copy('Lab Groups' + back, 0, 60));
587           firstlabs := false;
588         end;
589         AssignProfile(aList, aLine, User.DUZ, true);
590         templist.Add(aProfile);
591         for j := 0 to aList.Count - 1 do
592         begin
593           aLine := aList[j];
594           piece2 := Piece(aLine, '^', 2);
595           if strtointdef(copy(piece2, 0, 1), -1) > 0 then
596           begin
597             aString := Piece(aLine, '^', 3);
598             if copy(aString, 0, 1) = '_' then
599               aString := copy(aString, 2, length(aString));
600             templist.Add('   ' + aString);
601           end
602           else
603           begin
604   
605           end;
606         end;
607       end;
608     end;
609     if cboUser.ItemIndex > -1 then
610     begin
611       firstpersonal := true;
612       firstlabs := true;
613       templist.Add('');
614       templist.Add('');
615       templist.Add('Views and Lab Groups for ' + cboUser.Text);
616       for i := 0 to lstOtherSources.Items.Count - 1 do
617       begin
618         aLine :=  lstOtherSources.Items[i];
619         filetype := Piece(aLine, '^', 1);
620         aProfile := Piece(aLine, '^', 2);
621         if (filetype = VIEW_PERSONAL)
622         or (filetype = VIEW_LABS) then
623         begin
624           if (filetype = VIEW_PERSONAL) and firstpersonal then
625           begin
626             templist.Add(' ');
627             templist.Add(front + copy('Views' + back, 0, 60));
628             firstpersonal := false;
629           end
630           else
631           if (filetype = VIEW_LABS) and firstlabs then
632           begin
633             templist.Add(' ');
634             templist.Add(front + copy('Lab Groups' + back, 0, 60));
635             firstlabs := false;
636           end;
637           AssignProfile(aList, aLine, cboUser.ItemID, true);
638           templist.Add(aProfile);
639           for j := 0 to aList.Count - 1 do
640           begin
641             aLine := aList[j];
642             piece2 := Piece(aLine, '^', 2);
643             if strtointdef(copy(piece2, 0, 1), -1) > 0 then
644             begin
645               aString := Piece(aLine, '^', 3);
646               if copy(aString, 0, 1) = '_' then
647                 aString := copy(aString, 2, length(aString));
648               templist.Add('   ' + aString);
649             end;
650           end;
651         end;
652       end;
653     end;
654     templist.Insert(0, 'Definitions of Views and Lab Groups');
655     templist.Insert(1, '');
656     templist.Insert(2,'Your Personal Views, Public Views, and Lab Groups');
657     ReportBox(templist, 'Views and Lab Groups', true);
658     templist.Free;
659     aList.Free;
660   end;