mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-24 02:39:56 +01:00
* Add menu item to adjust band height to content (Bug ID #33362)
git-svn-id: trunk@57481 -
This commit is contained in:
parent
2f07f2fb0e
commit
6aad5cc192
@ -117,6 +117,8 @@ Type
|
|||||||
procedure ResizeSelection(aHeight: TSizeAdjust; HSize: TFPReportUnits; aWidth: TSizeAdjust; WSize: TFPReportUnits);virtual;
|
procedure ResizeSelection(aHeight: TSizeAdjust; HSize: TFPReportUnits; aWidth: TSizeAdjust; WSize: TFPReportUnits);virtual;
|
||||||
Procedure ResizeSelection(Delta : TPoint; ADPI : integer; ApplyToPos : TResizeHandlePosition);virtual;
|
Procedure ResizeSelection(Delta : TPoint; ADPI : integer; ApplyToPos : TResizeHandlePosition);virtual;
|
||||||
Procedure FrameSelection(aFrameAction : TFrameActions; doClearFirst : Boolean);
|
Procedure FrameSelection(aFrameAction : TFrameActions; doClearFirst : Boolean);
|
||||||
|
Procedure AdjustSelectedBandToContent(B : TFPReportCustomBand);
|
||||||
|
Procedure AdjustSelectedBandsToContent;
|
||||||
Procedure ResetModified;
|
Procedure ResetModified;
|
||||||
Procedure SelectElement(E : TFPReportElement);
|
Procedure SelectElement(E : TFPReportElement);
|
||||||
// Will call selectionchanged, except when result=odrPage
|
// Will call selectionchanged, except when result=odrPage
|
||||||
@ -636,6 +638,38 @@ begin
|
|||||||
ReportChanged;
|
ReportChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TReportObjectList.AdjustSelectedBandToContent(B: TFPReportCustomBand);
|
||||||
|
|
||||||
|
Var
|
||||||
|
I : Integer;
|
||||||
|
H,P : TFPReportUnits;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if B.ChildCount=0 then
|
||||||
|
exit;
|
||||||
|
H:=B.Child[0].Layout.Height+B.Child[0].Layout.Top;
|
||||||
|
For I:=1 to B.ChildCount-1 do
|
||||||
|
begin
|
||||||
|
P:=B.Child[i].Layout.Height+B.Child[i].Layout.Top;
|
||||||
|
If P>H then
|
||||||
|
H:=P;
|
||||||
|
end;
|
||||||
|
B.Layout.Height:=H;
|
||||||
|
SelectRectInvalid;
|
||||||
|
ReportChanged;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TReportObjectList.AdjustSelectedBandsToContent;
|
||||||
|
|
||||||
|
Var
|
||||||
|
I : integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
For I:=0 to Count-1 do
|
||||||
|
If Objects[i].Selected and Objects[i].IsBand then
|
||||||
|
AdjustSelectedBandToContent(Objects[i].AsBand);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TReportObjectList.ResetModified;
|
procedure TReportObjectList.ResetModified;
|
||||||
begin
|
begin
|
||||||
FModified:=False;
|
FModified:=False;
|
||||||
|
|||||||
@ -507,6 +507,9 @@ object FPReportDesignerForm: TFPReportDesignerForm
|
|||||||
object MIResizeVSmallest: TMenuItem
|
object MIResizeVSmallest: TMenuItem
|
||||||
Action = AResizeVSmallest
|
Action = AResizeVSmallest
|
||||||
end
|
end
|
||||||
|
object MenuItem3: TMenuItem
|
||||||
|
Action = AResizeBandToFit
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object MFrames: TMenuItem
|
object MFrames: TMenuItem
|
||||||
Caption = 'Frames'
|
Caption = 'Frames'
|
||||||
@ -907,6 +910,11 @@ object FPReportDesignerForm: TFPReportDesignerForm
|
|||||||
OnExecute = AFileSaveAsExecute
|
OnExecute = AFileSaveAsExecute
|
||||||
OnUpdate = AFileSaveAsUpdate
|
OnUpdate = AFileSaveAsUpdate
|
||||||
end
|
end
|
||||||
|
object AResizeBandToFit: TAction
|
||||||
|
Caption = 'Adjust Band height to content'
|
||||||
|
OnExecute = AResizeBandToFitExecute
|
||||||
|
OnUpdate = AResizeBandToFitUpdate
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object SDReport: TSaveDialog
|
object SDReport: TSaveDialog
|
||||||
DefaultExt = '.json'
|
DefaultExt = '.json'
|
||||||
|
|||||||
@ -74,6 +74,7 @@ type
|
|||||||
AAlignVCenter: TAction;
|
AAlignVCenter: TAction;
|
||||||
AAlignBottom: TAction;
|
AAlignBottom: TAction;
|
||||||
AAlign: TAction;
|
AAlign: TAction;
|
||||||
|
AResizeBandToFit: TAction;
|
||||||
AFileSaveAs: TAction;
|
AFileSaveAs: TAction;
|
||||||
ARecent: TAction;
|
ARecent: TAction;
|
||||||
AReportData: TAction;
|
AReportData: TAction;
|
||||||
@ -100,6 +101,7 @@ type
|
|||||||
ILReport: TImageList;
|
ILReport: TImageList;
|
||||||
MenuItem1: TMenuItem;
|
MenuItem1: TMenuItem;
|
||||||
MenuItem2: TMenuItem;
|
MenuItem2: TMenuItem;
|
||||||
|
MenuItem3: TMenuItem;
|
||||||
MISaveAs: TMenuItem;
|
MISaveAs: TMenuItem;
|
||||||
MIPreview: TMenuItem;
|
MIPreview: TMenuItem;
|
||||||
MIframeBottom: TMenuItem;
|
MIframeBottom: TMenuItem;
|
||||||
@ -248,6 +250,8 @@ type
|
|||||||
procedure AReportPropertiesUpdate(Sender: TObject);
|
procedure AReportPropertiesUpdate(Sender: TObject);
|
||||||
procedure AReportVariablesExecute(Sender: TObject);
|
procedure AReportVariablesExecute(Sender: TObject);
|
||||||
procedure AReportVariablesUpdate(Sender: TObject);
|
procedure AReportVariablesUpdate(Sender: TObject);
|
||||||
|
procedure AResizeBandToFitExecute(Sender: TObject);
|
||||||
|
procedure AResizeBandToFitUpdate(Sender: TObject);
|
||||||
procedure AResizeExecute(Sender: TObject);
|
procedure AResizeExecute(Sender: TObject);
|
||||||
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
@ -1208,6 +1212,17 @@ begin
|
|||||||
(Sender as Taction).Enabled:=Assigned(Report) and (rdoManageVariables in DesignOptions);
|
(Sender as Taction).Enabled:=Assigned(Report) and (rdoManageVariables in DesignOptions);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFPReportDesignerForm.AResizeBandToFitExecute(Sender: TObject);
|
||||||
|
begin
|
||||||
|
If Assigned(CurrentDesigner) then
|
||||||
|
CurrentDesigner.Objects.AdjustSelectedBandsToContent;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFPReportDesignerForm.AResizeBandToFitUpdate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
(Sender as TAction).Enabled:=Assigned(CurrentDesigner) and (CurrentDesigner.Objects.HaveSelection);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TFPReportDesignerForm.AResizeExecute(Sender: TObject);
|
procedure TFPReportDesignerForm.AResizeExecute(Sender: TObject);
|
||||||
|
|
||||||
Var
|
Var
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user