fpspreadsheet: Less warnings. Prepare TsWorksheetGrid to avoid storing of colwidths and rowheights (requires Mantis #0027279 in Lazarus)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3879 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2015-01-09 22:25:20 +00:00
parent f1bdde968a
commit 988c2a3d7a
11 changed files with 201 additions and 92 deletions

View File

@ -81,7 +81,7 @@ object Form1: TForm1
Font.Color = clBlack Font.Color = clBlack
Font.Height = -15 Font.Height = -15
Font.Name = 'Calibri' Font.Name = 'Calibri'
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll] Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goThumbTracking]
ParentFont = False ParentFont = False
RowCount = 101 RowCount = 101
TabOrder = 1 TabOrder = 1

View File

@ -5,8 +5,8 @@ unit mainform;
interface interface
uses uses
Classes, SysUtils, FileUtil, TAGraph, TASeries, TASources, Forms, Controls, Classes, SysUtils, FileUtil, TAGraph, TASeries, Forms, Controls,
Graphics, Dialogs, ExtCtrls, EditBtn, StdCtrls, Graphics, Dialogs, ExtCtrls, StdCtrls,
fpspreadsheetctrls, fpspreadsheetgrid, fpspreadsheetchart; fpspreadsheetctrls, fpspreadsheetgrid, fpspreadsheetchart;
type type

View File

@ -40,10 +40,10 @@ object FPSChartForm: TFPSChartForm
end end
end end
object WorksheetGrid: TsWorksheetGrid object WorksheetGrid: TsWorksheetGrid
Left = 16 Left = 8
Height = 264 Height = 264
Top = 112 Top = 112
Width = 328 Width = 336
FrozenCols = 0 FrozenCols = 0
FrozenRows = 0 FrozenRows = 0
ReadFormulas = False ReadFormulas = False
@ -54,35 +54,6 @@ object FPSChartForm: TFPSChartForm
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goEditing, goThumbTracking] Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goEditing, goThumbTracking]
RowCount = 101 RowCount = 101
TabOrder = 1 TabOrder = 1
ColWidths = (
42
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
)
end end
object btnCreateGraphic: TButton object btnCreateGraphic: TButton
Left = 464 Left = 464
@ -97,7 +68,7 @@ object FPSChartForm: TFPSChartForm
Left = 14 Left = 14
Height = 42 Height = 42
Top = 4 Top = 4
Width = 676 Width = 678
AutoSize = False AutoSize = False
Caption = 'Please add data to the grid or load it from a file, then choose the location of the data for the X and Y axises and click on the button "Create Graphic" to generate a chart.' Caption = 'Please add data to the grid or load it from a file, then choose the location of the data for the X and Y axises and click on the button "Create Graphic" to generate a chart.'
ParentColor = False ParentColor = False

View File

@ -1,7 +1,7 @@
object Form1: TForm1 object Form1: TForm1
Left = 541 Left = 495
Height = 600 Height = 600
Top = 214 Top = 132
Width = 941 Width = 941
Caption = 'Form1' Caption = 'Form1'
ClientHeight = 580 ClientHeight = 580
@ -361,7 +361,7 @@ object Form1: TForm1
CellFormatItem = cfiFontName CellFormatItem = cfiFontName
WorkbookSource = WorkbookSource WorkbookSource = WorkbookSource
DropDownCount = 24 DropDownCount = 24
ItemIndex = 62 ItemIndex = 76
TabOrder = 0 TabOrder = 0
Text = 'Arial' Text = 'Arial'
end end
@ -3588,14 +3588,122 @@ object Form1: TForm1
Caption = 'Edit' Caption = 'Edit'
object MenuItem101: TMenuItem object MenuItem101: TMenuItem
Action = AcCopyToClipboard Action = AcCopyToClipboard
Bitmap.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C57342C1C67545E6C87545FEC775
45F3C87545F3C77545F3C77545F3C87546F4C57444E8CA7F53F1FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C77949EDFCF3ECFFFAF1E8FFFAF0
E7FFFBF1E9FFFBF2EAFFFBF2EAFFFBF2EBFFFDF4EEFFCA8054F9FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00CF8253FFEFF1E7FFFFE9D9FFFFEA
DBFFFFE9D9FFFFE7D7FFFFE5D2FFFFE2CBFFEFF2E8FFCE8156FFFFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00CC8352FBFBF5EEFFFFE9D9FFFFEA
DBFFFFE9D9FFFFE7D7FFFFE5D2FFFFE2CBFFFBF6EFFFCC8355FEC7794AB9C879
4BCEC87545DDC77545D4C87545D4C77545D4CA8452FFFFF7F1FFFFE9D9FFFFEA
DBFFFFE9D9FFFFE7D7FFFFE5D2FFFFE2CBFFFFF7F1FFCB8555FEC87C4ED3FCF3
ECDEFAF1E8DEFAF0E7DEFBF1E9DEFBF2EADEE4BA91FFFFF7F0FFFFE7D5FFFDE7
D6FFFDE6D4FFFCE4D0FFFBE3CBFFFADCC2FFFEF3E8FFCC8656FECF8253DEEFF1
E7DEFFE9D9DEFFEADBDEFFE9D9DEFFE7D7DEE4BB91FFFFF7F2FFFEE7D5FFFEE7
D5FFFDE5D1FFFAE0CAFFF9DEC4FFF7D9BCFFFDF2E7FFCC8757FECC8352DBFBF5
EEDEFFE9D9DEFFEADBDEFFE9D9DEFFE7D7DEE4BB92FFFEF7F1FFFCE5D2FFFCE4
D1FFFBE2CCFFF9DDC4FFF6D7BBFFF3D1AFFFFAEFE4FFCC8758FECA8452DBFFF7
F1DEFFE9D9DEFFEADBDEFFE9D9DEFFE7D7DEE4BB92FFFEF6F0FFFCE2CDFFFCE3
CDFFFADFC8FFF7D9BCFFF5E9DDFFFAF3EBFFFBF8F3FFCA8353FECB8553DBFFF7
F0DEFFE7D5DEFDE7D6DEFDE6D4DEFCE4D0DEE4BB93FFFEF5EDFFFCDEC5FFFBE0
C7FFF9DCC2FFF5D3B4FFFEF9F3FFFAE2C4FFECC193FFC37D4893CB8654DBFFF7
F2DEFEE7D5DEFEE7D5DEFDE5D1DEFAE0CADEE5BE96FFFFFFFEFFFDF3E9FFFDF3
EAFFFCF2E8FFFAEFE3FFFAF2E7FFEABB88FFCF8555B3B4693D0CCB8655DBFEF7
F1DEFCE5D2DEFCE4D1DEFBE2CCDEF9DDC4DEEAC39DFFE6BF96FFE4BB92FFE4BB
92FFD1A06CF5D09E6DF6CC965FDAC479427EB2673C09FFFFFF00CB8655DBFEF6
F0DEFCE2CDDEFCE3CDDEFADFC8DEF7D9BCDEF5E9DDDEFAF3EBDEFBF8F3DECD95
65DCFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00CB8656DAFEF5
EDDEFCDEC5DEFBE0C7DEF9DCC2DEF5D3B4DEFEF9F3DEFAE2C4DEECC193DEC37D
4880FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00CA8554D0FFFF
FFDBFDF3E9DEFDF3EADEFCF2E8DEFAEFE3DEFAF2E7DEEABB88DECF85559CB469
3D0AFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C77947AACC86
55CECC8857DECB8856DBCC8856DBCB8757DBCA8350D0C479426EB2673C08FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
end end
object MenuItem100: TMenuItem object MenuItem100: TMenuItem
Action = AcCutToClipboard Action = AcCutToClipboard
Bitmap.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF004A310C07A06131D7B676
3FF7A46534E04B320C14FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00674514186A481620FFFFFF00FFFFFF009F5E2FC6E7B263FFBF92
4FE5DDAB62FFA26232D8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF0077531E56C79751ECD8A65AFEA66C36CB51350A18A86835E1D1A057FA412A
091E8E6A369CB4753FFC4D330D10FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00B58244E7D6A45AE8AE8241C5ECB666FFA76E36D8AC6C37EBC49551F3FFFF
FF0076562776B77840FF5238121BFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00BE8A4AF2A87E41B6FFFFFF00966E3297E7B066FFCAA274FEE5B167FF945E
2DC1B88D4DD3AF703BF449300B08FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF009C6A32ACD6A55EFD704D1A3E6E4B184FE4AD60FFDCBD9BFFEFCDA5FFEFB7
67FFD8A65DFF66491D64FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF0066431218B17E42DBDCAA60FFD09E54F3EAB365FFD8BA99FFF8EBE1FFAE89
57BC57390D41FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF006644121A9D6932ABB17E42D29E682CA4BC9767CDF0E0D0FFB691
5FC581531104FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF005E3D0D02FFFFFF00B68F598BF5E9DDFFE2CD
B4FFB99461A0FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00B28A5489F1E2D3FFCFB3
8EF6F5E9DCFFA276376CFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00AF875084EDDECEFF9766
2063CEB38FCBE7D6C3FC9666203BFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00AD844C7BE6D4C0FF9665
1E248F5C121DD3B999DCD3B897E1915E1518FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00AB814774DEC8AEFF9564
1D1EFFFFFF0093601827D1B693E4BB9767B6FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00A97E436ED5BC9DF89261
190FFFFFFF00FFFFFF009867222DAE854CB5FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00A67B3E69CBAE87E4905D
1409FFFFFF00FFFFFF00FFFFFF0092601702FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00996A252AA77B3E9E9261
1905FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
end end
object MenuItem99: TMenuItem object MenuItem99: TMenuItem
Caption = 'Paste' Caption = 'Paste'
object MenuItem102: TMenuItem object MenuItem102: TMenuItem
Action = AcPasteAllFromClipboard Action = AcPasteAllFromClipboard
Bitmap.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C57342C1C67545E6C87545FEC775
45F3C87545F3C77545F3C77545F3C87546F4C57444E8CA7F53F12063984A2063
98CF206398FF206398FF206398FF206398FFC98F67FFFCF3ECFFFAF1E8FFFAF0
E7FFFBF1E9FFFBF2EAFFFBF2EAFFFBF2EBFFFDF4EEFFCA8054F9206398C274AD
D8FF7BB2DDFF78AEDCFF75AADAFF74A9DAFFDAA97DFFEFF1E7FFFFE9D9FFFFEA
DBFFFFE9D9FFFFE7D7FFFFE5D2FFFFE2CBFFEFF2E8FFCE8156FF206398FF80B9
E1FF5395D1FF5092D0FF4E8ECEFF4D8CCDFFD6A97DFFFBF5EEFFFFE9D9FFFFEA
DBFFFFE9D9FFFFE7D7FFFFE5D2FFFFE2CBFFFBF6EFFFCC8355FE206398FF84BF
E2FF569AD3FF5397D1FF5092CFFF5091CFFFD6A97DFFFFF7F1FFFFE9D9FFFFEA
DBFFFFE9D9FFFFE7D7FFFFE5D2FFFFE2CBFFFFF7F1FFCB8555FE206398FF88C4
E6FF599FD6FF569BD3FF5397D1FF5395D1FFD7AC7FFFFFF7F0FFFFE7D5FFFDE7
D6FFFDE6D4FFFCE4D0FFFBE3CBFFFADCC2FFFEF3E8FFCC8656FE206398FF8BC9
E7FF5CA5D7FF59A0D5FF579CD3FF569AD3FFD7AC7FFFFFF7F2FFFEE7D5FFFEE7
D5FFFDE5D1FFFAE0CAFFF9DEC4FFF7D9BCFFFDF2E7FFCC8757FE206398FF91CD
E9FF5FA9D9FF5DA5D8FF5AA0D6FF599FD6FFD8AD81FFFEF7F1FFFCE5D2FFFCE4
D1FFFBE2CCFFF9DDC4FFF6D7BBFFF3D1AFFFFAEFE4FFCC8758FE206398FF98D2
EBFF65AEDAFF60AAD9FF5DA6D8FF5CA5D7FFD9AF84FFFEF6F0FFFCE2CDFFFCE3
CDFFFADFC8FFF7D9BCFFF5E9DDFFFAF3EBFFFBF8F3FFCA8353FE206398FF9ED6
EDFF6BB2DCFF66AFDCFF60AADAFF5FA9D9FFD9AF84FFFEF5EDFFFCDEC5FFFBE0
C7FFF9DCC2FFF5D3B4FFFEF9F3FFFAE2C4FFECC193FFCB8857DC206398FFA5DA
EFFF6FB5DEFF68B0DCFF60A9D9FF5FA9D9FFD7AD81FFFFFFFEFFFDF3E9FFFDF3
EAFFFCF2E8FFFAEFE3FFFAF2E7FFEABB88FFCE8959E7B4693D0C206398FFAADD
F1FF74B9E0FF70B6DFFF6CB3DDFF6BB2DCFFD9AF84FFD7AE81FFD7AC7FFFD7AC
7FFFCCA070FFCD9F71FFB38F67FFCB8856D6B2673C09FFFFFF00206398FFB0E1
F2FF79BDE2FF4498DDFF4497DCFF4396DCFF4296DCFF4295DCFF4195DBFF539E
D4FF89C6E6FF206398FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00206398E094C9
E0FDAEE2F2FF4E9DDFFFB5EEFDFF75D4F0FF75D4F0FFB5EEFDFF4B9BDEFF8ECB
E9FF8DCAE8F2206398F3FFFFFF00FFFFFF00FFFFFF00FFFFFF00206398322063
98B2206398FF3775A4FFB6EFFEFF80DBF3FF80DBF3FFB6EFFEFF2E6EA1FF2063
98FF206398A520639853FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF002063982A206398FF206398FF206398FF206398FF206398FF206398F0FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
end end
object MenuItem103: TMenuItem object MenuItem103: TMenuItem
Caption = '-' Caption = '-'

View File

@ -63,7 +63,7 @@ object Form1: TForm1
TabOrder = 1 TabOrder = 1
TitleStyle = tsNative TitleStyle = tsNative
ColWidths = ( ColWidths = (
56 42
64 64
64 64
64 64
@ -104,19 +104,19 @@ object Form1: TForm1
TabOrder = 2 TabOrder = 2
object Label1: TLabel object Label1: TLabel
Left = 8 Left = 8
Height = 20 Height = 15
Top = 9 Top = 9
Width = 46 Width = 37
Caption = 'Sheets:' Caption = 'Sheets:'
ParentColor = False ParentColor = False
end end
object SheetsCombo: TComboBox object SheetsCombo: TComboBox
Left = 72 Left = 72
Height = 28 Height = 23
Top = 4 Top = 4
Width = 808 Width = 808
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
ItemHeight = 20 ItemHeight = 15
ItemIndex = 0 ItemIndex = 0
Items.Strings = ( Items.Strings = (
'Sheet 1' 'Sheet 1'

View File

@ -4,7 +4,7 @@ object MainFrm: TMainFrm
Top = 258 Top = 258
Width = 884 Width = 884
Caption = 'spready' Caption = 'spready'
ClientHeight = 614 ClientHeight = 619
ClientWidth = 884 ClientWidth = 884
Menu = MainMenu Menu = MainMenu
OnActivate = FormActivate OnActivate = FormActivate
@ -14,7 +14,7 @@ object MainFrm: TMainFrm
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Height = 82 Height = 82
Top = 532 Top = 537
Width = 884 Width = 884
Align = alBottom Align = alBottom
BevelOuter = bvNone BevelOuter = bvNone
@ -23,7 +23,7 @@ object MainFrm: TMainFrm
TabOrder = 6 TabOrder = 6
object EdFrozenCols: TSpinEdit object EdFrozenCols: TSpinEdit
Left = 429 Left = 429
Height = 28 Height = 23
Top = 8 Top = 8
Width = 52 Width = 52
OnChange = EdFrozenColsChange OnChange = EdFrozenColsChange
@ -31,7 +31,7 @@ object MainFrm: TMainFrm
end end
object EdFrozenRows: TSpinEdit object EdFrozenRows: TSpinEdit
Left = 429 Left = 429
Height = 28 Height = 23
Top = 39 Top = 39
Width = 52 Width = 52
OnChange = EdFrozenRowsChange OnChange = EdFrozenRowsChange
@ -39,37 +39,37 @@ object MainFrm: TMainFrm
end end
object Label1: TLabel object Label1: TLabel
Left = 344 Left = 344
Height = 20 Height = 15
Top = 13 Top = 13
Width = 77 Width = 62
Caption = 'Frozen cols:' Caption = 'Frozen cols:'
FocusControl = EdFrozenCols FocusControl = EdFrozenCols
ParentColor = False ParentColor = False
end end
object Label2: TLabel object Label2: TLabel
Left = 344 Left = 344
Height = 20 Height = 15
Top = 40 Top = 40
Width = 82 Width = 66
Caption = 'Frozen rows:' Caption = 'Frozen rows:'
FocusControl = EdFrozenRows FocusControl = EdFrozenRows
ParentColor = False ParentColor = False
end end
object CbReadFormulas: TCheckBox object CbReadFormulas: TCheckBox
Left = 8 Left = 8
Height = 24 Height = 19
Top = 8 Top = 8
Width = 120 Width = 96
Caption = 'Read formulas' Caption = 'Read formulas'
OnChange = CbReadFormulasChange OnChange = CbReadFormulasChange
TabOrder = 0 TabOrder = 0
end end
object CbHeaderStyle: TComboBox object CbHeaderStyle: TComboBox
Left = 200 Left = 200
Height = 28 Height = 23
Top = 8 Top = 8
Width = 116 Width = 116
ItemHeight = 20 ItemHeight = 15
ItemIndex = 2 ItemIndex = 2
Items.Strings = ( Items.Strings = (
'Lazarus' 'Lazarus'
@ -83,18 +83,18 @@ object MainFrm: TMainFrm
end end
object CbAutoCalcFormulas: TCheckBox object CbAutoCalcFormulas: TCheckBox
Left = 8 Left = 8
Height = 24 Height = 19
Top = 32 Top = 32
Width = 158 Width = 128
Caption = 'Calculate on change' Caption = 'Calculate on change'
OnChange = CbAutoCalcFormulasChange OnChange = CbAutoCalcFormulasChange
TabOrder = 1 TabOrder = 1
end end
object CbTextOverflow: TCheckBox object CbTextOverflow: TCheckBox
Left = 8 Left = 8
Height = 24 Height = 19
Top = 56 Top = 56
Width = 114 Width = 91
Caption = 'Text overflow' Caption = 'Text overflow'
Checked = True Checked = True
OnChange = CbTextOverflowChange OnChange = CbTextOverflowChange
@ -129,6 +129,7 @@ object MainFrm: TMainFrm
end end
object ToolButton5: TToolButton object ToolButton5: TToolButton
Left = 70 Left = 70
Height = 24
Top = 0 Top = 0
Width = 5 Width = 5
Caption = 'ToolButton5' Caption = 'ToolButton5'
@ -141,6 +142,7 @@ object MainFrm: TMainFrm
end end
object ToolButton6: TToolButton object ToolButton6: TToolButton
Left = 98 Left = 98
Height = 24
Top = 0 Top = 0
Width = 5 Width = 5
Caption = 'ToolButton6' Caption = 'ToolButton6'
@ -173,6 +175,7 @@ object MainFrm: TMainFrm
end end
object ToolButton31: TToolButton object ToolButton31: TToolButton
Left = 195 Left = 195
Height = 24
Top = 0 Top = 0
Width = 5 Width = 5
Caption = 'ToolButton31' Caption = 'ToolButton31'
@ -206,19 +209,19 @@ object MainFrm: TMainFrm
end end
object FontComboBox: TComboBox object FontComboBox: TComboBox
Left = 52 Left = 52
Height = 28 Height = 23
Top = 2 Top = 2
Width = 127 Width = 127
ItemHeight = 20 ItemHeight = 15
OnSelect = FontComboBoxSelect OnSelect = FontComboBoxSelect
TabOrder = 0 TabOrder = 0
end end
object FontSizeComboBox: TComboBox object FontSizeComboBox: TComboBox
Left = 179 Left = 179
Height = 28 Height = 23
Top = 2 Top = 2
Width = 48 Width = 48
ItemHeight = 20 ItemHeight = 15
Items.Strings = ( Items.Strings = (
'8' '8'
'9' '9'
@ -256,6 +259,7 @@ object MainFrm: TMainFrm
end end
object ToolButton14: TToolButton object ToolButton14: TToolButton
Left = 319 Left = 319
Height = 23
Top = 2 Top = 2
Width = 5 Width = 5
Caption = 'ToolButton14' Caption = 'ToolButton14'
@ -264,6 +268,7 @@ object MainFrm: TMainFrm
end end
object ToolButton15: TToolButton object ToolButton15: TToolButton
Left = 393 Left = 393
Height = 23
Top = 2 Top = 2
Width = 5 Width = 5
Caption = 'ToolButton15' Caption = 'ToolButton15'
@ -288,6 +293,7 @@ object MainFrm: TMainFrm
end end
object ToolButton19: TToolButton object ToolButton19: TToolButton
Left = 467 Left = 467
Height = 23
Top = 2 Top = 2
Width = 5 Width = 5
Caption = 'ToolButton19' Caption = 'ToolButton19'
@ -340,6 +346,7 @@ object MainFrm: TMainFrm
end end
object ToolButton26: TToolButton object ToolButton26: TToolButton
Left = 24 Left = 24
Height = 23
Top = 2 Top = 2
Width = 5 Width = 5
Caption = 'ToolButton26' Caption = 'ToolButton26'
@ -359,7 +366,7 @@ object MainFrm: TMainFrm
end end
object FormulaToolBar: TToolBar object FormulaToolBar: TToolBar
Left = 0 Left = 0
Height = 28 Height = 26
Top = 53 Top = 53
Width = 884 Width = 884
Caption = 'FormulaToolBar' Caption = 'FormulaToolBar'
@ -367,13 +374,13 @@ object MainFrm: TMainFrm
TabOrder = 2 TabOrder = 2
object FormulaToolbarSplitter: TSplitter object FormulaToolbarSplitter: TSplitter
Left = 171 Left = 171
Height = 26 Height = 24
Top = 2 Top = 2
Width = 5 Width = 5
end end
object FormulaMemo: TMemo object FormulaMemo: TMemo
Left = 176 Left = 176
Height = 26 Height = 24
Top = 2 Top = 2
Width = 708 Width = 708
Align = alClient Align = alClient
@ -383,18 +390,18 @@ object MainFrm: TMainFrm
end end
object AddressPanel: TPanel object AddressPanel: TPanel
Left = 1 Left = 1
Height = 24 Height = 22
Top = 2 Top = 2
Width = 170 Width = 170
Align = alLeft Align = alLeft
BorderSpacing.Bottom = 2 BorderSpacing.Bottom = 2
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 24 ClientHeight = 22
ClientWidth = 170 ClientWidth = 170
TabOrder = 2 TabOrder = 2
object EdCellAddress: TEdit object EdCellAddress: TEdit
Left = 0 Left = 0
Height = 28 Height = 23
Top = 0 Top = 0
Width = 170 Width = 170
Align = alTop Align = alTop
@ -406,16 +413,16 @@ object MainFrm: TMainFrm
end end
object InspectorSplitter: TSplitter object InspectorSplitter: TSplitter
Left = 648 Left = 648
Height = 446 Height = 453
Top = 86 Top = 84
Width = 5 Width = 5
Align = alRight Align = alRight
ResizeAnchor = akRight ResizeAnchor = akRight
end end
object InspectorPageControl: TPageControl object InspectorPageControl: TPageControl
Left = 653 Left = 653
Height = 446 Height = 453
Top = 86 Top = 84
Width = 231 Width = 231
ActivePage = PgCellValue ActivePage = PgCellValue
Align = alRight Align = alRight
@ -424,11 +431,11 @@ object MainFrm: TMainFrm
OnChange = InspectorPageControlChange OnChange = InspectorPageControlChange
object PgCellValue: TTabSheet object PgCellValue: TTabSheet
Caption = 'Cell value' Caption = 'Cell value'
ClientHeight = 413 ClientHeight = 425
ClientWidth = 223 ClientWidth = 223
object CellInspector: TValueListEditor object CellInspector: TValueListEditor
Left = 0 Left = 0
Height = 413 Height = 425
Top = 0 Top = 0
Width = 223 Width = 223
Align = alClient Align = alClient
@ -472,15 +479,15 @@ object MainFrm: TMainFrm
end end
object TabControl: TTabControl object TabControl: TTabControl
Left = 0 Left = 0
Height = 446 Height = 453
Top = 86 Top = 84
Width = 648 Width = 648
OnChange = TabControlChange OnChange = TabControlChange
Align = alClient Align = alClient
TabOrder = 3 TabOrder = 3
object WorksheetGrid: TsWorksheetGrid object WorksheetGrid: TsWorksheetGrid
Left = 2 Left = 2
Height = 441 Height = 448
Top = 3 Top = 3
Width = 644 Width = 644
FrozenCols = 0 FrozenCols = 0
@ -491,14 +498,14 @@ object MainFrm: TMainFrm
BorderStyle = bsNone BorderStyle = bsNone
ColCount = 27 ColCount = 27
MouseWheelOption = mwGrid MouseWheelOption = mwGrid
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goRowSizing, goColSizing, goThumbTracking, goDblClickAutoSize, goSmoothScroll, goHeaderHotTracking, goHeaderPushedLook, goFixedColSizing] Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goRowSizing, goColSizing, goThumbTracking, goDblClickAutoSize, goHeaderHotTracking, goHeaderPushedLook, goFixedColSizing]
RowCount = 101 RowCount = 101
TabOrder = 1 TabOrder = 1
TitleStyle = tsNative TitleStyle = tsNative
OnHeaderClick = WorksheetGridHeaderClick OnHeaderClick = WorksheetGridHeaderClick
OnSelection = WorksheetGridSelection OnSelection = WorksheetGridSelection
ColWidths = ( ColWidths = (
56 42
64 64
64 64
64 64
@ -532,7 +539,7 @@ object MainFrm: TMainFrm
Cursor = crVSplit Cursor = crVSplit
Left = 0 Left = 0
Height = 5 Height = 5
Top = 81 Top = 79
Width = 884 Width = 884
Align = alTop Align = alTop
ResizeAnchor = akTop ResizeAnchor = akTop

View File

@ -954,8 +954,8 @@ end;
procedure TMainFrm.FormCreate(Sender: TObject); procedure TMainFrm.FormCreate(Sender: TObject);
begin begin
// Adjust format toolbar height, looks strange at 120 dpi // Adjust format toolbar height, looks strange at 120 dpi
FormatToolbar.Height := FontCombobox.Height + 2*FontCombobox.Top; // FormatToolbar.Height := FontCombobox.Height + 2*FontCombobox.Top;
FormatToolbar.ButtonHeight := FormatToolbar.Height - 4; // FormatToolbar.ButtonHeight := FormatToolbar.Height - 4;
CbBackgroundColor.ItemHeight := FontCombobox.ItemHeight; CbBackgroundColor.ItemHeight := FontCombobox.ItemHeight;
CbBackgroundColor.ColorRectWidth := CbBackgroundColor.ItemHeight - 6; // to get a square box... CbBackgroundColor.ColorRectWidth := CbBackgroundColor.ItemHeight - 6; // to get a square box...

View File

@ -7311,7 +7311,6 @@ function TsWorkbook.TryStrToCellRanges(AText: String; out AWorksheet: TsWorkshee
out ARanges: TsCellRangeArray; AListSeparator: Char = #0): Boolean; out ARanges: TsCellRangeArray; AListSeparator: Char = #0): Boolean;
var var
i: Integer; i: Integer;
s: String;
L: TStrings; L: TStrings;
begin begin
Result := false; Result := false;

View File

@ -344,7 +344,6 @@ end;
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
function TsWorkbookChartSource.CountValues(AIndex: TsXYRange): Integer; function TsWorkbookChartSource.CountValues(AIndex: TsXYRange): Integer;
var var
ir: Integer;
range: TsCellRange; range: TsCellRange;
begin begin
Result := 0; Result := 0;
@ -425,7 +424,7 @@ procedure TsWorkbookChartSource.GetXYItem(XOrY:TsXYRange; APointIndex: Integer;
out ANumber: Double; out AText: String); out ANumber: Double; out AText: String);
var var
range: TsCellRange; range: TsCellRange;
idx, ir: Integer; idx: Integer;
len: Integer; len: Integer;
row, col: Cardinal; row, col: Cardinal;
cell: PCell; cell: PCell;
@ -442,7 +441,7 @@ begin
len := range.Row2 - range.Row1 + 1; len := range.Row2 - range.Row1 + 1;
if (APointIndex >= idx) and (APointIndex < idx + len) then if (APointIndex >= idx) and (APointIndex < idx + len) then
begin begin
row := range.Row1 + APointIndex - idx; row := longint(range.Row1) + APointIndex - idx;
col := range.Col1; col := range.Col1;
break; break;
end; end;
@ -450,11 +449,11 @@ begin
end else // horizontal range end else // horizontal range
if (range.Row1 = range.Row2) then if (range.Row1 = range.Row2) then
begin begin
len := range.Col2 - range.Col1 + 1; len := longint(range.Col2) - range.Col1 + 1;
if (APointIndex >= idx) and (APointIndex < idx + len) then if (APointIndex >= idx) and (APointIndex < idx + len) then
begin begin
row := range.Row1; row := range.Row1;
col := range.Col1 + APointIndex - idx; col := longint(range.Col1) + APointIndex - idx;
break; break;
end; end;
end else end else

View File

@ -654,7 +654,7 @@ begin
if FWorksheet <> nil then if FWorksheet <> nil then
begin begin
NotifyListeners([lniCell], Worksheet.FindCell(ARow, ACol)); NotifyListeners([lniCell], Worksheet.FindCell(ARow, ACol));
NotifyListeners([lniRow], Pointer(PtrInt(ARow))); NotifyListeners([lniRow], {%H-}Pointer(PtrInt(ARow)));
end; end;
end; end;

View File

@ -20,6 +20,8 @@ unit fpspreadsheetgrid;
- Arial bold is not shown as such if loaded from ods - Arial bold is not shown as such if loaded from ods
- Background color of first cell is ignored. } - Background color of first cell is ignored. }
{ Activate next define for Laz >= 1.4 }
{.$DEFINE DO_NOT_STORE_COLWIDTHS_ROWHEIGHTS_IN_LFM}
interface interface
@ -153,6 +155,10 @@ type
AJustification: Byte; ACellHorAlign: TsHorAlignment; AJustification: Byte; ACellHorAlign: TsHorAlignment;
ACellVertAlign: TsVertAlignment; ATextRot: TsTextRotation; ACellVertAlign: TsVertAlignment; ATextRot: TsTextRotation;
ATextWrap, ReplaceTooLong: Boolean); ATextWrap, ReplaceTooLong: Boolean);
{$IFDEF DO_NOT_STORE_COLWIDTHS_ROWHEIGHTS_IN_LFM}
function IsColWidthsStored: Boolean; override;
function IsRowHeightsStored: Boolean; override;
{$ENDIF}
procedure KeyDown(var Key : Word; Shift : TShiftState); override; procedure KeyDown(var Key : Word; Shift : TShiftState); override;
procedure Loaded; override; procedure Loaded; override;
procedure LoadFromWorksheet(AWorksheet: TsWorksheet); procedure LoadFromWorksheet(AWorksheet: TsWorksheet);
@ -1130,7 +1136,6 @@ begin
inherited DblClick; inherited DblClick;
end; end;
{@@ ---------------------------------------------------------------------------- {@@ ----------------------------------------------------------------------------
Adjusts the grid's canvas before painting a given cell. Considers Adjusts the grid's canvas before painting a given cell. Considers
background color, horizontal alignment, vertical alignment, etc. background color, horizontal alignment, vertical alignment, etc.
@ -2877,6 +2882,26 @@ begin
end; end;
end; end;
{$IFDEF DO_NOT_STORE_COLWIDTHS_ROWHEIGHTS_IN_LFM}
{@@ ----------------------------------------------------------------------------
Prevents storing of column widths in lfm file, they are retrieved from the
worksheet file
-------------------------------------------------------------------------------}
function TsCustomWorksheetGrid.IsColWidthsStored: Boolean;
begin
Result := false;
end;
{@@ ----------------------------------------------------------------------------
Prevents storing of row heights in lfm file, they are retrieved from the
worksheet file
-------------------------------------------------------------------------------}
function TsCustomWorksheetGrid.IsRowHeightsStored: Boolean;
begin
Result := false;
end;
{$ENDIF}
{@@ ---------------------------------------------------------------------------- {@@ ----------------------------------------------------------------------------
Standard key handling method inherited from TCustomGrid. Is overridden to Standard key handling method inherited from TCustomGrid. Is overridden to
catch the ESC key during editing in order to restore the old cell text catch the ESC key during editing in order to restore the old cell text
@ -3049,7 +3074,7 @@ begin
// Row height (after font change). // Row height (after font change).
if (lniRow in AChangedItems) and (Worksheet <> nil) then if (lniRow in AChangedItems) and (Worksheet <> nil) then
begin begin
grow := GetGridRow(PtrInt(AData)); grow := GetGridRow({%H-}PtrInt(AData));
RowHeights[grow] := CalcAutoRowHeight(grow); RowHeights[grow] := CalcAutoRowHeight(grow);
end; end;
end; end;