RxFPC:new RxDBGrid tool - setup footer row

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4150 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2015-05-25 10:12:12 +00:00
parent 4ccf6e7c15
commit 63d7776f8c
15 changed files with 682 additions and 52 deletions

View File

@ -11,7 +11,6 @@
<ResourceType Value="res"/> <ResourceType Value="res"/>
<UseXPManifest Value="True"/> <UseXPManifest Value="True"/>
<Icon Value="0"/> <Icon Value="0"/>
<ActiveWindowIndexAtStart Value="0"/>
</General> </General>
<VersionInfo> <VersionInfo>
<UseVersionInfo Value="True"/> <UseVersionInfo Value="True"/>
@ -71,10 +70,7 @@
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="RxDBGridMainUnit"/> <UnitName Value="RxDBGridMainUnit"/>
<IsVisibleTab Value="True"/> <IsVisibleTab Value="True"/>
<EditorIndex Value="0"/> <CursorPos X="37" Y="11"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="10" Y="11"/>
<UsageCount Value="100"/> <UsageCount Value="100"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/> <LoadedDesigner Value="True"/>
@ -99,15 +95,13 @@
</Unit4> </Unit4>
<Unit5> <Unit5>
<Filename Value="../../rxdbgrid.pas"/> <Filename Value="../../rxdbgrid.pas"/>
<UnitName Value="rxdbgrid"/>
<EditorIndex Value="1"/> <EditorIndex Value="1"/>
<WindowIndex Value="0"/>
<TopLine Value="3475"/> <TopLine Value="3475"/>
<CursorPos X="1" Y="3495"/> <CursorPos Y="3495"/>
<UsageCount Value="17"/> <UsageCount Value="17"/>
<Bookmarks Count="2"> <Bookmarks Count="2">
<Item0 X="1" Y="2573" ID="2"/> <Item0 Y="2573" ID="2"/>
<Item1 X="1" Y="3776" ID="1"/> <Item1 Y="3776" ID="1"/>
</Bookmarks> </Bookmarks>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit5> </Unit5>
@ -437,7 +431,6 @@
<Filename Value="../../../../lcl/dbgrids.pas"/> <Filename Value="../../../../lcl/dbgrids.pas"/>
<UnitName Value="DBGrids"/> <UnitName Value="DBGrids"/>
<EditorIndex Value="2"/> <EditorIndex Value="2"/>
<WindowIndex Value="0"/>
<TopLine Value="213"/> <TopLine Value="213"/>
<CursorPos X="3" Y="216"/> <CursorPos X="3" Y="216"/>
<UsageCount Value="19"/> <UsageCount Value="19"/>
@ -447,7 +440,6 @@
<Filename Value="../../../../lcl/grids.pas"/> <Filename Value="../../../../lcl/grids.pas"/>
<UnitName Value="Grids"/> <UnitName Value="Grids"/>
<EditorIndex Value="3"/> <EditorIndex Value="3"/>
<WindowIndex Value="0"/>
<TopLine Value="10079"/> <TopLine Value="10079"/>
<CursorPos X="25" Y="10111"/> <CursorPos X="25" Y="10111"/>
<UsageCount Value="22"/> <UsageCount Value="22"/>
@ -572,7 +564,6 @@
<Filename Value="../../../../lcl/controls.pp"/> <Filename Value="../../../../lcl/controls.pp"/>
<UnitName Value="Controls"/> <UnitName Value="Controls"/>
<EditorIndex Value="4"/> <EditorIndex Value="4"/>
<WindowIndex Value="0"/>
<TopLine Value="2211"/> <TopLine Value="2211"/>
<CursorPos X="15" Y="2233"/> <CursorPos X="15" Y="2233"/>
<UsageCount Value="11"/> <UsageCount Value="11"/>
@ -737,7 +728,6 @@
</Unit104> </Unit104>
<Unit105> <Unit105>
<Filename Value="/home/alexs/install/src/fixes_2_6/rtl/objpas/classes/classesh.inc"/> <Filename Value="/home/alexs/install/src/fixes_2_6/rtl/objpas/classes/classesh.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="471"/> <TopLine Value="471"/>
<CursorPos X="15" Y="491"/> <CursorPos X="15" Y="491"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
@ -858,11 +848,11 @@
</Position28> </Position28>
<Position29> <Position29>
<Filename Value="rxdbgridmainunit.pas"/> <Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="10" Column="3" TopLine="1"/> <Caret Line="10" Column="3"/>
</Position29> </Position29>
<Position30> <Position30>
<Filename Value="rxdbgridmainunit.pas"/> <Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="11" Column="10" TopLine="1"/> <Caret Line="11" Column="10"/>
</Position30> </Position30>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>
@ -887,9 +877,6 @@
</Win32> </Win32>
</Options> </Options>
</Linking> </Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions> </CompilerOptions>
<Debugging> <Debugging>
<Watches Count="5"> <Watches Count="5">
@ -918,5 +905,4 @@
</Item2> </Item2>
</Exceptions> </Exceptions>
</Debugging> </Debugging>
<EditorMacros Count="0"/>
</CONFIG> </CONFIG>

View File

@ -11,7 +11,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
OnCreate = FormCreate OnCreate = FormCreate
SessionProperties = 'RxDBGridExportSpreadSheet1.FileName;RxDBGridExportSpreadSheet1.OpenAfterExport;RxDBGridExportSpreadSheet1.Options;RxDBGridExportSpreadSheet1.PageName;RxDBGridPrint1.Options;RxDBGridPrint1.Orientation;RxDBGridPrint1.PageMargin;RxDBGridPrint1.ReportTitle;RxDBGridPrint1.ShowColumnHeaderOnAllPage' SessionProperties = 'RxDBGridExportSpreadSheet1.FileName;RxDBGridExportSpreadSheet1.OpenAfterExport;RxDBGridExportSpreadSheet1.Options;RxDBGridExportSpreadSheet1.PageName;RxDBGridPrint1.Options;RxDBGridPrint1.Orientation;RxDBGridPrint1.PageMargin;RxDBGridPrint1.ReportTitle;RxDBGridPrint1.ShowColumnHeaderOnAllPage'
ShowHint = True ShowHint = True
LCLVersion = '1.2.4.0' LCLVersion = '1.5'
object RxDBGrid1: TRxDBGrid object RxDBGrid1: TRxDBGrid
Left = 0 Left = 0
Height = 624 Height = 624
@ -23,10 +23,10 @@ object RxDBGridMainForm: TRxDBGridMainForm
Columns = < Columns = <
item item
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = '...'
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
Title.Hint = 'DEVELOPER' Title.Hint = 'DEVELOPER'
Title.ShowHint = True Title.ShowHint = True
Title.Caption = '...'
Width = 50 Width = 50
FieldName = 'DEVELOPER_ID' FieldName = 'DEVELOPER_ID'
Constraints.MinWidth = 50 Constraints.MinWidth = 50
@ -47,10 +47,10 @@ object RxDBGridMainForm: TRxDBGridMainForm
item item
Color = clSkyBlue Color = clSkyBlue
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'Code - ID'
Title.Orientation = toVertical90 Title.Orientation = toVertical90
Title.Hint = 'Code - ID' Title.Hint = 'Code - ID'
Title.ShowHint = True Title.ShowHint = True
Title.Caption = 'Code - ID'
Width = 100 Width = 100
FieldName = 'ID' FieldName = 'ID'
EditButtons = <> EditButtons = <>
@ -66,10 +66,10 @@ object RxDBGridMainForm: TRxDBGridMainForm
end end
item item
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'Developer'
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
Title.Hint = 'Developer full name' Title.Hint = 'Developer full name'
Title.ShowHint = True Title.ShowHint = True
Title.Caption = 'Developer'
Width = 136 Width = 136
FieldName = 'Developer' FieldName = 'Developer'
Constraints.MinWidth = 10 Constraints.MinWidth = 10
@ -89,10 +89,10 @@ object RxDBGridMainForm: TRxDBGridMainForm
end end
item item
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'Computer software (all info) - Программное обеспечение|Name'
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
Title.Hint = 'Product name' Title.Hint = 'Product name'
Title.ShowHint = True Title.ShowHint = True
Title.Caption = 'Computer software (all info) - Программное обеспечение|Name'
Width = 110 Width = 110
FieldName = 'NAME' FieldName = 'NAME'
EditButtons = <> EditButtons = <>
@ -106,10 +106,10 @@ object RxDBGridMainForm: TRxDBGridMainForm
end end
item item
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'Computer software (all info) - Программное обеспечение|Cost'
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
Title.Hint = 'Product price' Title.Hint = 'Product price'
Title.ShowHint = True Title.ShowHint = True
Title.Caption = 'Computer software (all info) - Программное обеспечение|Cost'
Width = 136 Width = 136
FieldName = 'PRICE' FieldName = 'PRICE'
DisplayFormat = '#,##0.00' DisplayFormat = '#,##0.00'
@ -142,10 +142,10 @@ object RxDBGridMainForm: TRxDBGridMainForm
end end
item item
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'Computer software (all info) - Программное обеспечение|Date Present'
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
Title.Hint = 'Soft date present...' Title.Hint = 'Soft date present...'
Title.ShowHint = True Title.ShowHint = True
Title.Caption = 'Computer software (all info) - Программное обеспечение|Date Present'
Width = 136 Width = 136
FieldName = 'Date_Present' FieldName = 'Date_Present'
EditButtons = <> EditButtons = <>
@ -157,10 +157,10 @@ object RxDBGridMainForm: TRxDBGridMainForm
end end
item item
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'DEVELOPER_ID'
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
Title.Hint = 'DEVELOPER' Title.Hint = 'DEVELOPER'
Title.ShowHint = True Title.ShowHint = True
Title.Caption = 'DEVELOPER_ID'
Width = 141 Width = 141
FieldName = 'DEVELOPER_ID' FieldName = 'DEVELOPER_ID'
EditButtons = <> EditButtons = <>
@ -178,8 +178,8 @@ object RxDBGridMainForm: TRxDBGridMainForm
'Negative' 'Negative'
) )
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'Rait'
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
Title.Caption = 'Rait'
FieldName = 'RAIT' FieldName = 'RAIT'
DirectInput = False DirectInput = False
EditButtons = < EditButtons = <
@ -317,7 +317,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
AnchorSideLeft.Control = Button2 AnchorSideLeft.Control = Button2
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1 AnchorSideTop.Control = Panel1
Left = 274 Left = 270
Height = 21 Height = 21
Top = 7 Top = 7
Width = 36 Width = 36
@ -331,7 +331,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
Left = 7 Left = 7
Height = 33 Height = 33
Top = 7 Top = 7
Width = 89 Width = 87
Action = actCalcTotal Action = actCalcTotal
AutoSize = True AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -341,10 +341,10 @@ object RxDBGridMainForm: TRxDBGridMainForm
AnchorSideLeft.Control = Button1 AnchorSideLeft.Control = Button1
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1 AnchorSideTop.Control = Panel1
Left = 102 Left = 100
Height = 33 Height = 33
Top = 7 Top = 7
Width = 166 Width = 164
Action = actOptimizeColumnsWidthAll Action = actOptimizeColumnsWidthAll
AutoSize = True AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -355,7 +355,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = CheckBox2 AnchorSideTop.Control = CheckBox2
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 503 Left = 499
Height = 25 Height = 25
Hint = 'Use filter line' Hint = 'Use filter line'
Top = 38 Top = 38
@ -369,7 +369,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
AnchorSideLeft.Control = Label1 AnchorSideLeft.Control = Label1
AnchorSideTop.Control = Label1 AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 280 Left = 276
Height = 29 Height = 29
Top = 34 Top = 34
Width = 217 Width = 217
@ -389,7 +389,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
AnchorSideLeft.Control = ComboBox1 AnchorSideLeft.Control = ComboBox1
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1 AnchorSideTop.Control = Panel1
Left = 503 Left = 499
Height = 25 Height = 25
Hint = 'Auto fill column width' Hint = 'Auto fill column width'
Top = 7 Top = 7
@ -403,7 +403,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
AnchorSideLeft.Control = CheckBox2 AnchorSideLeft.Control = CheckBox2
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1 AnchorSideTop.Control = Panel1
Left = 643 Left = 639
Height = 25 Height = 25
Top = 7 Top = 7
Width = 122 Width = 122
@ -419,7 +419,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = CheckBox3 AnchorSideTop.Control = CheckBox3
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 643 Left = 639
Height = 25 Height = 25
Top = 38 Top = 38
Width = 118 Width = 118
@ -434,7 +434,7 @@ object RxDBGridMainForm: TRxDBGridMainForm
AnchorSideLeft.Control = CheckBox3 AnchorSideLeft.Control = CheckBox3
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1 AnchorSideTop.Control = Panel1
Left = 771 Left = 767
Height = 25 Height = 25
Top = 7 Top = 7
Width = 97 Width = 97
@ -480,19 +480,14 @@ object RxDBGridMainForm: TRxDBGridMainForm
item item
Name = 'Date_Present' Name = 'Date_Present'
DataType = ftDate DataType = ftDate
Precision = 0
Size = 0
end end
item item
Name = 'DEVELOPER_ID' Name = 'DEVELOPER_ID'
DataType = ftInteger DataType = ftInteger
Precision = 0
Size = 0
end end
item item
Name = 'RAIT' Name = 'RAIT'
DataType = ftString DataType = ftString
Precision = 0
Size = 15 Size = 15
end> end>
PacketRecords = 0 PacketRecords = 0
@ -655,13 +650,10 @@ object RxDBGridMainForm: TRxDBGridMainForm
item item
Name = 'DEVELOPER_ID' Name = 'DEVELOPER_ID'
DataType = ftInteger DataType = ftInteger
Precision = 0
Size = 0
end end
item item
Name = 'DEVELOPER_NAME' Name = 'DEVELOPER_NAME'
DataType = ftString DataType = ftString
Precision = 0
Size = 130 Size = 130
end> end>
PacketRecords = 0 PacketRecords = 0
@ -1370,4 +1362,10 @@ object RxDBGridMainForm: TRxDBGridMainForm
left = 548 left = 548
top = 269 top = 269
end end
object RxDBGridFooterTools1: TRxDBGridFooterTools
RxDBGrid = RxDBGrid1
Caption = 'Totals row'
left = 591
top = 270
end
end end

View File

@ -7,8 +7,8 @@ interface
uses uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, rxmemds, Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, rxmemds,
DB, rxdbgrid, RxAboutDialog, RxIniPropStorage, RxDBGridPrintGrid, DB, rxdbgrid, RxAboutDialog, RxIniPropStorage, RxDBGridPrintGrid,
RxDBGridExportSpreadSheet, ExtCtrls, Buttons, Menus, ActnList, StdCtrls, RxDBGridExportSpreadSheet, RxDBGridFooterTools, ExtCtrls, Buttons, Menus,
DBGrids, types; ActnList, StdCtrls, DBGrids, types;
type type
@ -23,6 +23,7 @@ type
MenuItem9: TMenuItem; MenuItem9: TMenuItem;
RxAboutDialog1: TRxAboutDialog; RxAboutDialog1: TRxAboutDialog;
RxDBGridExportSpreadSheet1: TRxDBGridExportSpreadSheet; RxDBGridExportSpreadSheet1: TRxDBGridExportSpreadSheet;
RxDBGridFooterTools1: TRxDBGridFooterTools;
RxDBGridPrint1: TRxDBGridPrint; RxDBGridPrint1: TRxDBGridPrint;
RxIniPropStorage1: TRxIniPropStorage; RxIniPropStorage1: TRxIniPropStorage;
RxMemoryData1RAIT: TStringField; RxMemoryData1RAIT: TStringField;

View File

@ -29,6 +29,10 @@ msgstr "Cambiar clave"
msgid "SCircularDataLink" msgid "SCircularDataLink"
msgstr "SCircularEnlaceDato" msgstr "SCircularEnlaceDato"
#: rxdconst.scollumnname
msgid "Collumn name"
msgstr ""
#: rxdconst.sconfirmpasswordlabel #: rxdconst.sconfirmpasswordlabel
msgid "&Confirm:" msgid "&Confirm:"
msgstr "&Confirmar:" msgstr "&Confirmar:"
@ -143,6 +147,46 @@ msgstr "Campo '%s' debe tener un valor"
msgid "Type mismatch for field '%s', expecting: %s actual: %s" msgid "Type mismatch for field '%s', expecting: %s actual: %s"
msgstr "Tipo no corresponde para el campo '%s', se esperaba: %s actual: %s" msgstr "Tipo no corresponde para el campo '%s', se esperaba: %s actual: %s"
#: rxdconst.sfunction
msgid "Function"
msgstr ""
#: rxdconst.sfvtavg
msgid "AVG"
msgstr ""
#: rxdconst.sfvtcount
msgid "Count"
msgstr ""
#: rxdconst.sfvtfieldvalue
msgid "Field value"
msgstr ""
#: rxdconst.sfvtmax
msgid "Max value"
msgstr ""
#: rxdconst.sfvtmin
msgid "Min value"
msgstr ""
#: rxdconst.sfvtnon
msgid "None"
msgstr ""
#: rxdconst.sfvtrecno
msgid "Record no"
msgstr ""
#: rxdconst.sfvtstatictext
msgid "Static text"
msgstr ""
#: rxdconst.sfvtsum
msgid "Sum"
msgstr ""
#: rxdconst.shidezerovalues #: rxdconst.shidezerovalues
msgid "Hide zero values" msgid "Hide zero values"
msgstr "" msgstr ""
@ -400,6 +444,10 @@ msgstr "Seleccionar Columnas Visibles"
msgid "Sort data for collumns" msgid "Sort data for collumns"
msgstr "Ordenar por Columnas" msgstr "Ordenar por Columnas"
#: rxdconst.srxdbgridtoolscaption
msgid "Totals row"
msgstr ""
#: rxdconst.srxdescending #: rxdconst.srxdescending
msgid "Descending" msgid "Descending"
msgstr "Descendente" msgstr "Descendente"
@ -521,6 +569,10 @@ msgstr "Error del Servidor"
msgid "find" msgid "find"
msgstr "buscar" msgstr "buscar"
#: rxdconst.ssetuptotalrow
msgid "Setup total row"
msgstr ""
#: rxdconst.sshowcolumnheaderonallpage #: rxdconst.sshowcolumnheaderonallpage
msgid "Show column header on all page" msgid "Show column header on all page"
msgstr "" msgstr ""

View File

@ -29,6 +29,10 @@ msgstr ""
msgid "SCircularDataLink" msgid "SCircularDataLink"
msgstr "" msgstr ""
#: rxdconst.scollumnname
msgid "Collumn name"
msgstr ""
#: rxdconst.sconfirmpasswordlabel #: rxdconst.sconfirmpasswordlabel
msgid "&Confirm:" msgid "&Confirm:"
msgstr "" msgstr ""
@ -141,6 +145,46 @@ msgstr ""
msgid "Type mismatch for field '%s', expecting: %s actual: %s" msgid "Type mismatch for field '%s', expecting: %s actual: %s"
msgstr "" msgstr ""
#: rxdconst.sfunction
msgid "Function"
msgstr ""
#: rxdconst.sfvtavg
msgid "AVG"
msgstr ""
#: rxdconst.sfvtcount
msgid "Count"
msgstr ""
#: rxdconst.sfvtfieldvalue
msgid "Field value"
msgstr ""
#: rxdconst.sfvtmax
msgid "Max value"
msgstr ""
#: rxdconst.sfvtmin
msgid "Min value"
msgstr ""
#: rxdconst.sfvtnon
msgid "None"
msgstr ""
#: rxdconst.sfvtrecno
msgid "Record no"
msgstr ""
#: rxdconst.sfvtstatictext
msgid "Static text"
msgstr ""
#: rxdconst.sfvtsum
msgid "Sum"
msgstr ""
#: rxdconst.shidezerovalues #: rxdconst.shidezerovalues
msgid "Hide zero values" msgid "Hide zero values"
msgstr "" msgstr ""
@ -397,6 +441,10 @@ msgstr ""
msgid "Sort data for collumns" msgid "Sort data for collumns"
msgstr "" msgstr ""
#: rxdconst.srxdbgridtoolscaption
msgid "Totals row"
msgstr ""
#: rxdconst.srxdescending #: rxdconst.srxdescending
msgid "Descending" msgid "Descending"
msgstr "" msgstr ""
@ -515,6 +563,10 @@ msgstr ""
msgid "find" msgid "find"
msgstr "" msgstr ""
#: rxdconst.ssetuptotalrow
msgid "Setup total row"
msgstr ""
#: rxdconst.sshowcolumnheaderonallpage #: rxdconst.sshowcolumnheaderonallpage
msgid "Show column header on all page" msgid "Show column header on all page"
msgstr "" msgstr ""

View File

@ -29,6 +29,10 @@ msgstr "Изменить пароль"
msgid "SCircularDataLink" msgid "SCircularDataLink"
msgstr "Перекрёстная ссылка данных" msgstr "Перекрёстная ссылка данных"
#: rxdconst.scollumnname
msgid "Collumn name"
msgstr ""
#: rxdconst.sconfirmpasswordlabel #: rxdconst.sconfirmpasswordlabel
msgid "&Confirm:" msgid "&Confirm:"
msgstr "&Подтверждение:" msgstr "&Подтверждение:"
@ -143,6 +147,46 @@ msgstr "Поле '%s' ожидает значение"
msgid "Type mismatch for field '%s', expecting: %s actual: %s" msgid "Type mismatch for field '%s', expecting: %s actual: %s"
msgstr "Несоответсвие типов для поля '%s', необходимо: %s введено: %s" msgstr "Несоответсвие типов для поля '%s', необходимо: %s введено: %s"
#: rxdconst.sfunction
msgid "Function"
msgstr ""
#: rxdconst.sfvtavg
msgid "AVG"
msgstr ""
#: rxdconst.sfvtcount
msgid "Count"
msgstr ""
#: rxdconst.sfvtfieldvalue
msgid "Field value"
msgstr ""
#: rxdconst.sfvtmax
msgid "Max value"
msgstr ""
#: rxdconst.sfvtmin
msgid "Min value"
msgstr ""
#: rxdconst.sfvtnon
msgid "None"
msgstr ""
#: rxdconst.sfvtrecno
msgid "Record no"
msgstr ""
#: rxdconst.sfvtstatictext
msgid "Static text"
msgstr ""
#: rxdconst.sfvtsum
msgid "Sum"
msgstr ""
#: rxdconst.shidezerovalues #: rxdconst.shidezerovalues
msgid "Hide zero values" msgid "Hide zero values"
msgstr "" msgstr ""
@ -400,6 +444,10 @@ msgstr "Выбор столбцов для отображения"
msgid "Sort data for collumns" msgid "Sort data for collumns"
msgstr "Сортировать данные по колонкам" msgstr "Сортировать данные по колонкам"
#: rxdconst.srxdbgridtoolscaption
msgid "Totals row"
msgstr ""
#: rxdconst.srxdescending #: rxdconst.srxdescending
msgid "Descending" msgid "Descending"
msgstr "По убыванию" msgstr "По убыванию"
@ -519,6 +567,10 @@ msgstr "Ошибка сервера"
msgid "find" msgid "find"
msgstr "поиск" msgstr "поиск"
#: rxdconst.ssetuptotalrow
msgid "Setup total row"
msgstr ""
#: rxdconst.sshowcolumnheaderonallpage #: rxdconst.sshowcolumnheaderonallpage
msgid "Show column header on all page" msgid "Show column header on all page"
msgstr "" msgstr ""

View File

@ -38,6 +38,10 @@ msgstr "Змінити пароль"
msgid "SCircularDataLink" msgid "SCircularDataLink"
msgstr "Перехресне посилання даних" msgstr "Перехресне посилання даних"
#: rxdconst.scollumnname
msgid "Collumn name"
msgstr ""
#: rxdconst.sconfirmpasswordlabel #: rxdconst.sconfirmpasswordlabel
msgid "&Confirm:" msgid "&Confirm:"
msgstr "&Підтвердження:" msgstr "&Підтвердження:"
@ -152,6 +156,46 @@ msgstr "Поле '%s' очікує значення"
msgid "Type mismatch for field '%s', expecting: %s actual: %s" msgid "Type mismatch for field '%s', expecting: %s actual: %s"
msgstr "Несоответсвие типов для поля '%s', необходимо: %s введено: %s" msgstr "Несоответсвие типов для поля '%s', необходимо: %s введено: %s"
#: rxdconst.sfunction
msgid "Function"
msgstr ""
#: rxdconst.sfvtavg
msgid "AVG"
msgstr ""
#: rxdconst.sfvtcount
msgid "Count"
msgstr ""
#: rxdconst.sfvtfieldvalue
msgid "Field value"
msgstr ""
#: rxdconst.sfvtmax
msgid "Max value"
msgstr ""
#: rxdconst.sfvtmin
msgid "Min value"
msgstr ""
#: rxdconst.sfvtnon
msgid "None"
msgstr ""
#: rxdconst.sfvtrecno
msgid "Record no"
msgstr ""
#: rxdconst.sfvtstatictext
msgid "Static text"
msgstr ""
#: rxdconst.sfvtsum
msgid "Sum"
msgstr ""
#: rxdconst.shidezerovalues #: rxdconst.shidezerovalues
msgid "Hide zero values" msgid "Hide zero values"
msgstr "" msgstr ""
@ -409,6 +453,10 @@ msgstr "Вибір стовпців для відображення"
msgid "Sort data for collumns" msgid "Sort data for collumns"
msgstr "Сортувати дані по колонках" msgstr "Сортувати дані по колонках"
#: rxdconst.srxdbgridtoolscaption
msgid "Totals row"
msgstr ""
#: rxdconst.srxdescending #: rxdconst.srxdescending
msgid "Descending" msgid "Descending"
msgstr "За зменшенням" msgstr "За зменшенням"
@ -528,6 +576,10 @@ msgstr "Помилка сервера"
msgid "find" msgid "find"
msgstr "Пошук" msgstr "Пошук"
#: rxdconst.ssetuptotalrow
msgid "Setup total row"
msgstr ""
#: rxdconst.sshowcolumnheaderonallpage #: rxdconst.sshowcolumnheaderonallpage
msgid "Show column header on all page" msgid "Show column header on all page"
msgstr "" msgstr ""

View File

@ -42,7 +42,7 @@ procedure Register;
implementation implementation
uses DB, DBPropEdits, rxdbgrid, RxDBSpinEdit, RxDBTimeEdit, RxDBCtrls, rxmemds, uses DB, DBPropEdits, rxdbgrid, RxDBSpinEdit, RxDBTimeEdit, RxDBCtrls, rxmemds,
ComponentEditors, seldsfrm, PropEdits, RxDBColorBox, dbdateedit, rxdbcomb, ComponentEditors, seldsfrm, PropEdits, RxDBColorBox, dbdateedit, rxdbcomb,
rxlookup, dbcurredit; rxlookup, dbcurredit, RxDBGridFooterTools;
type type
@ -113,6 +113,11 @@ begin
RegisterComponents('RX DBAware',[TRxDBGrid]); RegisterComponents('RX DBAware',[TRxDBGrid]);
end; end;
procedure RegisterRxDbGridFooterTools;
begin
RegisterComponents('RX DBAware',[TRxDBGridFooterTools]);
end;
procedure RegisterRxMemDS; procedure RegisterRxMemDS;
begin begin
RegisterComponents('RX DBAware',[TRxMemoryData]); RegisterComponents('RX DBAware',[TRxMemoryData]);
@ -151,6 +156,7 @@ begin
RegisterUnit('rxdbgrid', @RegisterRxDbGrid); RegisterUnit('rxdbgrid', @RegisterRxDbGrid);
RegisterUnit('rxmemds', @RegisterRxMemDS); RegisterUnit('rxmemds', @RegisterRxMemDS);
RegisterUnit('RxDBColorBox', @RegisterRxDBColorBox); RegisterUnit('RxDBColorBox', @RegisterRxDBColorBox);
RegisterUnit('RxDBGridFooterTools', @RegisterRxDbGridFooterTools);
//Component Editors //Component Editors
RegisterComponentEditor(TRxMemoryData, TMemDataSetEditor); RegisterComponentEditor(TRxMemoryData, TMemDataSetEditor);

View File

@ -474,10 +474,14 @@ type
{ TRxDbGridColumns } { TRxDbGridColumns }
TRxDbGridColumns = class(TDbGridColumns) TRxDbGridColumns = class(TDbGridColumns)
private
function GetColumn(Index: Integer): TRxColumn;
procedure SetColumn(Index: Integer; AValue: TRxColumn);
protected protected
procedure Notify(Item: TCollectionItem;Action: TCollectionNotification); override; procedure Notify(Item: TCollectionItem;Action: TCollectionNotification); override;
public public
function Add: TRxColumn; function Add: TRxColumn;
property Items[Index: Integer]: TRxColumn read GetColumn write SetColumn; default;
end; end;
{ TRxDbGridColumnsSortList } { TRxDbGridColumnsSortList }
@ -569,6 +573,7 @@ type
FBeforeQuickSearch: TRxQuickSearchNotifyEvent; FBeforeQuickSearch: TRxQuickSearchNotifyEvent;
FQuickUTF8Search: string; FQuickUTF8Search: string;
FOldDataSetState:TDataSetState; FOldDataSetState:TDataSetState;
FToolsList:TFPList;
FOnSortChanged: TNotifyEvent; FOnSortChanged: TNotifyEvent;
@ -886,6 +891,8 @@ type
end; end;
{ TRxDBGridAbstractTools } { TRxDBGridAbstractTools }
TRxDBGridToolsEvent = (rxteMouseDown, rxteMouseUp, rxteMouseMove, rxteKeyDown, rxteKeyUp);
TRxDBGridToolsEvents = set of TRxDBGridToolsEvent;
TRxDBGridAbstractTools = class(TComponent) TRxDBGridAbstractTools = class(TComponent)
private private
@ -896,11 +903,14 @@ type
protected protected
FRxDBGrid: TRxDBGrid; FRxDBGrid: TRxDBGrid;
FCaption:string; FCaption:string;
FToolsEvents:TRxDBGridToolsEvents;
procedure SetRxDBGrid(AValue: TRxDBGrid); procedure SetRxDBGrid(AValue: TRxDBGrid);
function DoExecTools:boolean; virtual; function DoExecTools:boolean; virtual;
function DoSetupTools:boolean; virtual; function DoSetupTools:boolean; virtual;
function MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: integer):boolean; virtual;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function Execute:boolean; function Execute:boolean;
published published
property RxDBGrid:TRxDBGrid read FRxDBGrid write SetRxDBGrid; property RxDBGrid:TRxDBGrid read FRxDBGrid write SetRxDBGrid;
@ -1029,6 +1039,12 @@ begin
Result:=true; Result:=true;
end; end;
function TRxDBGridAbstractTools.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: integer): boolean;
begin
Result:=false;
end;
procedure TRxDBGridAbstractTools.ExecTools(Sender: TObject); procedure TRxDBGridAbstractTools.ExecTools(Sender: TObject);
begin begin
Execute; Execute;
@ -1037,10 +1053,17 @@ end;
constructor TRxDBGridAbstractTools.Create(AOwner: TComponent); constructor TRxDBGridAbstractTools.Create(AOwner: TComponent);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
FToolsEvents:=[];
FCaption:=Name; FCaption:=Name;
FShowSetupForm:=false; FShowSetupForm:=false;
end; end;
destructor TRxDBGridAbstractTools.Destroy;
begin
SetRxDBGrid(nil);
inherited Destroy;
end;
function TRxDBGridAbstractTools.Execute: boolean; function TRxDBGridAbstractTools.Execute: boolean;
begin begin
Result:=true; Result:=true;
@ -1345,6 +1368,8 @@ begin
else else
FOwner.FOptionsRx:=FOwner.FOptionsRx - [rdgFooterRows]; FOwner.FOptionsRx:=FOwner.FOptionsRx - [rdgFooterRows];
if FActive then
FOwner.CalcStatTotals;
FOwner.VisualChange; FOwner.VisualChange;
end; end;
@ -2900,6 +2925,9 @@ begin
R.Caption := ATools.FCaption; R.Caption := ATools.FCaption;
R.OnClick := @(ATools.ExecTools); R.OnClick := @(ATools.ExecTools);
R.Tag:=IntPtr(ATools); R.Tag:=IntPtr(ATools);
if Assigned(FToolsList) and (FToolsList.IndexOf(ATools)<0) then
FToolsList.Add(ATools);
end; end;
procedure TRxDBGrid.RemoveTools(ATools: TRxDBGridAbstractTools); procedure TRxDBGrid.RemoveTools(ATools: TRxDBGridAbstractTools);
@ -2915,6 +2943,9 @@ begin
R.Free; R.Free;
exit; exit;
end; end;
if Assigned(FToolsList) then
FToolsList.Remove(ATools);
end; end;
{ {
@ -3606,6 +3637,7 @@ var
Cell: TGridCoord; Cell: TGridCoord;
Rect: TRect; Rect: TRect;
C:TRxColumn; C:TRxColumn;
i: Integer;
begin begin
QuickUTF8Search := ''; QuickUTF8Search := '';
@ -3690,13 +3722,22 @@ begin
end; end;
end end
else else
begin
inherited MouseDown(Button, Shift, X, Y); inherited MouseDown(Button, Shift, X, Y);
end;
end end
else else
begin
inherited MouseDown(Button, Shift, X, Y); inherited MouseDown(Button, Shift, X, Y);
end;
end end
else else
begin begin
for i:=0 to FToolsList.Count-1 do
if (rxteMouseDown in TRxDBGridAbstractTools(FToolsList[i]).FToolsEvents) then
if TRxDBGridAbstractTools(FToolsList[i]).MouseDown(Button, Shift, X, Y) then
exit;
if rdgMrOkOnDblClik in FOptionsRx then if rdgMrOkOnDblClik in FOptionsRx then
begin begin
if (Cell.Y > 0) and (Cell.X >= Ord(dgIndicator in Options)) and if (Cell.Y > 0) and (Cell.X >= Ord(dgIndicator in Options)) and
@ -5001,6 +5042,7 @@ begin
{$IFDEF RXDBGRID_OPTIONS_WO_CANCEL_ON_EXIT} {$IFDEF RXDBGRID_OPTIONS_WO_CANCEL_ON_EXIT}
Options := Options - [dgCancelOnExit]; Options := Options - [dgCancelOnExit];
{$ENDIF} {$ENDIF}
FToolsList:=TFPList.Create;
FSortColumns:=TRxDbGridColumnsSortList.Create; FSortColumns:=TRxDbGridColumnsSortList.Create;
@ -5074,6 +5116,7 @@ begin
FreeAndNil(F_LastFilter); FreeAndNil(F_LastFilter);
FreeAndNil(FKeyStrokes); FreeAndNil(FKeyStrokes);
FreeAndNil(FToolsList);
inherited Destroy; inherited Destroy;
FreeAndNil(FSortColumns); FreeAndNil(FSortColumns);
end; end;
@ -5150,6 +5193,16 @@ begin
// The correct implementation is doing nothing // The correct implementation is doing nothing
end; end;
function TRxDbGridColumns.GetColumn(Index: Integer): TRxColumn;
begin
Result:=TRxColumn( inherited Items[Index] );
end;
procedure TRxDbGridColumns.SetColumn(Index: Integer; AValue: TRxColumn);
begin
Items[Index].Assign( AValue );
end;
procedure TRxDbGridColumns.Notify(Item: TCollectionItem; procedure TRxDbGridColumns.Notify(Item: TCollectionItem;
Action: TCollectionNotification); Action: TCollectionNotification);
begin begin

View File

@ -0,0 +1,147 @@
{ RxDBGridPrintGrid unit
Copyright (C) 2005-2015 Lagunov Aleksey alexs@yandex.ru and Lazarus team
original conception from rx library for Delphi (c)
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version with the following modification:
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent modules,and
to copy and distribute the resulting executable under terms of your choice,
provided that you also meet, for each linked independent module, the terms
and conditions of the license of that module. An independent module is a
module which is not derived from or based on this library. If you modify
this library, you may extend this exception to your version of the library,
but you are not obligated to do so. If you do not wish to do so, delete this
exception statement from your version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
for more details.
You should have received a copy of the GNU Library General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
}
unit RxDBGridFooterTools;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, rxdbgrid, Graphics, Grids, Controls;
type
{ TRxDBGridFooterTools }
TRxDBGridFooterTools = class(TRxDBGridAbstractTools)
private
FFooterColor: TColor;
FFooterRowCount: integer;
procedure SetFooterColor(AValue: TColor);
procedure SetFooterRowCount(AValue: integer);
protected
function DoExecTools:boolean;override;
function DoSetupTools:boolean; override;
function MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: integer):boolean; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property FooterRowCount:integer read FFooterRowCount write SetFooterRowCount default 1;
property FooterColor:TColor read FFooterColor write SetFooterColor default clYellow;
end;
implementation
uses Forms, Dialogs, rxdbgridfootertools_setup, rxdconst;
{ TRxDBGridFooterTools }
procedure TRxDBGridFooterTools.SetFooterRowCount(AValue: integer);
begin
if FFooterRowCount=AValue then Exit;
FFooterRowCount:=AValue;
end;
procedure TRxDBGridFooterTools.SetFooterColor(AValue: TColor);
begin
if FFooterColor=AValue then Exit;
FFooterColor:=AValue;
end;
function TRxDBGridFooterTools.DoExecTools: boolean;
begin
Result:=false;
if (RxDBGrid = nil) or (RxDBGrid.DataSource = nil) or (RxDBGrid.DataSource.Dataset = nil) then
Exit;
if RxDBGrid.FooterOptions.Active then
RxDBGrid.FooterOptions.Active:=false
else
begin
if RxDBGrid.FooterOptions.RowCount = 0 then
RxDBGrid.FooterOptions.RowCount:=FFooterRowCount;
if RxDBGrid.FooterOptions.Color = clNone then
RxDBGrid.FooterOptions.Color:=FFooterColor;
RxDBGrid.FooterOptions.Active:=true
end;
end;
function TRxDBGridFooterTools.DoSetupTools: boolean;
begin
RxDBGridFooterTools_SetupForm:=TRxDBGridFooterTools_SetupForm.Create(Application);
RxDBGridFooterTools_SetupForm.InitData(RxDBGrid);
Result:=RxDBGridFooterTools_SetupForm.ShowModal = mrOk;
if Result then
begin
RxDBGridFooterTools_SetupForm.SetData;
RxDBGrid.CalcStatTotals;
end;
RxDBGridFooterTools_SetupForm.Free;
end;
type
THackRxDBGrid = class(TRxDBGrid);
function TRxDBGridFooterTools.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: integer): boolean;
var
Cell: TGridCoord;
begin
if (Y > THackRxDBGrid(RxDBGrid).GCache.ClientHeight - (RxDBGrid.DefaultRowHeight * RxDBGrid.FooterOptions.RowCount)) then
begin
Result:=true;
Cell := RxDBGrid.MouseCoord(X, Y);
if (ssDouble in Shift) then
DoSetupTools;
end
else
Result:=false;
end;
constructor TRxDBGridFooterTools.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FCaption:=sRxDBGridToolsCaption;
FToolsEvents:=[rxteMouseDown];
ShowSetupForm:=false;
FFooterColor:=clYellow;
FFooterRowCount:=1;
end;
destructor TRxDBGridFooterTools.Destroy;
begin
inherited Destroy;
end;
end.

View File

@ -0,0 +1,68 @@
object RxDBGridFooterTools_SetupForm: TRxDBGridFooterTools_SetupForm
Left = 789
Height = 254
Top = 366
Width = 333
Caption = 'Setup footer row'
ClientHeight = 254
ClientWidth = 333
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '1.5'
object StringGrid1: TStringGrid
Left = 0
Height = 200
Top = 0
Width = 333
Align = alClient
AutoFillColumns = True
ColCount = 2
Columns = <
item
ReadOnly = True
Title.Alignment = taCenter
Title.Caption = 'Collumn name'
Width = 165
end
item
PickList.Strings = (
'fvtNon'
'fvtSum'
'fvtAvg'
'fvtCount'
'fvtFieldValue'
'fvtStaticText'
'fvtMax'
'fvtMin'
'fvtRecNo'
)
Title.Alignment = taCenter
Title.Caption = 'Function'
Width = 166
end>
FixedCols = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll]
TabOrder = 0
TitleStyle = tsNative
ColWidths = (
165
166
)
end
object ButtonPanel1: TButtonPanel
Left = 6
Height = 42
Top = 206
Width = 321
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 1
ShowButtons = [pbOK, pbCancel, pbHelp]
end
end

View File

@ -0,0 +1,137 @@
{ RxDBGridPrintGrid unit
Copyright (C) 2005-2014 Lagunov Aleksey alexs@yandex.ru and Lazarus team
original conception from rx library for Delphi (c)
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version with the following modification:
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent modules,and
to copy and distribute the resulting executable under terms of your choice,
provided that you also meet, for each linked independent module, the terms
and conditions of the license of that module. An independent module is a
module which is not derived from or based on this library. If you modify
this library, you may extend this exception to your version of the library,
but you are not obligated to do so. If you do not wish to do so, delete this
exception statement from your version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
for more details.
You should have received a copy of the GNU Library General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
}
unit rxdbgridfootertools_setup;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Grids,
ButtonPanel, rxdbgrid, rxdconst;
type
{ TRxDBGridFooterTools_SetupForm }
TRxDBGridFooterTools_SetupForm = class(TForm)
ButtonPanel1: TButtonPanel;
StringGrid1: TStringGrid;
procedure FormCreate(Sender: TObject);
private
FRxDBGrid:TRxDBGrid;
public
procedure InitData(ARxDBGrid:TRxDBGrid);
procedure SetData;
end;
var
RxDBGridFooterTools_SetupForm: TRxDBGridFooterTools_SetupForm;
const
rxFooterFunctionNames : array [TFooterValueType] of string =
(sfvtNon, sfvtSum, sfvtAvg, sfvtCount, sfvtFieldValue, sfvtStaticText, sfvtMax, sfvtMin, sfvtRecNo);
implementation
uses dbutils;
{$R *.lfm}
{ TRxDBGridFooterTools_SetupForm }
procedure TRxDBGridFooterTools_SetupForm.FormCreate(Sender: TObject);
begin
Caption:=sSetupTotalRow;
StringGrid1.Columns[0].Title.Caption:=sCollumnName;
StringGrid1.Columns[1].Title.Caption:=sFunction;
end;
procedure TRxDBGridFooterTools_SetupForm.InitData(ARxDBGrid: TRxDBGrid);
var
i: Integer;
c: TFooterValueType;
begin
FRxDBGrid:=ARxDBGrid;
if not Assigned(FRxDBGrid) then exit;
StringGrid1.TitleStyle:=FRxDBGrid.TitleStyle;
StringGrid1.Columns[1].PickList.Clear;
for c:=Low(TFooterValueType) to High(TFooterValueType) do
StringGrid1.Columns[1].PickList.Add(rxFooterFunctionNames[c]);
StringGrid1.RowCount:=FRxDBGrid.Columns.Count+1;
for i:=0 to FRxDBGrid.Columns.Count-1 do
begin
StringGrid1.Cells[0, i+1]:=FRxDBGrid.Columns[i].Title.Caption;
if FRxDBGrid.Columns[i].Footer.ValueType <> fvtNon then
StringGrid1.Cells[1, i+1]:=rxFooterFunctionNames[FRxDBGrid.Columns[i].Footer.ValueType];
end;
end;
procedure TRxDBGridFooterTools_SetupForm.SetData;
var
B,C: TFooterValueType;
Col: TRxColumn;
i: Integer;
begin
for i:=1 to StringGrid1.RowCount-1 do
begin
Col:=FRxDBGrid.ColumnByCaption(StringGrid1.Cells[0, i]);
B:=fvtNon;
for c:=Low(TFooterValueType) to High(TFooterValueType) do
if StringGrid1.Cells[1, i] = rxFooterFunctionNames[c] then
begin
B:=C;
break;
end;
if B<>fvtNon then
begin
if not (Col.Field.DataType in NumericDataTypes) then
if not (B in [fvtCount, fvtFieldValue, fvtStaticText, fvtRecNo]) then
B:=fvtNon;
if B<>fvtNon then
begin
Col.Footer.FieldName:=Col.FieldName;
Col.Footer.Alignment:=Col.Alignment;
Col.Footer.DisplayFormat:=Col.DisplayFormat;
end;
end;
Col.Footer.ValueType:=B;
end;
end;
end.

View File

@ -200,6 +200,19 @@ resourcestring
sPrintGrid = 'Print grid'; sPrintGrid = 'Print grid';
sHideZeroValues = 'Hide zero values'; sHideZeroValues = 'Hide zero values';
sRxDBGridToolsCaption = 'Totals row';
sfvtNon = 'None';
sfvtSum = 'Sum';
sfvtAvg = 'AVG';
sfvtCount = 'Count';
sfvtFieldValue = 'Field value';
sfvtStaticText = 'Static text';
sfvtMax = 'Max value';
sfvtMin = 'Min value';
sfvtRecNo = 'Record no';
sSetupTotalRow = 'Setup total row';
sCollumnName = 'Collumn name';
sFunction = 'Function';

View File

@ -25,7 +25,7 @@ translate to Lazarus by alexs in 2005 - 2015
"/> "/>
<License Value="LGPL"/> <License Value="LGPL"/>
<Version Major="2" Minor="7" Release="2" Build="159"/> <Version Major="2" Minor="7" Release="2" Build="159"/>
<Files Count="69"> <Files Count="72">
<Item1> <Item1>
<Filename Value="autopanel.pas"/> <Filename Value="autopanel.pas"/>
<UnitName Value="AutoPanel"/> <UnitName Value="AutoPanel"/>
@ -305,6 +305,18 @@ translate to Lazarus by alexs in 2005 - 2015
<Filename Value="rxdaterangeeditunit.pas"/> <Filename Value="rxdaterangeeditunit.pas"/>
<UnitName Value="rxDateRangeEditUnit"/> <UnitName Value="rxDateRangeEditUnit"/>
</Item69> </Item69>
<Item70>
<Filename Value="rxdbgridfootertools.pas"/>
<UnitName Value="RxDBGridFooterTools"/>
</Item70>
<Item71>
<Filename Value="rxdbgridfootertools_setup.lfm"/>
<Type Value="LFM"/>
</Item71>
<Item72>
<Filename Value="rxdbgridfootertools_setup.pas"/>
<UnitName Value="rxdbgridfootertools_setup"/>
</Item72>
</Files> </Files>
<LazDoc Paths="docs;\usr\local\share\lazarus\components\rxnew\docs"/> <LazDoc Paths="docs;\usr\local\share\lazarus\components\rxnew\docs"/>
<i18n> <i18n>

View File

@ -18,7 +18,8 @@ uses
RxTimeEdit, rxtoolbar, RxVersInfo, RxViewsPanel, rxxpman, seldsfrm, RxTimeEdit, rxtoolbar, RxVersInfo, RxViewsPanel, rxxpman, seldsfrm,
tooledit, vclutils, RxCloseFormValidator, RxHistoryNavigator, tooledit, vclutils, RxCloseFormValidator, RxHistoryNavigator,
ex_rx_bin_datapacket, ex_rx_datapacket, ex_rx_xml_datapacket, rxsortby, ex_rx_bin_datapacket, ex_rx_datapacket, ex_rx_xml_datapacket, rxsortby,
RxMDI, RxIniPropStorage, rxDateRangeEditUnit, LazarusPackageIntf; RxMDI, RxIniPropStorage, rxDateRangeEditUnit, RxDBGridFooterTools,
rxdbgridfootertools_setup, LazarusPackageIntf;
implementation implementation