View Issue Details

IDProjectCategoryView StatusLast Update
0025840LazarusLazReportpublic2014-03-13 08:16
ReporterAttila PinterAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionProduct Build 
Target Version1.2.2Fixed in Version1.3 (SVN) 
Summary0025840: PrintDialog show 0 and accept charaters
DescriptionWhen I opened the PrintPreview and clicked on the Print button the PrintDialog copies UpDown field is shown 0 instead of 1 and the field accept characters instead of numbers.
TagsNo tags attached.
Fixed in Revision44416
LazTarget1.2.2
Widgetset
Attached Files
  • 25840.diff (6,504 bytes)
    --- lr_prdlg.pas	Thu Mar 13 00:58:22 2014
    +++ lr_prdlg.pas	Thu Mar 13 00:53:54 2014
    @@ -17,7 +17,7 @@
     uses
       Classes, SysUtils, LResources,
       Forms, Controls, Graphics, Dialogs,
    -  Buttons, StdCtrls,LCLIntf,ExtCtrls,
    +  Buttons, StdCtrls,LCLIntf,ExtCtrls, Spin,
       PrintersDlgs;
     
     type
    @@ -26,15 +26,11 @@
     
       TfrPrintForm = class(TForm)
         Label1: TLabel;
    -    E1: TEdit;
         GroupBox2: TGroupBox;
         RB1: TRadioButton;
         RB2: TRadioButton;
         RB3: TRadioButton;
         E2: TEdit;
    -    Panel1: TPanel;
    -    frSpeedButton1: TSpeedButton;
    -    frSpeedButton2: TSpeedButton;
         Label2: TLabel;
         OkButton: TButton;
         CancelButton: TButton;
    @@ -43,14 +39,13 @@
         PropButton: TButton;
         PrinterSetupDialog1: TPrinterSetupDialog;
         Image1: TImage;
    +    E1: TSpinEdit;
         procedure CB1DrawItem({%H-}Control: TWinControl; Index: Integer;
           ARect: TRect; {%H-}State: TOwnerDrawState);
         procedure FormCreate(Sender: TObject);
         procedure PropButtonClick(Sender: TObject);
         procedure CB1Click(Sender: TObject);
         procedure E2Click(Sender: TObject);
    -    procedure frSpeedButton1Click(Sender: TObject);
    -    procedure frSpeedButton2Click(Sender: TObject);
         procedure RB3Click(Sender: TObject);
         procedure FormDeactivate(Sender: TObject);
       private
    @@ -129,25 +124,6 @@
     procedure TfrPrintForm.E2Click(Sender: TObject);
     begin
       RB3.Checked := True;
    -end;
    -
    -procedure TfrPrintForm.frSpeedButton1Click(Sender: TObject);
    -var
    -  i: Integer;
    -begin
    -  i := StrToInt(E1.Text);
    -  Inc(i);
    -  E1.Text := IntToStr(i);
    -end;
    -
    -procedure TfrPrintForm.frSpeedButton2Click(Sender: TObject);
    -var
    -  i: Integer;
    -begin
    -  i := StrToInt(E1.Text);
    -  Dec(i);
    -  if i <= 0 then i := 1;
    -  E1.Text := IntToStr(i);
     end;
     
     procedure TfrPrintForm.RB3Click(Sender: TObject);
    --- lr_prdlg.lfm	Thu Mar 13 01:01:26 2014
    +++ lr_prdlg.lfm	Thu Mar 13 00:53:54 2014
    @@ -13,7 +13,7 @@
       OnCreate = FormCreate
       OnDeactivate = FormDeactivate
       Position = poScreenCenter
    -  LCLVersion = '1.3'
    +  LCLVersion = '1.2.0.3'
       object Image1: TImage
         Left = 192
         Height = 16
    @@ -37,31 +37,21 @@
       end
       object Label1: TLabel
         Left = 16
    -    Height = 16
    +    Height = 15
         Top = 76
    -    Width = 43
    +    Width = 36
         Caption = 'Copies'
    -    FocusControl = E1
         ParentColor = False
       end
    -  object E1: TEdit
    -    Left = 64
    -    Height = 22
    -    Top = 72
    -    Width = 61
    -    HelpContext = 99
    -    TabOrder = 0
    -    Text = '1'
    -  end
       object GroupBox2: TGroupBox
         Left = 8
         Height = 176
         Top = 104
         Width = 253
         Caption = 'Page range'
    -    ClientHeight = 154
    -    ClientWidth = 245
    -    TabOrder = 1
    +    ClientHeight = 158
    +    ClientWidth = 249
    +    TabOrder = 2
         object Label2: TLabel
           Left = 14
           Height = 59
    @@ -74,9 +64,9 @@
         end
         object RB1: TRadioButton
           Left = 8
    -      Height = 18
    +      Height = 19
           Top = 20
    -      Width = 37
    +      Width = 34
           HelpContext = 108
           Caption = 'All'
           Checked = True
    @@ -85,18 +75,18 @@
         end
         object RB2: TRadioButton
           Left = 8
    -      Height = 18
    +      Height = 19
           Top = 40
    -      Width = 103
    +      Width = 89
           HelpContext = 118
           Caption = 'Current &page'
           TabOrder = 1
         end
         object RB3: TRadioButton
           Left = 8
    -      Height = 18
    +      Height = 19
           Top = 60
    -      Width = 82
    +      Width = 72
           HelpContext = 124
           Caption = '&Numbers:'
           OnClick = RB3Click
    @@ -104,7 +94,7 @@
         end
         object E2: TEdit
           Left = 88
    -      Height = 22
    +      Height = 23
           Top = 58
           Width = 155
           HelpContext = 133
    @@ -112,46 +102,6 @@
           TabOrder = 3
         end
       end
    -  object Panel1: TPanel
    -    Left = 106
    -    Height = 17
    -    Top = 74
    -    Width = 17
    -    BevelOuter = bvNone
    -    ClientHeight = 17
    -    ClientWidth = 17
    -    FullRepaint = False
    -    TabOrder = 2
    -    object frSpeedButton1: TSpeedButton
    -      Left = 0
    -      Height = 8
    -      Top = 0
    -      Width = 17
    -      Glyph.Data = {
    -        86000000424D8600000000000000760000002800000007000000040000000100
    -        0400000000001000000000000000000000001000000000000000000000000000
    -        80000080000000808000800000008000800080800000C0C0C000808080000000
    -        FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFF0F000
    -        00F0FF000FF0FFF0FFF0
    -      }
    -      Spacing = 0
    -      OnClick = frSpeedButton1Click
    -    end
    -    object frSpeedButton2: TSpeedButton
    -      Left = 0
    -      Height = 8
    -      Top = 9
    -      Width = 17
    -      Glyph.Data = {
    -        86000000424D8600000000000000760000002800000007000000040000000100
    -        0400000000001000000000000000000000001000000000000000000000000000
    -        80000080000000808000800000008000800080800000C0C0C000808080000000
    -        FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFF0FFF0FF00
    -        0FF0F00000F0FFFFFFF0
    -      }
    -      OnClick = frSpeedButton2Click
    -    end
    -  end
       object OkButton: TButton
         Left = 282
         Height = 25
    @@ -180,9 +130,9 @@
         Top = 8
         Width = 349
         Caption = 'Printer'
    -    ClientHeight = 27
    -    ClientWidth = 341
    -    TabOrder = 5
    +    ClientHeight = 31
    +    ClientWidth = 345
    +    TabOrder = 0
         object PropButton: TButton
           Left = 264
           Height = 25
    @@ -195,17 +145,27 @@
         end
         object CB1: TComboBox
           Left = 8
    -      Height = 20
    +      Height = 23
           Top = 1
           Width = 245
           HelpContext = 142
    -      ItemHeight = 0
    +      ItemHeight = 15
           OnChange = CB1Click
           OnClick = CB1Click
           OnDrawItem = CB1DrawItem
           Style = csDropDownList
           TabOrder = 1
         end
    +  end
    +  object E1: TSpinEdit
    +    Left = 64
    +    Height = 23
    +    Top = 72
    +    Width = 74
    +    MaxValue = 1000
    +    MinValue = 1
    +    TabOrder = 1
    +    Value = 1
       end
       object PrinterSetupDialog1: TPrinterSetupDialog
         left = 296
    --- lr_view.pas	Thu Mar 13 01:02:44 2014
    +++ lr_view.pas	Thu Mar 13 00:46:44 2014
    @@ -741,7 +741,7 @@
       end;
       {$ELSE}
       frPrintForm := TfrPrintForm.Create(nil);
    -  frPrintForm.E1.Text:=IntToStr(TfrReport(Doc).DefaultCopies);
    +  frPrintForm.E1.Value:= TfrReport(Doc).DefaultCopies;
       with frPrintForm do
       begin
         if ShowModal = mrOk then
    
    25840.diff (6,504 bytes)

Activities

Zeljan Rikalo

2014-03-09 20:07

developer   ~0073574

What widgetset ? What lazarus version ? OS ? fpc version ?

Attila Pinter

2014-03-10 07:11

reporter   ~0073578

Last edited: 2014-03-10 07:14

View 2 revisions

LazReport: 0.9.9.
Lazarus Version: 1.2
OS: Windows 7
FPC: 2.6.2

Jesus Reyes

2014-03-13 08:09

developer  

25840.diff (6,504 bytes)
--- lr_prdlg.pas	Thu Mar 13 00:58:22 2014
+++ lr_prdlg.pas	Thu Mar 13 00:53:54 2014
@@ -17,7 +17,7 @@
 uses
   Classes, SysUtils, LResources,
   Forms, Controls, Graphics, Dialogs,
-  Buttons, StdCtrls,LCLIntf,ExtCtrls,
+  Buttons, StdCtrls,LCLIntf,ExtCtrls, Spin,
   PrintersDlgs;
 
 type
@@ -26,15 +26,11 @@
 
   TfrPrintForm = class(TForm)
     Label1: TLabel;
-    E1: TEdit;
     GroupBox2: TGroupBox;
     RB1: TRadioButton;
     RB2: TRadioButton;
     RB3: TRadioButton;
     E2: TEdit;
-    Panel1: TPanel;
-    frSpeedButton1: TSpeedButton;
-    frSpeedButton2: TSpeedButton;
     Label2: TLabel;
     OkButton: TButton;
     CancelButton: TButton;
@@ -43,14 +39,13 @@
     PropButton: TButton;
     PrinterSetupDialog1: TPrinterSetupDialog;
     Image1: TImage;
+    E1: TSpinEdit;
     procedure CB1DrawItem({%H-}Control: TWinControl; Index: Integer;
       ARect: TRect; {%H-}State: TOwnerDrawState);
     procedure FormCreate(Sender: TObject);
     procedure PropButtonClick(Sender: TObject);
     procedure CB1Click(Sender: TObject);
     procedure E2Click(Sender: TObject);
-    procedure frSpeedButton1Click(Sender: TObject);
-    procedure frSpeedButton2Click(Sender: TObject);
     procedure RB3Click(Sender: TObject);
     procedure FormDeactivate(Sender: TObject);
   private
@@ -129,25 +124,6 @@
 procedure TfrPrintForm.E2Click(Sender: TObject);
 begin
   RB3.Checked := True;
-end;
-
-procedure TfrPrintForm.frSpeedButton1Click(Sender: TObject);
-var
-  i: Integer;
-begin
-  i := StrToInt(E1.Text);
-  Inc(i);
-  E1.Text := IntToStr(i);
-end;
-
-procedure TfrPrintForm.frSpeedButton2Click(Sender: TObject);
-var
-  i: Integer;
-begin
-  i := StrToInt(E1.Text);
-  Dec(i);
-  if i <= 0 then i := 1;
-  E1.Text := IntToStr(i);
 end;
 
 procedure TfrPrintForm.RB3Click(Sender: TObject);
--- lr_prdlg.lfm	Thu Mar 13 01:01:26 2014
+++ lr_prdlg.lfm	Thu Mar 13 00:53:54 2014
@@ -13,7 +13,7 @@
   OnCreate = FormCreate
   OnDeactivate = FormDeactivate
   Position = poScreenCenter
-  LCLVersion = '1.3'
+  LCLVersion = '1.2.0.3'
   object Image1: TImage
     Left = 192
     Height = 16
@@ -37,31 +37,21 @@
   end
   object Label1: TLabel
     Left = 16
-    Height = 16
+    Height = 15
     Top = 76
-    Width = 43
+    Width = 36
     Caption = 'Copies'
-    FocusControl = E1
     ParentColor = False
   end
-  object E1: TEdit
-    Left = 64
-    Height = 22
-    Top = 72
-    Width = 61
-    HelpContext = 99
-    TabOrder = 0
-    Text = '1'
-  end
   object GroupBox2: TGroupBox
     Left = 8
     Height = 176
     Top = 104
     Width = 253
     Caption = 'Page range'
-    ClientHeight = 154
-    ClientWidth = 245
-    TabOrder = 1
+    ClientHeight = 158
+    ClientWidth = 249
+    TabOrder = 2
     object Label2: TLabel
       Left = 14
       Height = 59
@@ -74,9 +64,9 @@
     end
     object RB1: TRadioButton
       Left = 8
-      Height = 18
+      Height = 19
       Top = 20
-      Width = 37
+      Width = 34
       HelpContext = 108
       Caption = 'All'
       Checked = True
@@ -85,18 +75,18 @@
     end
     object RB2: TRadioButton
       Left = 8
-      Height = 18
+      Height = 19
       Top = 40
-      Width = 103
+      Width = 89
       HelpContext = 118
       Caption = 'Current &page'
       TabOrder = 1
     end
     object RB3: TRadioButton
       Left = 8
-      Height = 18
+      Height = 19
       Top = 60
-      Width = 82
+      Width = 72
       HelpContext = 124
       Caption = '&Numbers:'
       OnClick = RB3Click
@@ -104,7 +94,7 @@
     end
     object E2: TEdit
       Left = 88
-      Height = 22
+      Height = 23
       Top = 58
       Width = 155
       HelpContext = 133
@@ -112,46 +102,6 @@
       TabOrder = 3
     end
   end
-  object Panel1: TPanel
-    Left = 106
-    Height = 17
-    Top = 74
-    Width = 17
-    BevelOuter = bvNone
-    ClientHeight = 17
-    ClientWidth = 17
-    FullRepaint = False
-    TabOrder = 2
-    object frSpeedButton1: TSpeedButton
-      Left = 0
-      Height = 8
-      Top = 0
-      Width = 17
-      Glyph.Data = {
-        86000000424D8600000000000000760000002800000007000000040000000100
-        0400000000001000000000000000000000001000000000000000000000000000
-        80000080000000808000800000008000800080800000C0C0C000808080000000
-        FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFF0F000
-        00F0FF000FF0FFF0FFF0
-      }
-      Spacing = 0
-      OnClick = frSpeedButton1Click
-    end
-    object frSpeedButton2: TSpeedButton
-      Left = 0
-      Height = 8
-      Top = 9
-      Width = 17
-      Glyph.Data = {
-        86000000424D8600000000000000760000002800000007000000040000000100
-        0400000000001000000000000000000000001000000000000000000000000000
-        80000080000000808000800000008000800080800000C0C0C000808080000000
-        FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFF0FFF0FF00
-        0FF0F00000F0FFFFFFF0
-      }
-      OnClick = frSpeedButton2Click
-    end
-  end
   object OkButton: TButton
     Left = 282
     Height = 25
@@ -180,9 +130,9 @@
     Top = 8
     Width = 349
     Caption = 'Printer'
-    ClientHeight = 27
-    ClientWidth = 341
-    TabOrder = 5
+    ClientHeight = 31
+    ClientWidth = 345
+    TabOrder = 0
     object PropButton: TButton
       Left = 264
       Height = 25
@@ -195,17 +145,27 @@
     end
     object CB1: TComboBox
       Left = 8
-      Height = 20
+      Height = 23
       Top = 1
       Width = 245
       HelpContext = 142
-      ItemHeight = 0
+      ItemHeight = 15
       OnChange = CB1Click
       OnClick = CB1Click
       OnDrawItem = CB1DrawItem
       Style = csDropDownList
       TabOrder = 1
     end
+  end
+  object E1: TSpinEdit
+    Left = 64
+    Height = 23
+    Top = 72
+    Width = 74
+    MaxValue = 1000
+    MinValue = 1
+    TabOrder = 1
+    Value = 1
   end
   object PrinterSetupDialog1: TPrinterSetupDialog
     left = 296
--- lr_view.pas	Thu Mar 13 01:02:44 2014
+++ lr_view.pas	Thu Mar 13 00:46:44 2014
@@ -741,7 +741,7 @@
   end;
   {$ELSE}
   frPrintForm := TfrPrintForm.Create(nil);
-  frPrintForm.E1.Text:=IntToStr(TfrReport(Doc).DefaultCopies);
+  frPrintForm.E1.Value:= TfrReport(Doc).DefaultCopies;
   with frPrintForm do
   begin
     if ShowModal = mrOk then
25840.diff (6,504 bytes)

Jesus Reyes

2014-03-13 08:16

developer   ~0073661

There are two problems in this report:

1) TfrReport.DefaultCopies was initialized to 0 where it should be initialized to 1, that is fixed in Trunk r44416.

2) The Copies edit box accepted non integer values, that is already fixed in trunk, but it can't be merged because it changed many things not yet available in 1.2. For fixing this problem I made a patch, 25840.diff that should be applied to 1.2 fixes.

Issue History

Date Modified Username Field Change
2014-03-09 16:05 Attila Pinter New Issue
2014-03-09 17:40 Jonas Maebe Project FPC => Lazarus
2014-03-09 20:07 Zeljan Rikalo LazTarget => -
2014-03-09 20:07 Zeljan Rikalo Note Added: 0073574
2014-03-09 20:07 Zeljan Rikalo Assigned To => Zeljan Rikalo
2014-03-09 20:07 Zeljan Rikalo Status new => feedback
2014-03-10 07:11 Attila Pinter Note Added: 0073578
2014-03-10 07:11 Attila Pinter Status feedback => assigned
2014-03-10 07:14 Attila Pinter Note Edited: 0073578 View Revisions
2014-03-10 09:13 Zeljan Rikalo Assigned To Zeljan Rikalo => Jesus Reyes
2014-03-13 08:09 Jesus Reyes File Added: 25840.diff
2014-03-13 08:16 Jesus Reyes Fixed in Revision => 44416
2014-03-13 08:16 Jesus Reyes LazTarget - => 1.2.2
2014-03-13 08:16 Jesus Reyes Note Added: 0073661
2014-03-13 08:16 Jesus Reyes Status assigned => resolved
2014-03-13 08:16 Jesus Reyes Fixed in Version => 1.3 (SVN)
2014-03-13 08:16 Jesus Reyes Resolution open => fixed
2014-03-13 08:16 Jesus Reyes Target Version => 1.2.2