RxFPC:Fix RxToolbar setup dialog. In RxDBGridExportSpreadSheet for footer row SUM value exported as numeric

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4586 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2016-03-24 07:58:23 +00:00
parent 5598f9414b
commit ba01d58f3f
12 changed files with 112 additions and 71 deletions

View File

@ -7,12 +7,16 @@ uses
cthreads, cthreads,
{$ENDIF}{$ENDIF} {$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset Interfaces, // this includes the LCL widgetset
Forms, Unit1, rxnew Forms,
sysutils,
Unit1,
rxnew
{ you can add units after this }; { you can add units after this };
{$R *.res} {$R *.res}
begin begin
DefaultFormatSettings.ThousandSeparator:=' ';
RequireDerivedFormResource := True; RequireDerivedFormResource := True;
Application.Initialize; Application.Initialize;
Application.CreateForm(TForm1, Form1); Application.CreateForm(TForm1, Form1);

View File

@ -3,15 +3,14 @@
<ProjectSession> <ProjectSession>
<Version Value="9"/> <Version Value="9"/>
<BuildModes Active="Default"/> <BuildModes Active="Default"/>
<Units Count="5"> <Units Count="6">
<Unit0> <Unit0>
<Filename Value="project1.lpr"/> <Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/> <EditorIndex Value="1"/>
<WindowIndex Value="-1"/> <CursorPos Y="20"/>
<TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/>
<UsageCount Value="21"/> <UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
<Filename Value="unit1.pas"/> <Filename Value="unit1.pas"/>
@ -20,9 +19,8 @@
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/> <UnitName Value="Unit1"/>
<IsVisibleTab Value="True"/> <TopLine Value="3"/>
<TopLine Value="10"/> <CursorPos X="5" Y="22"/>
<CursorPos X="46" Y="23"/>
<UsageCount Value="21"/> <UsageCount Value="21"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/> <LoadedDesigner Value="True"/>
@ -45,14 +43,23 @@
<Unit4> <Unit4>
<Filename Value="../../rxdbgridexportspreadsheet.pas"/> <Filename Value="../../rxdbgridexportspreadsheet.pas"/>
<UnitName Value="RxDBGridExportSpreadSheet"/> <UnitName Value="RxDBGridExportSpreadSheet"/>
<EditorIndex Value="1"/> <IsVisibleTab Value="True"/>
<TopLine Value="35"/> <EditorIndex Value="2"/>
<CursorPos X="34" Y="54"/> <TopLine Value="317"/>
<CursorPos X="13" Y="334"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit4> </Unit4>
<Unit5>
<Filename Value="../../rxdbgrid.pas"/>
<EditorIndex Value="3"/>
<TopLine Value="290"/>
<CursorPos X="14" Y="307"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit5>
</Units> </Units>
<JumpHistory Count="22" HistoryIndex="21"> <JumpHistory Count="30" HistoryIndex="28">
<Position1> <Position1>
<Filename Value="unit1.pas"/> <Filename Value="unit1.pas"/>
</Position1> </Position1>
@ -140,6 +147,38 @@
<Filename Value="unit1.pas"/> <Filename Value="unit1.pas"/>
<Caret Line="23" Column="46" TopLine="10"/> <Caret Line="23" Column="46" TopLine="10"/>
</Position22> </Position22>
<Position23>
<Filename Value="unit1.pas"/>
<Caret Line="25" Column="27" TopLine="10"/>
</Position23>
<Position24>
<Filename Value="unit1.pas"/>
<Caret Line="53" Column="99" TopLine="41"/>
</Position24>
<Position25>
<Filename Value="unit1.pas"/>
<Caret Line="52" Column="9" TopLine="40"/>
</Position25>
<Position26>
<Filename Value="../../rxdbgrid.pas"/>
<Caret Line="1552" Column="3" TopLine="1550"/>
</Position26>
<Position27>
<Filename Value="unit1.pas"/>
<Caret Line="52" Column="9" TopLine="40"/>
</Position27>
<Position28>
<Filename Value="unit1.pas"/>
<Caret Line="22" Column="5" TopLine="3"/>
</Position28>
<Position29>
<Filename Value="../../rxdbgridexportspreadsheet.pas"/>
<Caret Line="335" Column="70" TopLine="317"/>
</Position29>
<Position30>
<Filename Value="../../rxdbgridexportspreadsheet.pas"/>
<Caret Line="265" Column="71" TopLine="232"/>
</Position30>
</JumpHistory> </JumpHistory>
</ProjectSession> </ProjectSession>
</CONFIG> </CONFIG>

View File

@ -7,20 +7,21 @@ object Form1: TForm1
ClientHeight = 527 ClientHeight = 527
ClientWidth = 746 ClientWidth = 746
OnCreate = FormCreate OnCreate = FormCreate
LCLVersion = '1.3' LCLVersion = '1.7'
object RxDBGrid1: TRxDBGrid object RxDBGrid1: TRxDBGrid
Left = 0 Left = 0
Height = 457 Height = 457
Top = 70 Top = 70
Width = 746 Width = 746
ColumnDefValues.BlobText = '(blob)'
TitleButtons = False TitleButtons = False
AutoSort = True AutoSort = True
Columns = < Columns = <
item item
Color = clMoneyGreen Color = clMoneyGreen
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'CODE'
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
Title.Caption = 'CODE'
Width = 90 Width = 90
FieldName = 'CODE' FieldName = 'CODE'
EditButtons = <> EditButtons = <>
@ -28,12 +29,13 @@ object Form1: TForm1
Filter.EmptyValue = '(Нет)' Filter.EmptyValue = '(Нет)'
Filter.EmptyFont.Style = [fsItalic] Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1 Filter.ItemIndex = -1
Footers = <>
end end
item item
Color = clAqua Color = clAqua
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'NAME'
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
Title.Caption = 'NAME'
Width = 350 Width = 350
FieldName = 'NAME' FieldName = 'NAME'
EditButtons = <> EditButtons = <>
@ -41,11 +43,12 @@ object Form1: TForm1
Filter.EmptyValue = '(Нет)' Filter.EmptyValue = '(Нет)'
Filter.EmptyFont.Style = [fsItalic] Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1 Filter.ItemIndex = -1
Footers = <>
end end
item item
Title.Alignment = taCenter Title.Alignment = taCenter
Title.Caption = 'PRICE'
Title.Orientation = toHorizontal Title.Orientation = toHorizontal
Title.Caption = 'PRICE'
Width = 120 Width = 120
FieldName = 'PRICE' FieldName = 'PRICE'
EditButtons = <> EditButtons = <>
@ -53,6 +56,10 @@ object Form1: TForm1
Filter.EmptyValue = '(Нет)' Filter.EmptyValue = '(Нет)'
Filter.EmptyFont.Style = [fsItalic] Filter.EmptyFont.Style = [fsItalic]
Filter.ItemIndex = -1 Filter.ItemIndex = -1
Footer.Alignment = taRightJustify
Footer.FieldName = 'PRICE'
Footer.ValueType = fvtSum
Footers = <>
end> end>
KeyStrokes = < KeyStrokes = <
item item
@ -110,7 +117,12 @@ object Form1: TForm1
ShortCut = 16451 ShortCut = 16451
Enabled = True Enabled = True
end> end>
OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgAllowToolMenu] FooterOptions.Active = True
FooterOptions.Color = clYellow
FooterOptions.RowCount = 1
OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgFooterRows, rdgAllowToolMenu]
FooterColor = clYellow
FooterRowCount = 1
Align = alClient Align = alClient
Color = clWindow Color = clWindow
DrawFullLine = False DrawFullLine = False
@ -137,35 +149,20 @@ object Form1: TForm1
AnchorSideLeft.Control = Panel1 AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = Panel1 AnchorSideTop.Control = Panel1
Left = 7 Left = 7
Height = 19 Height = 20
Top = 7 Top = 7
Width = 131 Width = 146
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'SpeadSheet file name ' Caption = 'SpeadSheet file name '
ParentColor = False ParentColor = False
end end
object CheckBox1: TCheckBox
AnchorSideTop.Control = Panel1
AnchorSideRight.Control = Panel1
AnchorSideRight.Side = asrBottom
Left = 606
Height = 23
Top = 7
Width = 133
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
Caption = 'Open after export'
Checked = True
State = cbChecked
TabOrder = 0
end
object FileNameEdit1: TFileNameEdit object FileNameEdit1: TFileNameEdit
AnchorSideLeft.Control = Label1 AnchorSideLeft.Control = Label1
AnchorSideTop.Control = Label1 AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 13 Left = 13
Height = 31 Height = 30
Top = 32 Top = 33
Width = 275 Width = 275
FilterIndex = 0 FilterIndex = 0
HideDirectories = False HideDirectories = False
@ -173,7 +170,7 @@ object Form1: TForm1
NumGlyphs = 1 NumGlyphs = 1
BorderSpacing.Around = 6 BorderSpacing.Around = 6
MaxLength = 0 MaxLength = 0
TabOrder = 1 TabOrder = 0
end end
object Button1: TButton object Button1: TButton
AnchorSideLeft.Control = FileNameEdit1 AnchorSideLeft.Control = FileNameEdit1
@ -182,11 +179,11 @@ object Form1: TForm1
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 294 Left = 294
Height = 33 Height = 33
Top = 31 Top = 32
Width = 87 Width = 87
Caption = 'Export data' Caption = 'Export data'
OnClick = Button1Click OnClick = Button1Click
TabOrder = 2 TabOrder = 1
end end
end end
object RxMemoryData1: TRxMemoryData object RxMemoryData1: TRxMemoryData
@ -194,20 +191,15 @@ object Form1: TForm1
item item
Name = 'CODE' Name = 'CODE'
DataType = ftInteger DataType = ftInteger
Precision = 0
Size = 0
end end
item item
Name = 'NAME' Name = 'NAME'
DataType = ftString DataType = ftString
Precision = 0
Size = 300 Size = 300
end end
item item
Name = 'PRICE' Name = 'PRICE'
DataType = ftCurrency DataType = ftCurrency
Precision = 0
Size = 0
end> end>
PacketRecords = 0 PacketRecords = 0
left = 368 left = 368
@ -259,6 +251,7 @@ object Form1: TForm1
OnBeforeExecute = RxDBGridExportSpreadSheet1BeforeExecute OnBeforeExecute = RxDBGridExportSpreadSheet1BeforeExecute
PageName = 'Test page' PageName = 'Test page'
Options = [ressExportTitle, ressExportColors, ressExportFooter, ressOverwriteExisting] Options = [ressExportTitle, ressExportColors, ressExportFooter, ressOverwriteExisting]
OpenAfterExport = True
left = 336 left = 336
top = 256 top = 256
end end

View File

@ -14,7 +14,6 @@ type
TForm1 = class(TForm) TForm1 = class(TForm)
Button1: TButton; Button1: TButton;
CheckBox1: TCheckBox;
DataSource1: TDataSource; DataSource1: TDataSource;
FileNameEdit1: TFileNameEdit; FileNameEdit1: TFileNameEdit;
Label1: TLabel; Label1: TLabel;

View File

@ -110,6 +110,7 @@ object MainForm: TMainForm
Action = actCustom Action = actCustom
AutoSize = True AutoSize = True
Margin = 3 Margin = 3
Visible = False
end end
object BitBtn1: TBitBtn object BitBtn1: TBitBtn
Left = 440 Left = 440
@ -165,6 +166,7 @@ object MainForm: TMainForm
} }
OnClick = BitBtn1Click OnClick = BitBtn1Click
TabOrder = 1 TabOrder = 1
Visible = False
end end
object ImageList1: TImageList object ImageList1: TImageList
left = 168 left = 168

View File

@ -73,7 +73,7 @@ end;
procedure TMainForm.actCustomExecute(Sender: TObject); procedure TMainForm.actCustomExecute(Sender: TObject);
begin begin
ToolPanel1.Customize(0); ToolPanel1.:=; ToolPanel1.Customize(0);
end; end;

View File

@ -102,8 +102,8 @@ msgstr "Експортувати заголовки стовпців"
msgid "Export file name" msgid "Export file name"
msgstr "Експортувати назву файлу" msgstr "Експортувати назву файлу"
#: rxdconst.sexprbadcompare
# msgid "Compare opertion need fielad and const" # msgid "Compare opertion need fielad and const"
#: rxdconst.sexprbadcompare
msgid "Compare opertion needs field and const" msgid "Compare opertion needs field and const"
msgstr "Операції порівняння вимагають наявності поля і константи" msgstr "Операції порівняння вимагають наявності поля і константи"
@ -448,8 +448,8 @@ msgstr "Перемістити вибране поле нижче"
msgid "Select all rows" msgid "Select all rows"
msgstr "Виділити всі рядки" msgstr "Виділити всі рядки"
#: rxdconst.srxdbgridselectcolumns
# msgid "Select visible collumns" # msgid "Select visible collumns"
#: rxdconst.srxdbgridselectcolumns
msgid "Select visible columns" msgid "Select visible columns"
msgstr "Вибір стовпців для відображення" msgstr "Вибір стовпців для відображення"
@ -478,6 +478,7 @@ msgid "Fill fields in SortField property"
msgstr "" msgstr ""
#: rxdconst.srxfilterformapply #: rxdconst.srxfilterformapply
msgctxt "rxdconst.srxfilterformapply"
msgid "Apply" msgid "Apply"
msgstr "Застосувати" msgstr "Застосувати"

View File

@ -329,7 +329,13 @@ begin
if (C.Footer.ValueType <> fvtNon) then if (C.Footer.ValueType <> fvtNon) then
begin begin
FWorksheet.WriteUTF8Text(FCurRow, FCurCol, C.Footer.DisplayText); if C.Footer.ValueType = fvtSum then
begin
//if C.Footer.FieldName;
FWorksheet.WriteNumber(FCurRow, FCurCol, C.Footer.NumericValue, nfFixed, 2)
end
else
FWorksheet.WriteUTF8Text(FCurRow, FCurCol, C.Footer.DisplayText);
FWorksheet.WriteBorders(FCurRow,FCurCol, [cbNorth, cbWest, cbEast, cbSouth]); FWorksheet.WriteBorders(FCurRow,FCurCol, [cbNorth, cbWest, cbEast, cbSouth]);
FWorksheet.WriteBorderColor(FCurRow,FCurCol, cbNorth, scColorBlack); FWorksheet.WriteBorderColor(FCurRow,FCurCol, cbNorth, scColorBlack);

View File

@ -206,9 +206,9 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Control = cbTransp AnchorSideTop.Control = cbTransp
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 6 Left = 6
Height = 22 Height = 24
Top = 163 Top = 178
Width = 82 Width = 90
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Show hint' Caption = 'Show hint'
TabOrder = 0 TabOrder = 0
@ -218,9 +218,9 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Control = cbFlatBtn AnchorSideTop.Control = cbFlatBtn
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 6 Left = 6
Height = 22 Height = 24
Top = 135 Top = 148
Width = 94 Width = 101
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Transparent' Caption = 'Transparent'
TabOrder = 1 TabOrder = 1
@ -230,9 +230,9 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Control = RadioGroup1 AnchorSideTop.Control = RadioGroup1
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 6 Left = 6
Height = 22 Height = 24
Top = 107 Top = 118
Width = 93 Width = 104
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Flat buttons' Caption = 'Flat buttons'
TabOrder = 2 TabOrder = 2
@ -244,7 +244,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideRight.Control = TabSheet2 AnchorSideRight.Control = TabSheet2
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 333 Left = 333
Height = 95 Height = 106
Top = 6 Top = 6
Width = 312 Width = 312
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
@ -258,7 +258,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1 ChildSizing.ControlsPerLine = 1
ClientHeight = 73 ClientHeight = 84
ClientWidth = 308 ClientWidth = 308
Items.Strings = ( Items.Strings = (
'None' 'None'
@ -273,7 +273,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Control = TabSheet2 AnchorSideTop.Control = TabSheet2
AnchorSideRight.Control = Panel2 AnchorSideRight.Control = Panel2
Left = 6 Left = 6
Height = 95 Height = 106
Top = 6 Top = 6
Width = 312 Width = 312
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
@ -289,7 +289,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1 ChildSizing.ControlsPerLine = 1
ClientHeight = 73 ClientHeight = 84
ClientWidth = 308 ClientWidth = 308
Items.Strings = ( Items.Strings = (
'Standart' 'Standart'
@ -306,7 +306,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideBottom.Control = TabSheet2 AnchorSideBottom.Control = TabSheet2
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 324 Left = 324
Height = 388 Height = 383
Top = 6 Top = 6
Width = 3 Width = 3
Anchors = [akTop, akLeft, akBottom] Anchors = [akTop, akLeft, akBottom]

View File

@ -175,6 +175,7 @@ begin
cbShowCaption.Checked:=TToolbarItem(Items.Objects[ItemIndex]).ShowCaption; cbShowCaption.Checked:=TToolbarItem(Items.Objects[ItemIndex]).ShowCaption;
end; end;
end; end;
UpdateStates;
end; end;
procedure TToolPanelSetupForm.cbShowCaptionChange(Sender: TObject); procedure TToolPanelSetupForm.cbShowCaptionChange(Sender: TObject);
@ -233,11 +234,12 @@ begin
BitBtn6.Enabled:=ListBtnVisible.Items.Count>0; BitBtn6.Enabled:=ListBtnVisible.Items.Count>0;
BitBtn5.Enabled:=ListBtnVisible.Items.Count>0; BitBtn5.Enabled:=ListBtnVisible.Items.Count>0;
cbShowCaption.Enabled:=ListBtnVisible.Items.Count>0; cbShowCaption.Enabled:=(ListBtnVisible.Items.Count>0) and (ListBtnVisible.ItemIndex>=0);
BitBtn4.Enabled:=ListBtnAvaliable.Items.Count>0; BitBtn4.Enabled:=ListBtnAvaliable.Items.Count>0;
BitBtn3.Enabled:=ListBtnAvaliable.Items.Count>0; BitBtn3.Enabled:=ListBtnAvaliable.Items.Count>0;
cbFlatBtn.Checked:=tpTransparentBtns in FToolPanel.Options;
cbFlatBtn.Checked:=tpFlatBtns in FToolPanel.Options;
end; end;
procedure TToolPanelSetupForm.Localize; procedure TToolPanelSetupForm.Localize;

View File

@ -114,9 +114,7 @@ type
private private
FButton: TToolbarButton; FButton: TToolbarButton;
FSaveLeft:integer; FSaveLeft:integer;
// FActionLink:TActionLink;
function GetAction: TBasicAction; function GetAction: TBasicAction;
//function GetAutoSize: boolean;
function GetButtonStyle: TToolbarButtonStyle; function GetButtonStyle: TToolbarButtonStyle;
function GetDropDownMenu: TPopupMenu; function GetDropDownMenu: TPopupMenu;
function GetGroupIndex: Integer; function GetGroupIndex: Integer;
@ -128,9 +126,7 @@ type
function GetTop: Integer; function GetTop: Integer;
function GetVisible: boolean; function GetVisible: boolean;
function GetWidth: Integer; function GetWidth: Integer;
// procedure OnActionChanges(Sender: TObject);
procedure SetAction(const AValue: TBasicAction); procedure SetAction(const AValue: TBasicAction);
//procedure SetAutoSize(const AValue: boolean);
procedure SetButtonStyle(const AValue: TToolbarButtonStyle); procedure SetButtonStyle(const AValue: TToolbarButtonStyle);
procedure SetDropDownMenu(const AValue: TPopupMenu); procedure SetDropDownMenu(const AValue: TPopupMenu);
procedure SetGroupIndex(const AValue: Integer); procedure SetGroupIndex(const AValue: Integer);
@ -151,7 +147,6 @@ type
destructor Destroy; override; destructor Destroy; override;
published published
property Action:TBasicAction read GetAction write SetAction; property Action:TBasicAction read GetAction write SetAction;
//property AutoSize:boolean read GetAutoSize write SetAutoSize default true;
property Visible:boolean read GetVisible write SetVisible; property Visible:boolean read GetVisible write SetVisible;
property Left: Integer read GetLeft write SetLeft; property Left: Integer read GetLeft write SetLeft;
property Height: Integer read GetHeight write SetHeight; property Height: Integer read GetHeight write SetHeight;