Function

StrUserColumns

Module

rMisc

Last Modified

7/15/2014 3:26:44 PM

Scope

Interfaced

Declaration

function StrUserColumns(AControl: TControl): string;

Called-By Hierarchy


                   StrUserColumns
     TfrmFrame.SaveSizesForUser┘ 
TfrmFrame.SaveUserPreferences┘   
        TfrmFrame.FormClose┘     

Called-By

Name Declaration Comments
TfrmFrame.SaveSizesForUser procedure SaveSizesForUser; -


Source

434   function StrUserColumns(AControl: TControl): string;
435   var
436     x: string;
437     i: Integer;
438     shouldSave: boolean;
439   begin
440     shouldSave := False;
441     x := AControl.Name;
442     if not (AControl is TForm) and (Assigned(AControl.Owner)) then x := AControl.Owner.Name + '.' + x;
443     if AnsiCompareText(x,'frmOrders.hdrOrders') = 0 then
444       shouldSave := True;
445     Result := 'C' + U + x + U;
446     if AControl is THeaderControl then with THeaderControl(AControl) do
447       for i := 0 to Sections.Count - 1 do
448       begin
449         if shouldSave and (i = 0) then
450           Result := Result + IntToStr(frmOrders.EvtColWidth) + ','
451         else
452           Result := Result + IntToStr(Sections.Items[i].Width) + ',';
453       end;
454     if AControl is TCustomGrid then {nothing for now};
455     if CharAt(Result, Length(Result)) = ',' then Result := Copy(Result, 1, Length(Result) - 1);
456   end;