Procedure

TfrmProblems.SetGridPieces

Module

fProbs

Last Modified

7/15/2014 3:26:38 PM

Visibility

Private

Owner

TfrmProblems

Declaration

procedure SetGridPieces(Pieces: string);

Calls Hierarchy


TfrmProblems.SetGridPieces
 └ForChars

Called-By Hierarchy


                     TfrmProblems.SetGridPieces
                  TfrmProblems.pnlRightResize┤ 
              TfrmProblems.lstProbActsClick┤ │ 
          TfrmProblems.wgProbDataDblClick┤ │ │ 
                TfrmProblems.lstViewClick┘ │ │ 
        TfrmProblems.HighlightDuplicate┘   │ │ 
              TfrmProblems.AddProblem┤     │ │ 
   TfrmProblems.lstProbActsClick...┤ │     │ │ 
      TfrmProblems.lstProbPickClick┤ │     │ │ 
   TfrmProblems.lstProbPickDblClick┤ │     │ │ 
   TfrmProblems.edProbEntKeyPress┘ │ │     │ │ 
           TfrmProblems.UMPLLexicon┘ │     │ │ 
        TfrmdlgProb.bbChangeProbClick┘     │ │ 
                TfrmProblems.LoadUserParams┤ │ 
                TfrmProblems.LoadProblems┘ │ │ 
               TfrmProblems.DisplayPage┤   │ │ 
TfrmProblems.mnuViewRestoreDefaultClick┤   │ │ 
                  TfrmProblems.FormShow┘   │ │ 
           TfrmProblems.LoadPatientProblems┘ │ 
         TfrmProblems.lstProbActsClick...┤   │ 
             TfrmProblems.LoadProblems...┤   │ 
              TfrmProblems.RestoreProblem┤   │ 
       TfrmProblems.lstProbActsClick...┘ │   │ 
                    TfrmdlgProb.FormClose┘   │ 
          TfrmProblems.LoadPatientProblems...┘ 

Calls

Name Declaration Comments
ForChars function ForChars(Num, FontWidth: Integer): Integer; -

Called-By

Name Declaration Comments
TfrmProblems.LoadPatientProblems procedure LoadPatientProblems(AList:TstringList;const status:char;init:boolean); -
TfrmProblems.pnlRightResize procedure pnlRightResize(Sender:TObject); -


Source

880   procedure TfrmProblems.SetGridPieces( Pieces: string);
881   var
882     i, AdjustCol, cxUsed: Integer;
883     PieceSet: set of 0..High(GridColWidths);
884     x: string;
885   begin
886     PieceSet := [];
887     x := Pieces;
888     while x <> '' do begin
889       PieceSet := PieceSet + [StrToIntDef(Piece(x, ',', 1), 1)-1];
890       if Pos(',', x) = 0 then
891         break;
892       x := Copy(x, Pos(',',x)+1, Length(x));
893     end;
894     AdjustCol := 0;
895     cxUsed := 0;
896     for i := 0 to High(GridColWidths) do
897       if i in PieceSet then
898       begin
899         if GridColWidths[i] > -1 then
900         begin
901           if GridColWidths[i] > 0 then
902           begin
903             HeaderControl.Sections[i].MaxWidth := 10000;
904             HeaderControl.Sections[i].Width := ForChars(GridColWidths[i], gFontWidth);
905             cxUsed := cxUsed + HeaderControl.Sections[i].Width;
906           end
907           else
908           begin
909             HeaderControl.Sections[i].Width := 0;
910             HeaderControl.Sections[i].MaxWidth := 0;
911           end;
912         end
913         else
914           AdjustCol := i;
915       end
916       else
917       begin
918         HeaderControl.Sections[i].Width := 0;
919         HeaderControl.Sections[i].MaxWidth := 0;
920       end;
921     HeaderControl.Sections[AdjustCol].AutoSize := True;
922     HeaderControl.Sections[AdjustCol].Width := HeaderControl.Width - cxUsed;
923     //mnuOptimizeFieldsClick(self);       //******** test making compression, proportional, or no spacing on resize
924   end;