- Funcion BestFitAllColumns para mejor ajuste de las columnas.
git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@610 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
02017c27da
commit
f0afbc004c
@ -93,6 +93,7 @@ type
|
|||||||
FFilter: string;
|
FFilter: string;
|
||||||
FOnFilterChanged : TNotifyEvent;
|
FOnFilterChanged : TNotifyEvent;
|
||||||
FGridStatus : TcxGridStatus;
|
FGridStatus : TcxGridStatus;
|
||||||
|
procedure BestFitAllColumns;
|
||||||
protected
|
protected
|
||||||
FOnDblClick: TNotifyEvent;
|
FOnDblClick: TNotifyEvent;
|
||||||
FPopupMenu: TPopupMenu;
|
FPopupMenu: TPopupMenu;
|
||||||
@ -196,29 +197,36 @@ begin
|
|||||||
RegisterCustomContainer(TfrViewGridBase);
|
RegisterCustomContainer(TfrViewGridBase);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure BestFitAllColumns (TheView:TcxGridDBTableView; ALimit:Integer = 0);
|
{ TfrViewGrid }
|
||||||
|
|
||||||
|
procedure TfrViewGridBase.BestFitAllColumns;
|
||||||
var
|
var
|
||||||
i : Integer ;
|
i : Integer ;
|
||||||
begin
|
begin
|
||||||
for i := 0 to TheView.VisibleColumnCount-1 do
|
ShowHourglassCursor;
|
||||||
begin
|
_FocusedView.BeginUpdate;
|
||||||
//TheView.VisibleColumns[i].BestFitMaxWidth := 0;
|
try
|
||||||
TheView.VisibleColumns[i].ApplyBestFit;
|
for i := 0 to _FocusedView.ColumnCount-1 do
|
||||||
if (ALimit > 0) then
|
|
||||||
begin
|
begin
|
||||||
if (TheView.VisibleColumns[i].Width > ALimit) then
|
_FocusedView.Columns[i].ApplyBestFit;
|
||||||
TheView.VisibleColumns[i].Width := ALimit;
|
if _FocusedView.Columns[i].BestFitMaxWidth > 0 then
|
||||||
|
begin
|
||||||
|
if (_FocusedView.Columns[i].Width > _FocusedView.Columns[i].BestFitMaxWidth) then
|
||||||
|
_FocusedView.Columns[i].Width := _FocusedView.Columns[i].BestFitMaxWidth;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
finally
|
||||||
|
_FocusedView.EndUpdate;
|
||||||
|
HideHourglassCursor;
|
||||||
end;
|
end;
|
||||||
End;
|
end;
|
||||||
|
|
||||||
{ TfrViewGrid }
|
|
||||||
|
|
||||||
procedure TfrViewGridBase.AjustarAncho;
|
procedure TfrViewGridBase.AjustarAncho;
|
||||||
begin
|
begin
|
||||||
if Assigned(_FocusedView) then
|
if Assigned(_FocusedView) then
|
||||||
begin
|
begin
|
||||||
_FocusedView.ApplyBestFit;
|
BestFitAllColumns;
|
||||||
|
//_FocusedView.ApplyBestFit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user