From 5d81c2234fc69489be62a14d5c985c863d9d2081 Mon Sep 17 00:00:00 2001 From: alexs75 Date: Fri, 11 Jan 2019 06:34:01 +0000 Subject: [PATCH] RxFPC:fix show preview in TRxDBGridPrint git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6789 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/trunk/languages/rxdconst.es.po | 4 + components/rx/trunk/languages/rxdconst.pl.po | 4 + components/rx/trunk/languages/rxdconst.po | 4 + components/rx/trunk/languages/rxdconst.ru.po | 4 + components/rx/trunk/languages/rxdconst.uk.po | 4 + components/rx/trunk/rxdb/rxmemds.pas | 10 +- .../rxdbgrid_print/rxdbgridprintgrid.pas | 4 + .../rxdbgridprintgrid_setupunit.lfm | 171 ++++++++++-------- .../rxdbgridprintgrid_setupunit.pas | 2 + components/rx/trunk/rxtools/rxdconst.pas | 1 + 10 files changed, 131 insertions(+), 77 deletions(-) diff --git a/components/rx/trunk/languages/rxdconst.es.po b/components/rx/trunk/languages/rxdconst.es.po index 34fc268c9..a3d14bdf5 100644 --- a/components/rx/trunk/languages/rxdconst.es.po +++ b/components/rx/trunk/languages/rxdconst.es.po @@ -724,6 +724,10 @@ msgstr "Mostrar color del pie" msgid "Show grid color" msgstr "Mostrar color de la grilla" +#: rxdconst.sshowpreview +msgid "Show preview" +msgstr "" + #: rxdconst.sshowreporttitle msgid "Show report title" msgstr "Mostrar título del reporte" diff --git a/components/rx/trunk/languages/rxdconst.pl.po b/components/rx/trunk/languages/rxdconst.pl.po index e958bb7af..597be3f8d 100644 --- a/components/rx/trunk/languages/rxdconst.pl.po +++ b/components/rx/trunk/languages/rxdconst.pl.po @@ -707,6 +707,10 @@ msgstr "Pokaż kolor stopki" msgid "Show grid color" msgstr "Pokaż kolor tabeli" +#: rxdconst.sshowpreview +msgid "Show preview" +msgstr "" + #: rxdconst.sshowreporttitle msgid "Show report title" msgstr "Pokaż tytuł taportu" diff --git a/components/rx/trunk/languages/rxdconst.po b/components/rx/trunk/languages/rxdconst.po index 867759872..e85b87a7d 100644 --- a/components/rx/trunk/languages/rxdconst.po +++ b/components/rx/trunk/languages/rxdconst.po @@ -698,6 +698,10 @@ msgstr "" msgid "Show grid color" msgstr "" +#: rxdconst.sshowpreview +msgid "Show preview" +msgstr "" + #: rxdconst.sshowreporttitle msgid "Show report title" msgstr "" diff --git a/components/rx/trunk/languages/rxdconst.ru.po b/components/rx/trunk/languages/rxdconst.ru.po index ead5cdb3d..dd5ddf3ea 100644 --- a/components/rx/trunk/languages/rxdconst.ru.po +++ b/components/rx/trunk/languages/rxdconst.ru.po @@ -706,6 +706,10 @@ msgstr "Отображать цвет итогов" msgid "Show grid color" msgstr "Отображать цвета таблицы" +#: rxdconst.sshowpreview +msgid "Show preview" +msgstr "Предварительный просмотр" + #: rxdconst.sshowreporttitle msgid "Show report title" msgstr "Отображать заголовок отчёта" diff --git a/components/rx/trunk/languages/rxdconst.uk.po b/components/rx/trunk/languages/rxdconst.uk.po index 4729e7398..8ced7df89 100644 --- a/components/rx/trunk/languages/rxdconst.uk.po +++ b/components/rx/trunk/languages/rxdconst.uk.po @@ -712,6 +712,10 @@ msgstr "Показати колір пісумку" msgid "Show grid color" msgstr "Показати колір таблиці" +#: rxdconst.sshowpreview +msgid "Show preview" +msgstr "" + #: rxdconst.sshowreporttitle msgid "Show report title" msgstr "Показати заголовок звіту" diff --git a/components/rx/trunk/rxdb/rxmemds.pas b/components/rx/trunk/rxdb/rxmemds.pas index e5f16afda..906cd8905 100644 --- a/components/rx/trunk/rxdb/rxmemds.pas +++ b/components/rx/trunk/rxdb/rxmemds.pas @@ -1747,7 +1747,15 @@ end; procedure TRxMemoryData.SortOnFieldsEx(const FieldNames: string; CaseInsensitive: Boolean; Asc: array of boolean); begin - +(* CreateIndexList(FieldNames); + FCaseInsensitiveSort := CaseInsensitive; + FDescendingSort := Descending; + try + Sort; + except + FreeIndexList; + raise; + end; *) end; procedure TRxMemoryData.Sort; diff --git a/components/rx/trunk/rxdbgrid_print/rxdbgridprintgrid.pas b/components/rx/trunk/rxdbgrid_print/rxdbgridprintgrid.pas index c9a9a58f7..a10170746 100644 --- a/components/rx/trunk/rxdbgrid_print/rxdbgridprintgrid.pas +++ b/components/rx/trunk/rxdbgrid_print/rxdbgridprintgrid.pas @@ -515,6 +515,7 @@ begin RxDBGridPrintGrid_SetupForm.CheckGroup1.Checked[4]:=rxpoShowReportTitle in FOptions; RxDBGridPrintGrid_SetupForm.CheckGroup1.Checked[5]:=rxpoHideZeroValues in FOptions; RxDBGridPrintGrid_SetupForm.CheckGroup1.Checked[6]:=rxpoColSpanning in FOptions; + RxDBGridPrintGrid_SetupForm.CheckGroup1.Checked[7]:=rxpoShowPreview in FOptions; Result:=RxDBGridPrintGrid_SetupForm.ShowModal = mrOk; if Result then @@ -549,6 +550,9 @@ begin if RxDBGridPrintGrid_SetupForm.CheckGroup1.Checked[6] then FOptions:=FOptions + [rxpoColSpanning]; + if RxDBGridPrintGrid_SetupForm.CheckGroup1.Checked[7] then + FOptions:=FOptions + [rxpoShowPreview]; + FShowColumnHeaderOnAllPage:=RxDBGridPrintGrid_SetupForm.CheckBox1.Checked; end; RxDBGridPrintGrid_SetupForm.Free; diff --git a/components/rx/trunk/rxdbgrid_print/rxdbgridprintgrid_setupunit.lfm b/components/rx/trunk/rxdbgrid_print/rxdbgridprintgrid_setupunit.lfm index 1abe162c8..e1c8926dd 100644 --- a/components/rx/trunk/rxdbgrid_print/rxdbgridprintgrid_setupunit.lfm +++ b/components/rx/trunk/rxdbgrid_print/rxdbgridprintgrid_setupunit.lfm @@ -1,39 +1,40 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm - Left = 720 - Height = 347 - Top = 303 - Width = 489 + Left = 560 + Height = 403 + Top = 232 + Width = 607 Caption = 'Print grid setup' - ClientHeight = 347 - ClientWidth = 489 + ClientHeight = 403 + ClientWidth = 607 OnCreate = FormCreate Position = poScreenCenter - LCLVersion = '1.9.0.0' + LCLVersion = '2.1.0.0' object GroupBox1: TGroupBox AnchorSideLeft.Control = Owner AnchorSideTop.Control = Owner - AnchorSideRight.Control = CheckGroup1 + AnchorSideRight.Control = CLabel AnchorSideBottom.Control = CheckBox1 Left = 6 - Height = 165 + Height = 100 Top = 6 - Width = 316 - Anchors = [akTop, akLeft, akRight, akBottom] + Width = 291 + Anchors = [akTop, akLeft, akRight] + AutoSize = True BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 Caption = 'Page margins' - ClientHeight = 144 - ClientWidth = 314 + ClientHeight = 80 + ClientWidth = 289 TabOrder = 0 object Label1: TLabel AnchorSideLeft.Control = GroupBox1 AnchorSideBottom.Control = SpinEdit1 AnchorSideBottom.Side = asrBottom Left = 6 - Height = 20 - Top = 23 - Width = 24 + Height = 19 + Top = 18 + Width = 25 Anchors = [akLeft, akBottom] BorderSpacing.Left = 6 Caption = 'Top' @@ -42,8 +43,8 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm object SpinEdit1: TSpinEdit AnchorSideTop.Control = GroupBox1 AnchorSideRight.Control = Label5 - Left = 91 - Height = 37 + Left = 78 + Height = 31 Top = 6 Width = 60 Anchors = [akTop, akRight] @@ -56,9 +57,9 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm AnchorSideBottom.Control = SpinEdit2 AnchorSideBottom.Side = asrBottom Left = 6 - Height = 20 - Top = 66 - Width = 25 + Height = 19 + Top = 55 + Width = 26 Anchors = [akLeft, akBottom] BorderSpacing.Left = 6 Caption = 'Left' @@ -69,9 +70,9 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm AnchorSideTop.Control = SpinEdit1 AnchorSideTop.Side = asrBottom AnchorSideRight.Control = Label5 - Left = 91 - Height = 37 - Top = 49 + Left = 78 + Height = 31 + Top = 43 Width = 60 Anchors = [akTop, akRight] BorderSpacing.Around = 6 @@ -83,8 +84,8 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm AnchorSideTop.Control = GroupBox1 AnchorSideRight.Control = GroupBox1 AnchorSideRight.Side = asrBottom - Left = 248 - Height = 37 + Left = 223 + Height = 31 Top = 6 Width = 60 Anchors = [akTop, akRight] @@ -97,10 +98,10 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm AnchorSideLeft.Side = asrBottom AnchorSideBottom.Control = SpinEdit3 AnchorSideBottom.Side = asrBottom - Left = 158 - Height = 20 - Top = 23 - Width = 33 + Left = 145 + Height = 19 + Top = 18 + Width = 34 Anchors = [akLeft, akBottom] Caption = 'Right' ParentColor = False @@ -110,10 +111,10 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm AnchorSideLeft.Side = asrBottom AnchorSideBottom.Control = SpinEdit4 AnchorSideBottom.Side = asrBottom - Left = 158 - Height = 20 - Top = 66 - Width = 47 + Left = 145 + Height = 19 + Top = 55 + Width = 49 Anchors = [akLeft, akBottom] Caption = 'Bottom' ParentColor = False @@ -123,9 +124,9 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm AnchorSideTop.Side = asrBottom AnchorSideRight.Control = GroupBox1 AnchorSideRight.Side = asrBottom - Left = 248 - Height = 37 - Top = 49 + Left = 223 + Height = 31 + Top = 43 Width = 60 Anchors = [akTop, akRight] BorderSpacing.Around = 6 @@ -136,7 +137,7 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm AnchorSideLeft.Control = GroupBox1 AnchorSideLeft.Side = asrCenter AnchorSideTop.Control = GroupBox1 - Left = 157 + Left = 144 Height = 1 Top = 0 Width = 1 @@ -145,9 +146,9 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm end object ButtonPanel1: TButtonPanel Left = 6 - Height = 46 - Top = 295 - Width = 477 + Height = 42 + Top = 355 + Width = 595 OKButton.Name = 'OKButton' OKButton.DefaultCaption = True HelpButton.Name = 'HelpButton' @@ -160,14 +161,16 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm ShowButtons = [pbOK, pbCancel, pbHelp] end object CheckGroup1: TCheckGroup - AnchorSideTop.Control = Owner + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = GroupBox1 + AnchorSideTop.Side = asrBottom AnchorSideRight.Control = Owner AnchorSideRight.Side = asrBottom - Left = 328 - Height = 201 - Top = 6 - Width = 155 - Anchors = [akTop, akRight] + Left = 6 + Height = 124 + Top = 112 + Width = 595 + Anchors = [akTop, akLeft, akRight] AutoFill = True AutoSize = True BorderSpacing.Around = 6 @@ -179,9 +182,10 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm ChildSizing.ShrinkHorizontal = crsScaleChilds ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.Layout = cclLeftToRightThenTopToBottom - ChildSizing.ControlsPerLine = 1 - ClientHeight = 180 - ClientWidth = 153 + ChildSizing.ControlsPerLine = 2 + ClientHeight = 104 + ClientWidth = 593 + Columns = 2 Items.Strings = ( 'Show title' 'Show footer' @@ -190,23 +194,30 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm 'Show report title' 'Hide zero values' 'Merge cell''s' + 'Show preview' ) TabOrder = 2 Data = { - 0700000002020202020202 + 080000000202020202020202 } end object RadioGroup1: TRadioGroup - AnchorSideLeft.Control = Owner - AnchorSideTop.Control = CheckBox1 - AnchorSideTop.Side = asrBottom - Left = 6 - Height = 69 - Top = 207 - Width = 107 + AnchorSideLeft.Control = CLabel + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Owner + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = GroupBox1 + AnchorSideBottom.Side = asrBottom + Left = 304 + Height = 100 + Top = 6 + Width = 297 + Anchors = [akTop, akLeft, akRight, akBottom] AutoFill = True AutoSize = True - BorderSpacing.Around = 6 + BorderSpacing.Top = 6 + BorderSpacing.Right = 6 Caption = 'Orientation' ChildSizing.LeftRightSpacing = 6 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize @@ -215,8 +226,8 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 - ClientHeight = 48 - ClientWidth = 105 + ClientHeight = 80 + ClientWidth = 295 Items.Strings = ( 'Portrait' 'Landscape' @@ -224,14 +235,13 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm TabOrder = 3 end object Label6: TLabel - AnchorSideLeft.Control = RadioGroup1 - AnchorSideLeft.Side = asrBottom + AnchorSideLeft.Control = Owner AnchorSideTop.Control = CheckBox1 AnchorSideTop.Side = asrBottom - Left = 119 - Height = 20 - Top = 207 - Width = 72 + Left = 6 + Height = 19 + Top = 271 + Width = 73 BorderSpacing.Around = 6 Caption = 'Report title' ParentColor = False @@ -242,27 +252,36 @@ object RxDBGridPrintGrid_SetupForm: TRxDBGridPrintGrid_SetupForm AnchorSideTop.Side = asrBottom AnchorSideRight.Control = Owner AnchorSideRight.Side = asrBottom - Left = 125 - Height = 37 - Top = 233 - Width = 358 + Left = 12 + Height = 31 + Top = 296 + Width = 589 Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 TabOrder = 4 end object CheckBox1: TCheckBox AnchorSideLeft.Control = Owner + AnchorSideTop.Control = CheckGroup1 AnchorSideTop.Side = asrBottom AnchorSideRight.Control = CheckGroup1 - AnchorSideBottom.Control = CheckGroup1 AnchorSideBottom.Side = asrBottom Left = 6 - Height = 24 - Top = 177 - Width = 235 - Anchors = [akLeft, akBottom] + Height = 23 + Top = 242 + Width = 236 BorderSpacing.Around = 6 Caption = 'Show column header on all page' TabOrder = 5 end + object CLabel: TLabel + AnchorSideLeft.Control = Owner + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Owner + Left = 303 + Height = 1 + Top = 0 + Width = 1 + ParentColor = False + end end diff --git a/components/rx/trunk/rxdbgrid_print/rxdbgridprintgrid_setupunit.pas b/components/rx/trunk/rxdbgrid_print/rxdbgridprintgrid_setupunit.pas index 101583a30..d6d221956 100644 --- a/components/rx/trunk/rxdbgrid_print/rxdbgridprintgrid_setupunit.pas +++ b/components/rx/trunk/rxdbgrid_print/rxdbgridprintgrid_setupunit.pas @@ -55,6 +55,7 @@ type Label4: TLabel; Label5: TLabel; Label6: TLabel; + CLabel: TLabel; RadioGroup1: TRadioGroup; SpinEdit1: TSpinEdit; SpinEdit2: TSpinEdit; @@ -85,6 +86,7 @@ begin CheckGroup1.Items[4]:=sShowReportTitle; CheckGroup1.Items[5]:=sHideZeroValues; CheckGroup1.Items[6]:=sMergeCells; + CheckGroup1.Items[7]:=sShowPreview; GroupBox1.Caption:=sPageMargins; diff --git a/components/rx/trunk/rxtools/rxdconst.pas b/components/rx/trunk/rxtools/rxdconst.pas index da9fbb3e7..6fa8fd1f3 100644 --- a/components/rx/trunk/rxtools/rxdconst.pas +++ b/components/rx/trunk/rxtools/rxdconst.pas @@ -209,6 +209,7 @@ resourcestring sCompressFonts = 'Compress fonts'; sCompressImages = 'Compress images'; sUseRawJPEG = 'Use raw JPEG'; + sShowPreview = 'Show preview'; sShowTitle = 'Show column title'; sShowFooter = 'Show footer';