View Issue Details

IDProjectCategoryView StatusLast Update
0033320LazarusPackagespublic2018-03-05 10:33
ReporterStephanoAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product VersionProduct Build 
Target VersionFixed in Version1.9 (SVN) 
Summary0033320: FPReport designer: Preview lacks Goto 1st and Last arrow buttons
DescriptionThe preview window in the designer has previous and next arrow buttons, but lacks First and Last buttons.
While at it, the space for the maximum page number between the arrow buttons at the bottom can't accommodate a 3 digit number, so it gets cropped.
TagsNo tags attached.
Fixed in Revision57445
LazTarget-
Widgetset
Attached Files
  • fpReportPreviewFirstLast.diff (3,766 bytes)
    Index: fpreportpreview.lfm
    ===================================================================
    --- fpreportpreview.lfm	(revision 57441)
    +++ fpreportpreview.lfm	(working copy)
    @@ -36,17 +36,17 @@
           Style = tbsDivider
         end
         object TBPrevious: TToolButton
    -      Left = 110
    +      Left = 133
           Top = 2
           Action = APrevious
         end
         object TBNext: TToolButton
    -      Left = 133
    +      Left = 156
           Top = 2
           Action = ANext
         end
         object ToolButton6: TToolButton
    -      Left = 156
    +      Left = 202
           Height = 22
           Top = 2
           Caption = 'ToolButton6'
    @@ -53,17 +53,17 @@
           Style = tbsDivider
         end
         object TBZoomIn: TToolButton
    -      Left = 161
    +      Left = 207
           Top = 2
           Action = AZoomIn
         end
         object TBZoomReset: TToolButton
    -      Left = 184
    +      Left = 230
           Top = 2
           Action = AZoomReset
         end
         object TBZoomOut: TToolButton
    -      Left = 207
    +      Left = 253
           Top = 2
           Action = AZoomOut
         end
    @@ -77,6 +77,16 @@
           Top = 2
           Action = APrint
         end
    +    object TBFirst: TToolButton
    +      Left = 110
    +      Top = 2
    +      Action = AFirst
    +    end
    +    object TBLast: TToolButton
    +      Left = 179
    +      Top = 2
    +      Action = ALast
    +    end
       end
       object PBottom: TPanel
         Left = 0
    @@ -176,6 +186,12 @@
           ImageIndex = 7
           OnExecute = AExportExecute
         end
    +    object AFirst: TAction
    +      Caption = 'A&First'
    +      Hint = 'First page'
    +      OnExecute = AFirstExecute
    +      OnUpdate = AFirstUpdate
    +    end
         object APrevious: TAction
           Caption = '&Previous'
           Hint = 'Previous page'
    @@ -190,6 +206,12 @@
           OnExecute = ANextExecute
           OnUpdate = ANextUpdate
         end
    +    object ALast: TAction
    +      Caption = 'A&Last'
    +      Hint = 'Last page'
    +      OnExecute = ALastExecute
    +      OnUpdate = ALastUpdate
    +    end
         object AZoomIn: TAction
           Caption = 'Zoom &in'
           Hint = 'Zoom in'
    Index: fpreportpreview.pas
    ===================================================================
    --- fpreportpreview.pas	(revision 57441)
    +++ fpreportpreview.pas	(working copy)
    @@ -32,6 +32,8 @@
     
       TFPReportPreviewForm = class(TForm)
         AClose: TAction;
    +    ALast: TAction;
    +    AFirst: TAction;
         APrint: TAction;
         AExportPDF: TAction;
         AZoomReset: TAction;
    @@ -56,6 +58,8 @@
         TBExport: TToolButton;
         TBPDF: TToolButton;
         TBPrint: TToolButton;
    +    TBFirst: TToolButton;
    +    TBLast: TToolButton;
         ToolButton3: TToolButton;
         TBPrevious: TToolButton;
         TBNext: TToolButton;
    @@ -67,6 +71,10 @@
         procedure AExportExecute(Sender: TObject);
         procedure AExportPDFExecute(Sender: TObject);
         procedure AExportPDFUpdate(Sender: TObject);
    +    procedure AFirstExecute(Sender: TObject);
    +    procedure AFirstUpdate(Sender: TObject);
    +    procedure ALastExecute(Sender: TObject);
    +    procedure ALastUpdate(Sender: TObject);
         procedure ANextExecute(Sender: TObject);
         procedure ANextUpdate(Sender: TObject);
         procedure APreviousExecute(Sender: TObject);
    @@ -178,6 +186,26 @@
       (Sender as TAction).Enabled:=ReportExportManager.FindExporter(PDFExport)<>Nil;
     end;
     
    +procedure TFPReportPreviewForm.AFirstExecute(Sender: TObject);
    +begin
    +  PageIndex:=0;
    +end;
    +
    +procedure TFPReportPreviewForm.AFirstUpdate(Sender: TObject);
    +begin
    +  (Sender as TAction).Enabled:=PageIndex>0;
    +end;
    +
    +procedure TFPReportPreviewForm.ALastExecute(Sender: TObject);
    +begin
    +  PageIndex:=ReportPages.Count-1;
    +end;
    +
    +procedure TFPReportPreviewForm.ALastUpdate(Sender: TObject);
    +begin
    +  (Sender as TAction).Enabled:=PageIndex<ReportPages.Count-1;
    +end;
    +
     procedure TFPReportPreviewForm.ANextExecute(Sender: TObject);
     begin
       PageIndex:=PageIndex+1;
    
  • fpReportPreviewFirstLastWIthPageCount.diff (4,164 bytes)
    Index: fpreportpreview.lfm
    ===================================================================
    --- fpreportpreview.lfm	(revision 57441)
    +++ fpreportpreview.lfm	(working copy)
    @@ -36,17 +36,17 @@
           Style = tbsDivider
         end
         object TBPrevious: TToolButton
    -      Left = 110
    +      Left = 133
           Top = 2
           Action = APrevious
         end
         object TBNext: TToolButton
    -      Left = 133
    +      Left = 156
           Top = 2
           Action = ANext
         end
         object ToolButton6: TToolButton
    -      Left = 156
    +      Left = 202
           Height = 22
           Top = 2
           Caption = 'ToolButton6'
    @@ -53,17 +53,17 @@
           Style = tbsDivider
         end
         object TBZoomIn: TToolButton
    -      Left = 161
    +      Left = 207
           Top = 2
           Action = AZoomIn
         end
         object TBZoomReset: TToolButton
    -      Left = 184
    +      Left = 230
           Top = 2
           Action = AZoomReset
         end
         object TBZoomOut: TToolButton
    -      Left = 207
    +      Left = 253
           Top = 2
           Action = AZoomOut
         end
    @@ -77,6 +77,16 @@
           Top = 2
           Action = APrint
         end
    +    object TBFirst: TToolButton
    +      Left = 110
    +      Top = 2
    +      Action = AFirst
    +    end
    +    object TBLast: TToolButton
    +      Left = 179
    +      Top = 2
    +      Action = ALast
    +    end
       end
       object PBottom: TPanel
         Left = 0
    @@ -104,7 +114,7 @@
             Left = 74
             Height = 16
             Top = 11
    -        Width = 38
    +        Width = 50
             AutoSize = False
             Caption = 'of 0'
             ParentColor = False
    @@ -130,7 +140,7 @@
             ShowCaption = False
           end
           object SpeedButton1: TSpeedButton
    -        Left = 112
    +        Left = 124
             Height = 22
             Top = 8
             Width = 24
    @@ -176,6 +186,12 @@
           ImageIndex = 7
           OnExecute = AExportExecute
         end
    +    object AFirst: TAction
    +      Caption = 'A&First'
    +      Hint = 'First page'
    +      OnExecute = AFirstExecute
    +      OnUpdate = AFirstUpdate
    +    end
         object APrevious: TAction
           Caption = '&Previous'
           Hint = 'Previous page'
    @@ -190,6 +206,12 @@
           OnExecute = ANextExecute
           OnUpdate = ANextUpdate
         end
    +    object ALast: TAction
    +      Caption = 'A&Last'
    +      Hint = 'Last page'
    +      OnExecute = ALastExecute
    +      OnUpdate = ALastUpdate
    +    end
         object AZoomIn: TAction
           Caption = 'Zoom &in'
           Hint = 'Zoom in'
    Index: fpreportpreview.pas
    ===================================================================
    --- fpreportpreview.pas	(revision 57441)
    +++ fpreportpreview.pas	(working copy)
    @@ -32,6 +32,8 @@
     
       TFPReportPreviewForm = class(TForm)
         AClose: TAction;
    +    ALast: TAction;
    +    AFirst: TAction;
         APrint: TAction;
         AExportPDF: TAction;
         AZoomReset: TAction;
    @@ -56,6 +58,8 @@
         TBExport: TToolButton;
         TBPDF: TToolButton;
         TBPrint: TToolButton;
    +    TBFirst: TToolButton;
    +    TBLast: TToolButton;
         ToolButton3: TToolButton;
         TBPrevious: TToolButton;
         TBNext: TToolButton;
    @@ -67,6 +71,10 @@
         procedure AExportExecute(Sender: TObject);
         procedure AExportPDFExecute(Sender: TObject);
         procedure AExportPDFUpdate(Sender: TObject);
    +    procedure AFirstExecute(Sender: TObject);
    +    procedure AFirstUpdate(Sender: TObject);
    +    procedure ALastExecute(Sender: TObject);
    +    procedure ALastUpdate(Sender: TObject);
         procedure ANextExecute(Sender: TObject);
         procedure ANextUpdate(Sender: TObject);
         procedure APreviousExecute(Sender: TObject);
    @@ -178,6 +186,26 @@
       (Sender as TAction).Enabled:=ReportExportManager.FindExporter(PDFExport)<>Nil;
     end;
     
    +procedure TFPReportPreviewForm.AFirstExecute(Sender: TObject);
    +begin
    +  PageIndex:=0;
    +end;
    +
    +procedure TFPReportPreviewForm.AFirstUpdate(Sender: TObject);
    +begin
    +  (Sender as TAction).Enabled:=PageIndex>0;
    +end;
    +
    +procedure TFPReportPreviewForm.ALastExecute(Sender: TObject);
    +begin
    +  PageIndex:=ReportPages.Count-1;
    +end;
    +
    +procedure TFPReportPreviewForm.ALastUpdate(Sender: TObject);
    +begin
    +  (Sender as TAction).Enabled:=PageIndex<ReportPages.Count-1;
    +end;
    +
     procedure TFPReportPreviewForm.ANextExecute(Sender: TObject);
     begin
       PageIndex:=PageIndex+1;
    

Activities

Stephano

2018-03-04 19:00

developer  

fpReportPreviewFirstLast.diff (3,766 bytes)
Index: fpreportpreview.lfm
===================================================================
--- fpreportpreview.lfm	(revision 57441)
+++ fpreportpreview.lfm	(working copy)
@@ -36,17 +36,17 @@
       Style = tbsDivider
     end
     object TBPrevious: TToolButton
-      Left = 110
+      Left = 133
       Top = 2
       Action = APrevious
     end
     object TBNext: TToolButton
-      Left = 133
+      Left = 156
       Top = 2
       Action = ANext
     end
     object ToolButton6: TToolButton
-      Left = 156
+      Left = 202
       Height = 22
       Top = 2
       Caption = 'ToolButton6'
@@ -53,17 +53,17 @@
       Style = tbsDivider
     end
     object TBZoomIn: TToolButton
-      Left = 161
+      Left = 207
       Top = 2
       Action = AZoomIn
     end
     object TBZoomReset: TToolButton
-      Left = 184
+      Left = 230
       Top = 2
       Action = AZoomReset
     end
     object TBZoomOut: TToolButton
-      Left = 207
+      Left = 253
       Top = 2
       Action = AZoomOut
     end
@@ -77,6 +77,16 @@
       Top = 2
       Action = APrint
     end
+    object TBFirst: TToolButton
+      Left = 110
+      Top = 2
+      Action = AFirst
+    end
+    object TBLast: TToolButton
+      Left = 179
+      Top = 2
+      Action = ALast
+    end
   end
   object PBottom: TPanel
     Left = 0
@@ -176,6 +186,12 @@
       ImageIndex = 7
       OnExecute = AExportExecute
     end
+    object AFirst: TAction
+      Caption = 'A&First'
+      Hint = 'First page'
+      OnExecute = AFirstExecute
+      OnUpdate = AFirstUpdate
+    end
     object APrevious: TAction
       Caption = '&Previous'
       Hint = 'Previous page'
@@ -190,6 +206,12 @@
       OnExecute = ANextExecute
       OnUpdate = ANextUpdate
     end
+    object ALast: TAction
+      Caption = 'A&Last'
+      Hint = 'Last page'
+      OnExecute = ALastExecute
+      OnUpdate = ALastUpdate
+    end
     object AZoomIn: TAction
       Caption = 'Zoom &in'
       Hint = 'Zoom in'
Index: fpreportpreview.pas
===================================================================
--- fpreportpreview.pas	(revision 57441)
+++ fpreportpreview.pas	(working copy)
@@ -32,6 +32,8 @@
 
   TFPReportPreviewForm = class(TForm)
     AClose: TAction;
+    ALast: TAction;
+    AFirst: TAction;
     APrint: TAction;
     AExportPDF: TAction;
     AZoomReset: TAction;
@@ -56,6 +58,8 @@
     TBExport: TToolButton;
     TBPDF: TToolButton;
     TBPrint: TToolButton;
+    TBFirst: TToolButton;
+    TBLast: TToolButton;
     ToolButton3: TToolButton;
     TBPrevious: TToolButton;
     TBNext: TToolButton;
@@ -67,6 +71,10 @@
     procedure AExportExecute(Sender: TObject);
     procedure AExportPDFExecute(Sender: TObject);
     procedure AExportPDFUpdate(Sender: TObject);
+    procedure AFirstExecute(Sender: TObject);
+    procedure AFirstUpdate(Sender: TObject);
+    procedure ALastExecute(Sender: TObject);
+    procedure ALastUpdate(Sender: TObject);
     procedure ANextExecute(Sender: TObject);
     procedure ANextUpdate(Sender: TObject);
     procedure APreviousExecute(Sender: TObject);
@@ -178,6 +186,26 @@
   (Sender as TAction).Enabled:=ReportExportManager.FindExporter(PDFExport)<>Nil;
 end;
 
+procedure TFPReportPreviewForm.AFirstExecute(Sender: TObject);
+begin
+  PageIndex:=0;
+end;
+
+procedure TFPReportPreviewForm.AFirstUpdate(Sender: TObject);
+begin
+  (Sender as TAction).Enabled:=PageIndex>0;
+end;
+
+procedure TFPReportPreviewForm.ALastExecute(Sender: TObject);
+begin
+  PageIndex:=ReportPages.Count-1;
+end;
+
+procedure TFPReportPreviewForm.ALastUpdate(Sender: TObject);
+begin
+  (Sender as TAction).Enabled:=PageIndex<ReportPages.Count-1;
+end;
+
 procedure TFPReportPreviewForm.ANextExecute(Sender: TObject);
 begin
   PageIndex:=PageIndex+1;

Stephano

2018-03-04 19:00

developer  

fpReportPreviewFirstLastWIthPageCount.diff (4,164 bytes)
Index: fpreportpreview.lfm
===================================================================
--- fpreportpreview.lfm	(revision 57441)
+++ fpreportpreview.lfm	(working copy)
@@ -36,17 +36,17 @@
       Style = tbsDivider
     end
     object TBPrevious: TToolButton
-      Left = 110
+      Left = 133
       Top = 2
       Action = APrevious
     end
     object TBNext: TToolButton
-      Left = 133
+      Left = 156
       Top = 2
       Action = ANext
     end
     object ToolButton6: TToolButton
-      Left = 156
+      Left = 202
       Height = 22
       Top = 2
       Caption = 'ToolButton6'
@@ -53,17 +53,17 @@
       Style = tbsDivider
     end
     object TBZoomIn: TToolButton
-      Left = 161
+      Left = 207
       Top = 2
       Action = AZoomIn
     end
     object TBZoomReset: TToolButton
-      Left = 184
+      Left = 230
       Top = 2
       Action = AZoomReset
     end
     object TBZoomOut: TToolButton
-      Left = 207
+      Left = 253
       Top = 2
       Action = AZoomOut
     end
@@ -77,6 +77,16 @@
       Top = 2
       Action = APrint
     end
+    object TBFirst: TToolButton
+      Left = 110
+      Top = 2
+      Action = AFirst
+    end
+    object TBLast: TToolButton
+      Left = 179
+      Top = 2
+      Action = ALast
+    end
   end
   object PBottom: TPanel
     Left = 0
@@ -104,7 +114,7 @@
         Left = 74
         Height = 16
         Top = 11
-        Width = 38
+        Width = 50
         AutoSize = False
         Caption = 'of 0'
         ParentColor = False
@@ -130,7 +140,7 @@
         ShowCaption = False
       end
       object SpeedButton1: TSpeedButton
-        Left = 112
+        Left = 124
         Height = 22
         Top = 8
         Width = 24
@@ -176,6 +186,12 @@
       ImageIndex = 7
       OnExecute = AExportExecute
     end
+    object AFirst: TAction
+      Caption = 'A&First'
+      Hint = 'First page'
+      OnExecute = AFirstExecute
+      OnUpdate = AFirstUpdate
+    end
     object APrevious: TAction
       Caption = '&Previous'
       Hint = 'Previous page'
@@ -190,6 +206,12 @@
       OnExecute = ANextExecute
       OnUpdate = ANextUpdate
     end
+    object ALast: TAction
+      Caption = 'A&Last'
+      Hint = 'Last page'
+      OnExecute = ALastExecute
+      OnUpdate = ALastUpdate
+    end
     object AZoomIn: TAction
       Caption = 'Zoom &in'
       Hint = 'Zoom in'
Index: fpreportpreview.pas
===================================================================
--- fpreportpreview.pas	(revision 57441)
+++ fpreportpreview.pas	(working copy)
@@ -32,6 +32,8 @@
 
   TFPReportPreviewForm = class(TForm)
     AClose: TAction;
+    ALast: TAction;
+    AFirst: TAction;
     APrint: TAction;
     AExportPDF: TAction;
     AZoomReset: TAction;
@@ -56,6 +58,8 @@
     TBExport: TToolButton;
     TBPDF: TToolButton;
     TBPrint: TToolButton;
+    TBFirst: TToolButton;
+    TBLast: TToolButton;
     ToolButton3: TToolButton;
     TBPrevious: TToolButton;
     TBNext: TToolButton;
@@ -67,6 +71,10 @@
     procedure AExportExecute(Sender: TObject);
     procedure AExportPDFExecute(Sender: TObject);
     procedure AExportPDFUpdate(Sender: TObject);
+    procedure AFirstExecute(Sender: TObject);
+    procedure AFirstUpdate(Sender: TObject);
+    procedure ALastExecute(Sender: TObject);
+    procedure ALastUpdate(Sender: TObject);
     procedure ANextExecute(Sender: TObject);
     procedure ANextUpdate(Sender: TObject);
     procedure APreviousExecute(Sender: TObject);
@@ -178,6 +186,26 @@
   (Sender as TAction).Enabled:=ReportExportManager.FindExporter(PDFExport)<>Nil;
 end;
 
+procedure TFPReportPreviewForm.AFirstExecute(Sender: TObject);
+begin
+  PageIndex:=0;
+end;
+
+procedure TFPReportPreviewForm.AFirstUpdate(Sender: TObject);
+begin
+  (Sender as TAction).Enabled:=PageIndex>0;
+end;
+
+procedure TFPReportPreviewForm.ALastExecute(Sender: TObject);
+begin
+  PageIndex:=ReportPages.Count-1;
+end;
+
+procedure TFPReportPreviewForm.ALastUpdate(Sender: TObject);
+begin
+  (Sender as TAction).Enabled:=PageIndex<ReportPages.Count-1;
+end;
+
 procedure TFPReportPreviewForm.ANextExecute(Sender: TObject);
 begin
   PageIndex:=PageIndex+1;

Stephano

2018-03-04 19:15

developer   ~0106865

Last edited: 2018-03-04 19:16

View 2 revisions

2 patches uploaded:
1- Add First and Last buttons on top.
2- Same as 1 with wider page count space at the bottom
Note: Pls add glyphs for First and Last actions

Michael Van Canneyt

2018-03-05 10:23

administrator   ~0106880

Last edited: 2018-03-05 10:23

View 2 revisions

Added. I changed the pictures for the buttons and added the first/last also to the bottom navigator.

many thanks for the patch!

Issue History

Date Modified Username Field Change
2018-03-04 13:53 Stephano New Issue
2018-03-04 13:53 Stephano Status new => assigned
2018-03-04 13:53 Stephano Assigned To => Michael Van Canneyt
2018-03-04 14:09 Stephano Description Updated View Revisions
2018-03-04 19:00 Stephano File Added: fpReportPreviewFirstLast.diff
2018-03-04 19:00 Stephano File Added: fpReportPreviewFirstLastWIthPageCount.diff
2018-03-04 19:15 Stephano Note Added: 0106865
2018-03-04 19:16 Stephano Note Edited: 0106865 View Revisions
2018-03-05 10:23 Michael Van Canneyt Fixed in Revision => 57445
2018-03-05 10:23 Michael Van Canneyt Note Added: 0106880
2018-03-05 10:23 Michael Van Canneyt Status assigned => resolved
2018-03-05 10:23 Michael Van Canneyt Fixed in Version => 1.9 (SVN)
2018-03-05 10:23 Michael Van Canneyt Resolution open => fixed
2018-03-05 10:23 Michael Van Canneyt Note Edited: 0106880 View Revisions
2018-03-05 10:33 Stephano Status resolved => closed