You've already forked lazarus-ccr
GridPrinter: Add standard actions for printing/previewing a grid.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8596 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="12"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<Title Value="gridprinteractions_demo"/>
|
||||
<Scaled Value="True"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
</XPManifest>
|
||||
</General>
|
||||
<BuildModes>
|
||||
<Item Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<UseFileFilters Value="True"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
</RunParams>
|
||||
<RequiredPackages>
|
||||
<Item>
|
||||
<PackageName Value="GridPrinterPkg"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item>
|
||||
</RequiredPackages>
|
||||
<Units>
|
||||
<Unit>
|
||||
<Filename Value="gridprinteractions_demo.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="GridPrinterActions_Demo"/>
|
||||
</Unit>
|
||||
<Unit>
|
||||
<Filename Value="main.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="MainForm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="gridprinteractions_demo"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf3"/>
|
||||
</Debugging>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions>
|
||||
<Item>
|
||||
<Name Value="EAbort"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
@ -0,0 +1,25 @@
|
||||
program GridPrinterActions_Demo;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}
|
||||
cthreads,
|
||||
{$ENDIF}
|
||||
{$IFDEF HASAMIGA}
|
||||
athreads,
|
||||
{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, main
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
RequireDerivedFormResource:=True;
|
||||
Application.Scaled:=True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TMainForm, MainForm);
|
||||
Application.Run;
|
||||
end.
|
||||
|
Binary file not shown.
400
components/gridprinter/examples/actions/main.lfm
Normal file
400
components/gridprinter/examples/actions/main.lfm
Normal file
@ -0,0 +1,400 @@
|
||||
object MainForm: TMainForm
|
||||
Left = 331
|
||||
Height = 394
|
||||
Top = 132
|
||||
Width = 801
|
||||
Caption = 'MainForm'
|
||||
ClientHeight = 374
|
||||
ClientWidth = 801
|
||||
Menu = MainMenu1
|
||||
LCLVersion = '2.3.0.0'
|
||||
object StringGrid1: TStringGrid
|
||||
Left = 6
|
||||
Height = 324
|
||||
Top = 44
|
||||
Width = 789
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 6
|
||||
DefaultColWidth = 120
|
||||
Font.CharSet = ANSI_CHARSET
|
||||
Font.Pitch = fpFixed
|
||||
Font.Quality = fqDraft
|
||||
MouseWheelOption = mwGrid
|
||||
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goThumbTracking, goSmoothScroll]
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
ColWidths = (
|
||||
34
|
||||
120
|
||||
120
|
||||
120
|
||||
120
|
||||
)
|
||||
end
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Height = 38
|
||||
Top = 0
|
||||
Width = 801
|
||||
AutoSize = True
|
||||
ButtonHeight = 36
|
||||
ButtonWidth = 40
|
||||
Caption = 'ToolBar1'
|
||||
EdgeBorders = [ebBottom]
|
||||
Images = ImageList1
|
||||
ImagesWidth = 24
|
||||
TabOrder = 1
|
||||
object ToolButton1: TToolButton
|
||||
Left = 46
|
||||
Top = 0
|
||||
Action = GridPrinterAction1
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 86
|
||||
Top = 0
|
||||
Action = GridPrintPreviewAction1
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 1
|
||||
Top = 0
|
||||
Action = FileOpen1
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 41
|
||||
Height = 36
|
||||
Top = 0
|
||||
Caption = 'ToolButton4'
|
||||
Style = tbsDivider
|
||||
end
|
||||
object ToolButton5: TToolButton
|
||||
Left = 126
|
||||
Height = 36
|
||||
Top = 0
|
||||
Caption = 'ToolButton5'
|
||||
Style = tbsDivider
|
||||
end
|
||||
object ToolButton6: TToolButton
|
||||
Left = 131
|
||||
Top = 0
|
||||
Action = FileExit1
|
||||
end
|
||||
end
|
||||
object GridPrinter1: TGridPrinter
|
||||
Grid = StringGrid1
|
||||
Footer.Font.Height = -11
|
||||
Header.Font.Height = -11
|
||||
ShowPrintDialog = gpdPrintDialog
|
||||
Left = 334
|
||||
Top = 135
|
||||
end
|
||||
object ActionList1: TActionList
|
||||
Images = ImageList1
|
||||
Left = 216
|
||||
Top = 135
|
||||
object GridPrinterAction1: TGridPrinterAction
|
||||
Category = 'GridPrinter'
|
||||
GridPrinter = GridPrinter1
|
||||
Caption = 'Print...'
|
||||
Hint = 'Print grid'
|
||||
ImageIndex = 0
|
||||
end
|
||||
object GridPrintPreviewAction1: TGridPrintPreviewAction
|
||||
Category = 'GridPrinter'
|
||||
PreviewDialog = GridPrintPreviewDialog1
|
||||
Caption = 'Preview...'
|
||||
Hint = 'Print Preview'
|
||||
ImageIndex = 1
|
||||
end
|
||||
object FileExit1: TFileExit
|
||||
Category = 'File'
|
||||
Caption = 'E&xit'
|
||||
Hint = 'Exit'
|
||||
ImageIndex = 2
|
||||
end
|
||||
object FileOpen1: TFileOpen
|
||||
Category = 'File'
|
||||
Caption = '&Open ...'
|
||||
Hint = 'Open'
|
||||
ImageIndex = 3
|
||||
ShortCut = 16463
|
||||
OnAccept = FileOpen1Accept
|
||||
end
|
||||
end
|
||||
object GridPrintPreviewDialog1: TGridPrintPreviewDialog
|
||||
GridPrinter = GridPrinter1
|
||||
Left = 440
|
||||
Top = 135
|
||||
end
|
||||
object MainMenu1: TMainMenu
|
||||
Images = ImageList1
|
||||
Left = 120
|
||||
Top = 135
|
||||
object MenuItem1: TMenuItem
|
||||
Caption = 'File'
|
||||
object MenuItem6: TMenuItem
|
||||
Action = FileOpen1
|
||||
end
|
||||
object Separator2: TMenuItem
|
||||
Caption = '-'
|
||||
end
|
||||
object MenuItem2: TMenuItem
|
||||
Action = GridPrinterAction1
|
||||
end
|
||||
object MenuItem3: TMenuItem
|
||||
Action = GridPrintPreviewAction1
|
||||
end
|
||||
object Separator1: TMenuItem
|
||||
Caption = '-'
|
||||
end
|
||||
object MenuItem4: TMenuItem
|
||||
Action = FileExit1
|
||||
end
|
||||
end
|
||||
end
|
||||
object ImageList1: TImageList
|
||||
Scaled = True
|
||||
Left = 120
|
||||
Top = 200
|
||||
Bitmap = {
|
||||
4C7A040000001000000010000000B90200000000000078DAD556BD6BD550143F
|
||||
55FCC049AB2ECE2282AB2082A0A88B5541FC0017FF01573F51C1A2AB2E3A5507
|
||||
A1A5D6DC3C74105C055BB14A5179AFF1290E0F04953748862E1DACF1F7BB9CA4
|
||||
214D939B34080E3F7273EFF99DAF9C7372A32892A821CC1A895C50C477B15176
|
||||
D6F164386B937BAEFC7F6D1F7B61596E72721C66ED56F13FF50C5DBF5B0E4217
|
||||
9B65B1FC2F7CC8F694D36BD0FE8AF2DF60EF16F9B1D0F1E5C04AFA02E807460E
|
||||
D6E583BBAF48874B5F16E928E16773B350677614C9A6F73E3C938DB3BE3CC0DE
|
||||
0FE03BD7ED71D9E4C2374656633D8D7973EFF3846C23B8E61ECFCAF81D2347B1
|
||||
9EC47260F15C06B037C5B3327EE0CB05D8BB93737E97678EF6A7F2EC7FF264C8
|
||||
357EE07E1C3FF2F710EFBF3EB66457DCC7A5F9373262730FC0A751A08FF5CF76
|
||||
4B76D6F977749FC80ED5D70FD48FAAF543DBF481400D6FAFD0BFC9CC521DDF10
|
||||
CFB9327BF85E37892A73A46D643F7C1B549F5E12DA7B833C5BD69691B5B03566
|
||||
7DF5E57C96CF3D9D03A33323B226277FE3C01FD4DEB5549D277C5B17BEDCA00C
|
||||
EDA4B9986D2755F7D58CCE849FC8423F65518B275272ACB7201A9655657CADCF
|
||||
2EF09AEF5F1ECB16EB53C6F6727CED91EB9C419C09A8A53DEACFD012BE2F6789
|
||||
25FB9E1CB7779296EC8EF9C8C911D76F8C7C1D8BF9DDA7B299FE43E715573E63
|
||||
D598E33A99464C9D6CFEF2A0F90B20FF26A5EFB4DEB12E3ADA8EF8CDD3F305EF
|
||||
9EFDCF19B994E787B58B1829C35ACB9EF71EC97AD5113116EA614E097C83CBF4
|
||||
D9D6B627135F5FC8BA829E3B03B97736A78BBDCBF55B704FB9E6F8BD91ADE8B7
|
||||
BD04D75183F7FC26C1F982D8E653B1CE579939565EEB289E330EB330ACF3DFCE
|
||||
E334C19F792E1B6ADE03FBDAFB87F17C55C58798A335791B357AAB520CCA513F
|
||||
26F1CD0E55CC81E5287F8E3970E56ABEE6F419D58D3DB99BD68C3DB99BD68C5D
|
||||
67F9EF3AF7FE2AF92AC25F5049BF8C
|
||||
}
|
||||
BitmapAdv = {
|
||||
4C69040000004C7A040000001800000018000000150500000000000078DAE559
|
||||
59885C4514BD71C31D8D5F2A44710145E246F447D11F51FC10097EA9E30A2A31
|
||||
A29810037E8D10749480A088E643033131DDAF3B89715C4003A32619314CB6E9
|
||||
EE2C66C611822446244A3E46C64CDA735EDF9AD454FA7557D7AB19977C5CFAF5
|
||||
AB5BA76EDDBA75B757AFD7A53E9DD42DA75413391642983EA31D7E92C8A9E0AD
|
||||
83BEA814E5651F222FE750365FFC4A228B7CF75C2DC94BA1F8B544CE684579F1
|
||||
55579994171FFA7DB5159D2CFAC1F8B03D2F443F160D37C1E7FB4DE07D3DD43E
|
||||
ABC574EE26B32F171FF274E7B57F62D8F838A31FDBE938942CECCFB1B7C55189
|
||||
98662DEC2FB69F9C74E627313EECEC11F5FFE65CF7C5C4DFBD5A2E879D2C0146
|
||||
0F09CF8F4FBB7EA6D03EA7FA7ED5A73B7F9842727DB4C7FEB781CEED00DFF8E8
|
||||
9EB6D4F0C7E3F8DDE8BB86F1D11DF016F13B06DABC67BD9C3705F8DDD8C303BE
|
||||
6B84E0A7CF9E6B748C9FC857E63E61DE4A9E07CF3C12FE70AB9C222F7E535FEA
|
||||
C4DE7F0B7EB520B760AC0CFA15F427F45EA1CEFB13392B2F3E709EC2991DC5D8
|
||||
418CBDA739CE06C614ACB315633343F131F756C5EE75EF68AD24F7E2FD28D658
|
||||
178AAF3A399875FF4D0CA995E5BA407CEA7B5916FF8E442ED5F8F76C20FE28E8
|
||||
B52C7E9EAFFAB9C581FA1FE45966F10F2672A7DEE3B941F237E2E8319EA5CB9B
|
||||
D61725E907F6A19D2BE49C107CEE9F3698EA0967497D8F2C97332937DEF7AB3F
|
||||
388CFFB3559EC7F07FA813FBA77DD3065D1F43B989AD71EC905923D43FD30669
|
||||
27AC0BA86FEA64B02CD760CE01DF3542FC4F276B84FA37DF35DC98E14390A74B
|
||||
6D7576AD71263C9F9118F9899D2F9B35F0FF27ACF36948DF06F356907CEAE84E
|
||||
09B8B3ACBC6A563E3C99C1BBC2DE8E919579BEC1E7B3D953DAFF01AF4F6F29D5
|
||||
E12AB9D0F48B48BB0A7273163EC7EC1C7FFB3AB9A08D0E66AA3F68E8A124EFB3
|
||||
DECEC2E718792CBD0D50BE4C9D204E29EF18F6FCA05B079DA09FE3B1EC61CDAF
|
||||
38BEBE99AE583759723CD4ACCECAC257DFD965D55B8FDA6303CBE47453C74096
|
||||
0FB3EAB856F81A2F3F32FD93BE3E396D62ED92DCAD721F1D5C235784E2570A72
|
||||
25C6C753BB28CA5DD6BD7D5B7DC337ADEAD076F88AB55163E69BD6BB3E957F49
|
||||
26FE5AB9083C7F91F8DCA22EED317ECCC2DFADBA7FA695FD62CF7790DAD4F3F3
|
||||
749F350BBFA66BCECB5DC31565BEE2572DFC0DAA9F37F2E2C34E972AD697EE3B
|
||||
C8FF5D6E7C60689C5AEAE631CC45188B82B10B72ADE9A54C3AA7464FFE075DE3
|
||||
E31CF5F3278AB1D7F5115AA3D5D576E707E8FD792B7799DBE67E8F93BF039DBF
|
||||
60EE2DEBBC2CBE815E391B3CDF5A727C063BB831D39F97E5263B5680F76BB7A6
|
||||
699A131FDF87A16D90EB2DDCBF85243EF39DC3B38AB9A377BC2DC9FD98B3D323
|
||||
7FD881F3BA2F475CBF1D18AF5057F8DD02FA9EF907DF01F7B6FF53FFE89FA03D
|
||||
ABE512C664D011E7DCC6584733B6E5EC8911FB0FC69B263DAAEDAC21F6AD94F3
|
||||
73E01FB17D9DE333EE09C877877D737EDE9734FFF3E9C735F67BC2B791BC3D93
|
||||
76FD8DE9C2673EC4BA23728F78C8E057CA32277D2E49D15BDF0EC167BD5B610E
|
||||
DB388BFD262F213E7CCA023EF33E44FA46FD1B7B2313F2376AE8A1287DE682DC
|
||||
A0B85D137DD2447EC1EF07916AA9E7D218BF462E53FC77347F7B228A1D95D2BE
|
||||
F17EABA7DDABF1EDAA487DF89F4D9EAFF2B3CF732006F6AEB25CADB23E6DD5EC
|
||||
BFE37F21D21D7B32C544AE35E9FB7140CE93A19BE5ECDB99FC6A221729CBF5B1
|
||||
BE8140176B277DB328CA688C9A1FF678B1E2BDE8F44C0EC7F8E6C5FBA3BA9863
|
||||
E18F45F6692376EDF85FA7BF01E974CB914C7A04000000200000002000000050
|
||||
0500000000000078DAED5ADD6B1457143F2A286AD57E6955FAAEFF422148AD0F
|
||||
792D6DD1876A5B8C455B6868695A5002495BB15F8AE88B4FD60F6C6467F2614C
|
||||
EB4B2D284B0421D9683E4C243ED84D1BDF0A3109AD46B39E337B673D7B9D99BD
|
||||
3B73EF8CAEF3706077E6DEF99D39E7773EEE9D5B2814A090CA13326C4141A73C
|
||||
ABF8BAEC580BF8616C5D4BF8A9FF6BD7FF3826AB236F28E6B1AC6ABE3395C72B
|
||||
D9DB14FF9E367C3FBFC72449626BE559545EA6F8297E2DE1FBC476F679C17FD6
|
||||
FCFF9CD6806CBAD655EB0315E5E15006F624CCCBF9611B3E4D6ABDE0E0A38CD8
|
||||
F05922F819F8388A0E3AD62B5174D0B55E0AAB83D6F55A081D74AF9729165C1D
|
||||
862CF82406FE07E60783F8591D7DBEC17EA426F0AF77C29A110BF6E3981CCA8C
|
||||
901C72FDBB9C05AB4DE223C6BB78EF6E807FA7866C78C704BEC09E17F7BB11E7
|
||||
CDEBA7613909DEDB8CD77ADCFCEFA543147CB2B9FBDE9847F6FACDC5DABBCFB5
|
||||
83EC8B28F8C2DFCE7B2BCC2FDAC1866F75E1E3FF6B748D6C5E693EEAFA967846
|
||||
4E23FE345D235F579A3FD60D2BC433A675E3E3BBBD5069FEF81958E9724023FE
|
||||
80E82D3657B4BF0D5BB4DB1FB924AE9F57F0FF6F62EC37BAF02996C89E0E0731
|
||||
C67CE7DAD02CE6CF8E6B8C3F27B631A7B0FCD3433C273E38823667EF5D1079E2
|
||||
78A11516EACCBF428729DFFC6BC3AC9F0EA23E67A3D69F9B6DF02AF1017B997E
|
||||
1117D3F8EE7DE4EF5BA7B1362166901DCCD75F588098C7B80EC8995F5475D053
|
||||
FFC3EBA0AFFF08A783D6FE07B1643EA00E4763DA17C9FAE8306370FDEDBDB751
|
||||
D4E1085EFB0FDFFF800EDB52DE215B92A8D425DD82B88DCCA78D09E0B732FC56
|
||||
63FB31367C80B9EEF71B19785B159FC6D21C9A1B1697F22C3EA38BF1E95F557C
|
||||
1A5BCABF16748E76C22B55726B2DCE1D298B5B0BFE50C5A7B1522C0CD33315B1
|
||||
5FC6F137F97E0EC5CE150B96AAE2D358116FF3CC0E6383BFC24B9572268E3DC7
|
||||
B0EFD1BA232CFF10F33DBC7F9FFB2290D31634F0F7F65B4B55C37FA103B7C347
|
||||
9E7DEB055882F7F3EC990775C51FDAF0307BAFDBA8C3628F38DBC5C64CCAFE8E
|
||||
82DFD703CB70DC1DC6E5068FBC7F91F5519FEBCE3F68832FFC6249707E4EF8E7
|
||||
C1501BBCA61BFF4607ACA3FD1F31E7FE4017BCC8F2D52666FBAB4A716A430BEB
|
||||
F15A947276B16774795827EDD3B9F82714F1A9E77EE008FE56AC196798CD7632
|
||||
EE7DCDF0BF57CD9383EDB09144B99664E04786DFC4F46A62DCFBC160CD3CE8C5
|
||||
71B4DFEEB21ED1542DCDC029BE4FCEF85FC762A3DFE0B795011767D082374AF9
|
||||
C182552C36E654E22F44BFB6D68D71C2A27D0249B73FABC93F55E3DBF025E3F8
|
||||
450F6EEC64F7FF51D96BA9A657A59CCE7CFFA14F8E9E60F9E12723BCB7E02FBF
|
||||
DA42FD5AD977249FDA5F25F6565E7FF1FFF6A0F512DBC724F99FE687C6B6609B
|
||||
D3C33C7E5E37F53881B5B2180BBCFFA2B83844FE51C5157BB287594C918CCA9C
|
||||
F79DDF01AF53CF28F590797C9FAFA82FF69BE7EC131573F944D91E8405836367
|
||||
617D35B6A35E11E75EF0FA86E2E4111B4E624CFDEC700B7F8BDCF2501E4FFB42
|
||||
BCD686F0E18EB2D8519749D4EF7D4DF1BB58AC832E4B7C92E51E8EBD443A7BF5
|
||||
783A84B8E5EC71620EA19CE6E435D48DF6E3AAE1682AA99058162C12FBC6F900
|
||||
5EE7690C8D35B0BFD0AC1CD338D6404F941735B93EA06FAB77ED90F47751DDE7
|
||||
8DA29ECF8E7ACE35AEF36729BEF2B9EFDE24CEDE39B5CD820D719EBFC39AF937
|
||||
C7A7B36322CFB419DEBB2DE148E796CE8AFD84DD46B9C070CAF071DDE37C6746
|
||||
3F18E66209A7B41E6D878D6EDF66125BC661EB92D87D2F9D9B8BDDF7525D89DD
|
||||
F71E752D56DF3F811FB3EF65FCB87D2FE3C7ED7B093F76DF97E127E07B8E9F84
|
||||
EF9338872F732CF03C877EE94DD77C4F973C02BE3E5E9B4C7A04000000240000
|
||||
0024000000320700000000000078DAED5B696C1555143E7523EEC644C57DDF12
|
||||
51E25A8DA0C56A1434D1A8D144127FB80497180D182311537F18B71F46DC4254
|
||||
304AED7B33EF491A4C8D4225584583ADD0BEF6B5DA0AA881484250A0056C69EB
|
||||
39F3EEB467EE9B796FA673EF6D85F971D2DB7977F9E6DEB39F3BC3C3C3309CD0
|
||||
98A9DD8261D5B43FE251B9D7091EB378C6CA2B070A9E847F127E0E58BB29CABC
|
||||
63C5E3434D516D836E5B18F56C74F14F8227FAFCA5F8D83035E9F271E2F8462A
|
||||
CF44C5592678123C099E486BF9E9B77FF3699899E049F847179E0964BF26947D
|
||||
4FE8FF4D1D167CA1841FD2D0D19A85D326588EAE3B2E2677AE0E1BE6A24EAF8E
|
||||
4A0CCB5E1598DCF97236DC186B7C069EC2BFBBC4FF1B3BEBE0AC71C583E3718F
|
||||
A7C5C5A4128F231F3131A9C61317930E3C7130A9C2E3279F1D6998D7E1CA1DEA
|
||||
27937854E5EAE3E289A2DF4DE0294734EF0181A7060ECAA7A032978639C89BCF
|
||||
E1393D8A3AF94AFCA9C22C1EA868B7E161ECF347005FFC86B2F580093CCDCBE1
|
||||
08FC2D2BDB70DC9B35481BF873DCB7A5F8EC307D78A0029FA547D6B4E1E3B62C
|
||||
9CC3FBB45A7021EF83FBF4912E3CB8FEFDCCD77AA68CCCBFE8F6E571A84A3C39
|
||||
0B72E2372BE43C5F3AF358F0836A3CF90C9C3FF2BE29B83CCC3C6D16DC20C60C
|
||||
75D5C1294AF1A4E14E871F2CF8A79C3CBBB46A151C8263FAC59955ABC483FCF2
|
||||
A078BE29A22DDB26F8ED6EC5FB33533CDFE327C3013C7D14F61F1472364D259E
|
||||
9F2D3801E7DF27F87356A87946E5712F61532EEF167C25F0B47437C0A45273B4
|
||||
7E024762DF4E3197AD45FFA4E02A778F688D35161C1E744E480D826F06DBB350
|
||||
A5CB5EA00D98C76CC22FB8570FE5EAE074E2A97C16CE24DB2ADB0DC79E597086
|
||||
2E7B8A6B525C3550C6D71A08C244FB2C9EF5AAF237C84EA1CC7C8AFD7648EB6E
|
||||
279BD592828BB1DD1884C9F14D2CB859B53F46E7D496818B50175F4B1849074A
|
||||
BEC04A09D326EC77B6C9F8CBC73F898549B5BF1A17930EFF59606A2C2577BAF2
|
||||
2D45316006AE2981A99DFC70D377B4502F3E128069A87B291C63245F374ABD5C
|
||||
B605A60C521F9EC1CBFB73EE13F5CE15F89EBF13517B02DC4FAC65E7523BDE78
|
||||
902F968DE8076C1B59136360E4F10F5D19898287C6D0D8421C1D53872D824371
|
||||
9D97B8ADA698212C1E165F38F61EFD821A6EDF22E670C8F7FD46965D94CF9BC2
|
||||
E2A1BE3EB2DF48BE63142CA49F7C6A50031473CAB14EE9F3820A11A7CABED0B7
|
||||
5DF57074383C5081FDEB8BEC8CD0F963E1671A4B7378720D4EDFF2711CC6044F
|
||||
7BCEC782AEF5169C1A57BE709EC964ABA4B99F2C2947E807537CC5C6FCC5E3DC
|
||||
B8F24EEF85FDB6B2F9F7947A57E4BFF7B99D437FE316D5FA07D7B88DE66676F6
|
||||
5DBF7E181B9C4C357A86C7D6A50FF9185A33F7199CE4C3378FF3BDC9A7E0126D
|
||||
783270A994479BE36387B84FF2936E7B41312E1BB742CE93922FC2F0CED78D07
|
||||
F96601F78FB8EC535C29C9E1ADA1F1A461317B8FC511DE63165F93CB1962ADF2
|
||||
9C670ACE8D6057CEC3B95713513BEC389E6F13F9AAE92CB753EDF90D654DB7CF
|
||||
40F554C9BFAEF28BEF9DFD41BDA81B4F118FB07C15EEF3540F1E1BAE3350E3BF
|
||||
9EAF89BEC994117BDE0093DCBC63903ED0E0573EC6F0F4CB3940965B0EAD9B63
|
||||
FADD36D313391FBBF206B773EB96C171BAB0345B702CEEC76EA65F5E2FC29B82
|
||||
CB24FE7A5EDBDED8F082875FD17E04F05833EBB7C3CFCE29E063F28376B275D6
|
||||
86A94BB976C5B2E0605558682EB7A611E48FFBF059BDA4A7DE0C5B1F08E107BF
|
||||
5DECB396D19B9FC3894575BF347C10679F28C6E176CECD47518E3D14BF15F2CC
|
||||
BBA5F16B83F8AE0CBF4C95F892A82F6C8D88D9B4E938EE6F691ED299B541B186
|
||||
677C0A2A715FEB7C629DEDA49BC798BB9822C7298CB610368A3971DD27889C76
|
||||
21BFB025604C4F58BF3388A82680FAE2555627180B518D6711AFA9C4F60F28FF
|
||||
6DC17BE4CB45C98B51FCD099820B74EA7A94D3BBF06C16E27A3F929C085F9768
|
||||
23D54A51A7BC45F544EA9BDC574CC834095F9FEE646C2E212B940758497ACE00
|
||||
96BEB032ECE8A1B4B7FEA8D86FCC8A7536A00CCF0EAC4158700FD9306197576B
|
||||
C4B359F8F0B343C4B877B8BE9AEE7BF4616A4B1407A9AA69508D242E1E11C3F5
|
||||
EBFC2E3F6AED8D62FB58B5301BE6AAC4A3FB6E5D82271A1EE4FB19EC0EAE51E2
|
||||
7549170FB6978CE3F729DB7CF0F408FDB850456D39E4FD7FB736BF9CE31139E8
|
||||
02568C790CD6187F1576E8598E87DD67EAA5DA97A16F4F26B37B7B951E3CE87B
|
||||
0BBEFADAD8B73036DCEBC6889493F27C9B60419B888F1718ABBF16E202A74EC7
|
||||
E5BDB560BB074DEA22B1FE7A213F351EFD9386F96E7D83EE0F98C022F264FB04
|
||||
8FCCF0DCD5B09D589BDADF19AC95BB39FA7EB7A6CA723179D17EC5D859611C2E
|
||||
DFB7657806FCEE066BE69DEF85FCBC1670B76650675EB5284F21EA7F283FB707
|
||||
E059676C6F466B3843C8CBC7FBE1A13C80C16F02DDFBE3AD4177A128A631285B
|
||||
2B845CBF1384C7449D89DDD3DE29E4E8BE007FEC4F836775B5BBAE5CDF67F2DE
|
||||
62CADF6136ABC7C85DBAF0B4C407CFD671C2B2CBB5590985A7FF007EAB7B3C4C
|
||||
7A0400000030000000300000008F0800000000000078DAED9D698C154510800B
|
||||
54BCF18A1AEFFBBEAF3F080663143CF0E09707C478A046D47824266034E01995
|
||||
8488318A3F1415D87D336F178951345189281B625605F60249E4501005D1E02E
|
||||
F05C96B56ADE2CF4F6D41CAFDF4C4F3FE81F95DD7D6F8EAF7BAAABAAABAB677B
|
||||
7B7BA1D78AF1D2EA40AF4EB1FCBB2FBF0E1DB5FC96DFF2677FED34ED8CE5DFF3
|
||||
F8EDF8B5FC76FC9AC3DF528097F1FC6E957BA6C9CF4837B125E8E792EED8B682
|
||||
BE28A511E7E739C74B43CF75DB1FCB6F2E7F127B63A874FBECA51A64DF698F6A
|
||||
985D9B5DD465672DBFE5B7FC967F4FE38F89010271BF69FC78EFCE18DFD469FB
|
||||
DFEABFE5DFBDF9ED1C403F7BADCF1F6D6D81152B6A79E82AE5D7F67AB834431F
|
||||
A1C3AEFE95551B34DAC14CDA90555C11D286BF5BEBE18A1AE4DF98551B74F0B7
|
||||
397071566DD0C14F7F67D5065DFC59B541277F166DD0CD9F761BF2E027215F40
|
||||
3E41F40F6D45B8C470FB1F27AB0CE22FE9585BC98A5F352E34B15E264B06CB6F
|
||||
F9F3E0477F73516B015EC0F316A1AC43F9CFFFB9C8FB1CBF37911F7DE7E9288D
|
||||
78FC8E185B42DF37D0F1A6F063BF8EF07C7D65367133B6E1E6BCF9DB5CB81E39
|
||||
B60BC7F7B4BA301BDB34AABD018E699E0EFBD04F62C5CFEABCEF77C5FFDBE9FC
|
||||
BCF87D9DF947E0F9252E5659EAC065749C18A3B5D4C36979F0931E8BEC4B1AE1
|
||||
A824D7A6E3A4361475F37B7666D758EDA9348740CF41D0A51D2D45B8502B7FD9
|
||||
46968F417D57B1EFF80CEA85FB4CD6CA5FB6EFE56370AC2AF1BB708BA07F4D9A
|
||||
F9D7F77DDF321B8E56E15F5607C70AF759AB99BF24F4DD2015FE159FC1BE51B5
|
||||
A919F3FFDEF73DD97715FEC50E1C27F4C16F79E97F9C1F0D93F602DC9A9BFEBB
|
||||
F0BC307EEB6ACDFE90BDAEC6FEE3F997E769FFABF5BF78CECA3CFD6F5FFC23C6
|
||||
9DD406F2AB09FA7D65BF3C6E01E6CC9F0F7B47D8B892D6F813C703F926B2EF64
|
||||
5BE9278D555FDF7BB878BAC58582DC063F57B155659D5743FC9FA80DBAE69E14
|
||||
03931E279C7FB9FE5C2DB336A88E1DDF2E4D267B4E3181AFC3F473217D8EE3E3
|
||||
023ACE71602FD48B99216D7469DE63FA7EAF2CDBA02B7F92551B74E67FB26883
|
||||
EEFC55DA6DC823FF96661BF2CA1F92ED241BCAB5017DE21B06D60F04EAA822DA
|
||||
F0AF61F51B6C7D70441BDA0CAA9F89AD63F3DA508069784C174A2BC57EB6B629
|
||||
617EAA014EC5B8EE2D12FABD96D89B1CD89FEAABC45A2BFAAC666ACF5C18C2C4
|
||||
95436A887F38C33FDC14BE8E4638A2AD08E7F54E828155F3E335E85A744D4DFE
|
||||
7DA2E01B162EF9100E54E5A773FD798137C745FF3A81EE9105BBBF56D114B0DF
|
||||
0518A7CA4FE732FE6061D87A8632BB0BD790EF66FD4F01C657C13F3E6C6D2CAD
|
||||
F1827D3E12654BC87D5A7F9A0387AAF2D3B9748D906B77E139D755CB8ED7D9C6
|
||||
CDC1F199BCCDE97EA5E397AE8163EA9D9079FF56D53620FB8978FE26AEDE346A
|
||||
CD50D57EB617E08690FB6D6CA983132A8DC1F1BCEF02F1B7037F26593F57B5FF
|
||||
7EFDD806A60D0B2AC9A9E0759E63FB9D6C7EC6FE8BF22BDC736871E099A4BE89
|
||||
C6BF7C3EE5FF74F95F3C76343777F9D1812313F4FD6BCCB96FEA8E1FBCD835C8
|
||||
F14A82BEEF92F566C54C18AC9BDFB7ADB21E7562FF1E1ED1E671CC9C79425EF1
|
||||
1BE97CE03A05B83762CE3B4FF621CBE6C2C179F1D3BD657DC0367D1AF1BCE439
|
||||
7B31EFF899C9536F6B76E0909018478E6DEEC89B1FF5650CC3757592588A7CB0
|
||||
62BC378C1947C394E7D1C131F010D3CE6912FB96B0F949EC3D67C161920FD94C
|
||||
9F29C561C8407190D4FF5399B1FBB1C4BFB4CA989B9EC19724AA7D2FB0B54A6C
|
||||
8DCC3173A5E7F4BD31F369077E88E397C7399D63D07EE5C5722E9A39C651CD35
|
||||
6AE0EF90FABF9EB13F530376B6CA35B434841864BF84B6660A33DEEE09C49CF5
|
||||
707EEEBA5F5ECF94EDFFDD21F57472CC7D5FEEBAE3C2FD4CBF066A4556BE0FFB
|
||||
05EC2CDA3E0374FF2B794E4CAC21C7BAD2B13D4B1AE0F8BCD8A93E4BAAADF0D6
|
||||
E793D4030ABAF66A8E7B90A7303CA32262BD41D2DE25EF7975D4C1C9B9AC1F04
|
||||
73371BE26C223767E0FC5DB60203E47826E95CCA5F7B58C53CB72734DA9CA7B9
|
||||
FDE6CD9FC0010963AFBBD8753607AECD9ADDCF576E6774E0CEAA9F1FC6D495E4
|
||||
5114E2B4DB181BEEEB2F0CA8A83676260C96E30E61CFC1A3955E2FAEBFD0D63C
|
||||
C6F53BC5612A73702FB7EAC0591175615FA791A76F2FC21978ADF921F7D8D451
|
||||
0F67563596CA75FEEBD87A04D427CA1D633BCE51D0F373F11AD3397DE9ABE7E6
|
||||
6A42159FC32978BDE551356DA8BBDFA08D7A16E54A2EAF4E9F21F350EF180716
|
||||
C4D4C92D4FDBE778B939DA9793BC2EA0CBB7C3AB989C5E94CCCA722DCFCFD3AF
|
||||
CEA00E622DD91F1DFE05F5E0209447F09E3FA7C0BD1C9FEBC3616B3999CA2418
|
||||
88F1E04DA8D31F20C79A0A98D7D039D8DF37AAE668B25A6345A6B1E81F9EF262
|
||||
47176690E0DFAF7B9FE17769AF8D5AB162C58A01B66FA8BF9F657D821AFE0D5E
|
||||
6ED985DBD38DA395D99F4CC0CCEF9928C07BB9E687305E0CDB93925814D79952
|
||||
CA6F35887392A545383B4E2728A745FD2E9CF7458EFC7FF471D07C2B711CDA00
|
||||
2799F09E4951772A89A5FC1A155D35D2A52CEAE475BE3BD4E4F78454B987D1F2
|
||||
5B7ECB2F1D5303EF25EEFBFF35017E3FF7590BEF54EE0C791FE1C85A78073472
|
||||
36B3FC2EBC1455EB916BAC2CB171FCF8FBB7C27ADF68C3C6743F3699DF7F2746
|
||||
5F4E7847D23DF93A846393F9DB0B7095F059BB497DCFB1C9FCD2FAE374A3F6D5
|
||||
306C323FFEFC5C981B8E314CF7036C223FED3D11EBD654EBF7B2DA7BC3B1F59B
|
||||
8B97DF2DB133476C94EE84B0C96BD4C25AF74746E94E089BBCCE2AFCFE8061F9
|
||||
29964DF2C93BE7F22A6B8A19D743B06C61F93513F26AD25A2BCB16C2DF6058CC
|
||||
F360181BCBEFC2E346D91EF19D04121BC71FF70E9F1CFCD6EA30366E9F4C5AEF
|
||||
B04925E6E99FE70BB031FCF30C8B79C646B131F9F08946E98E0BEF46B1A5B5CF
|
||||
4047ED33C726D73C87D586E621B45F4D585761D9E47D8686EDA31F1DC726C53F
|
||||
2F1A16B34D8D63AB99FF9755801135CCDF1DB687116D5293FD3F6556F654F91F
|
||||
7254797C
|
||||
}
|
||||
end
|
||||
end
|
98
components/gridprinter/examples/actions/main.pas
Normal file
98
components/gridprinter/examples/actions/main.pas
Normal file
@ -0,0 +1,98 @@
|
||||
unit main;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Grids, ExtCtrls,
|
||||
StdCtrls, ActnList, Menus, ComCtrls, StdActns, GridPrn, GridPrnActions,
|
||||
GridPrnPreviewDlg;
|
||||
|
||||
type
|
||||
|
||||
{ TMainForm }
|
||||
|
||||
TMainForm = class(TForm)
|
||||
ActionList1: TActionList;
|
||||
FileExit1: TFileExit;
|
||||
FileOpen1: TFileOpen;
|
||||
GridPrinter1: TGridPrinter;
|
||||
GridPrinterAction1: TGridPrinterAction;
|
||||
GridPrintPreviewAction1: TGridPrintPreviewAction;
|
||||
GridPrintPreviewDialog1: TGridPrintPreviewDialog;
|
||||
ImageList1: TImageList;
|
||||
MainMenu1: TMainMenu;
|
||||
MenuItem1: TMenuItem;
|
||||
MenuItem2: TMenuItem;
|
||||
MenuItem3: TMenuItem;
|
||||
MenuItem4: TMenuItem;
|
||||
Separator2: TMenuItem;
|
||||
MenuItem6: TMenuItem;
|
||||
Separator1: TMenuItem;
|
||||
StringGrid1: TStringGrid;
|
||||
ToolBar1: TToolBar;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
ToolButton3: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ToolButton5: TToolButton;
|
||||
ToolButton6: TToolButton;
|
||||
procedure FileOpen1Accept(Sender: TObject);
|
||||
private
|
||||
|
||||
public
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
MainForm: TMainForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
// Auxiliary code to adjust the grid's column widths to the cell text.
|
||||
procedure AutoAdjustColWidths(AGrid: TStringGrid);
|
||||
var
|
||||
r, c: Integer;
|
||||
w, wmax: Integer;
|
||||
bmp: TBitmap;
|
||||
s: String;
|
||||
begin
|
||||
bmp := TBitmap.Create;
|
||||
try
|
||||
bmp.SetSize(1, 1);
|
||||
bmp.Canvas.Font.Assign(AGrid.Font);
|
||||
for c := 0 to AGrid.ColCount-1 do
|
||||
begin
|
||||
wmax := 0;
|
||||
for r := 0 to AGrid.RowCount-1 do
|
||||
begin
|
||||
s := AGrid.Cells[c, r];
|
||||
AGrid.Cells[c, r] := trim(s);
|
||||
w := bmp.Canvas.TextWidth(AGrid.Cells[c, r]);
|
||||
if w > wmax then wmax := w;
|
||||
end;
|
||||
AGrid.ColWidths[c] := wmax + 2*varCellPadding;
|
||||
end;
|
||||
finally
|
||||
bmp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
{ TMainForm }
|
||||
|
||||
procedure TMainForm.FileOpen1Accept(Sender: TObject);
|
||||
begin
|
||||
// Load a csv data file
|
||||
StringGrid1.LoadFromCSVFile(FileOpen1.Dialog.FileName);
|
||||
// Adjust the grid column widths
|
||||
AutoAdjustColWidths(StringGrid1);
|
||||
// The grid was hidden after creation. It must be shown after loading data.
|
||||
StringGrid1.Show;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
42
components/gridprinter/examples/actions/pollution.csv
Normal file
42
components/gridprinter/examples/actions/pollution.csv
Normal file
@ -0,0 +1,42 @@
|
||||
"City", "SO2 mg/cm", "Temp F", "Manufacturing Plants", "1970 Pop", "Wind mph", "Precip inches", "Precip days"
|
||||
"Albuquerque", 11, 56.8, 46, 244, 8.9, 7.77, 58
|
||||
"Albany", 46, 47.6, 44, 116, 8.8, 33.36, 135
|
||||
"Atlanta", 24, 61.5, 368, 497, 9.1, 48.34, 115
|
||||
"Baltimore", 47, 55.0, 625, 905, 9.6, 41.31, 111
|
||||
"Buffalo", 11, 47.1, 391, 463, 12.4, 36.11, 166
|
||||
"Charleston", 31, 55.2, 35, 71, 6.5, 40.75, 148
|
||||
"Chicago", 110, 50.6, 3344, 3369, 10.4, 34.44, 122
|
||||
"Cincinnati", 23, 54.0, 462, 453, 7.1, 39.04, 132
|
||||
"Cleveland", 65, 49.7, 1007, 751, 10.9, 34.99, 155
|
||||
"Columbus", 26, 51.5, 266, 540, 8.6, 37.01, 134
|
||||
"Dallas", 9, 66.2, 641, 844, 10.9, 35.94, 78
|
||||
"Denver", 17, 51.9, 454, 515, 9.0, 12.95, 86
|
||||
"DesMoines", 17, 49.0, 104, 201, 11.2, 30.85, 103
|
||||
"Detroit", 35, 49.9, 1064, 1513, 10.1, 30.96, 129
|
||||
"Hartford", 56, 49.1, 412, 158, 9.0, 43.37, 127
|
||||
"Houston", 10, 68.9, 721, 1233, 10.8, 48.19, 103
|
||||
"Indianapolis", 28, 52.3, 361, 746, 9.7, 38.74, 121
|
||||
"Jacksonville", 14, 68.4, 136, 529, 8.8, 54.47, 116
|
||||
"KansasCity", 14, 54.5, 381, 507, 10.0, 37.00, 99
|
||||
"LittleRock", 13, 61.0, 91, 132, 8.2, 48.52, 100
|
||||
"Louisville", 30, 55.6, 291, 593, 8.3, 43.11, 123
|
||||
"Memphis", 10, 61.6, 337, 624, 9.2, 49.10, 105
|
||||
"Miami", 10, 75.5, 207, 335, 9.0, 59.80, 128
|
||||
"Milwaukee", 16, 45.7, 569, 717, 11.8, 29.07, 123
|
||||
"Minneapolis", 29, 43.5, 699, 744, 10.6, 25.94, 137
|
||||
"Nashville", 18, 59.4, 275, 448, 7.9, 46.00, 119
|
||||
"NewOrleans", 9, 68.3, 204, 361, 8.4, 56.77, 113
|
||||
"Norfork", 31, 59.3, 96, 308, 10.6, 44.68, 116
|
||||
"Omaha", 14, 51.5, 181, 347, 10.9, 30.18, 98
|
||||
"Philadelphia", 69, 54.6, 1692, 1950, 9.6, 39.93, 115
|
||||
"Phoenix", 10, 70.3, 213, 582, 6.0, 7.05, 36
|
||||
"Pittsburgh", 61, 50.4, 347, 520, 9.4, 36.22, 147
|
||||
"Providence", 94, 50.0, 343, 179, 10.6, 42.75, 125
|
||||
"Richmond", 26, 57.8, 197, 299, 7.6, 42.59, 115
|
||||
"SaltLakeCity", 28, 51.0, 137, 176, 8.7, 15.17, 89
|
||||
"SanFrancisco", 12, 56.7, 453, 716, 8.7, 20.66, 67
|
||||
"Seattle", 29, 51.1, 379, 531, 9.4, 38.79, 164
|
||||
"StLouis", 56, 55.9, 775, 622, 9.5, 35.89, 105
|
||||
"WashingtonDC", 29, 57.3, 434, 757, 9.3, 38.89, 111
|
||||
"Wilmington", 36, 54.0, 80, 80, 9.0, 40.25, 114
|
||||
"Wichita", 8, 56.6, 125, 277, 12.7, 30.58, 82
|
|
6
components/gridprinter/examples/actions/readme.txt
Normal file
6
components/gridprinter/examples/actions/readme.txt
Normal file
@ -0,0 +1,6 @@
|
||||
The project "gridprinteractions_demo" shows that, using the GridPrinter standard
|
||||
actions, it is possible to print a grid without having to write a single line
|
||||
of code.
|
||||
|
||||
The sample csv file, pollution.csv, is taken from
|
||||
https://people.math.sc.edu/Burkardt/datasets/csv/csv.html (license GNU LPGL).
|
@ -69,6 +69,7 @@ object MainForm: TMainForm
|
||||
'RSNoPrinterDialog'
|
||||
'RSPageSetupDialog'
|
||||
'RSPrinterDialog'
|
||||
'RSPrinterSetupDialog'
|
||||
)
|
||||
Style = csDropDownList
|
||||
TabOrder = 3
|
||||
@ -146,7 +147,6 @@ object MainForm: TMainForm
|
||||
Footer.Font.Height = -11
|
||||
Header.Font.Height = -11
|
||||
Header.Text = 'test||'
|
||||
Orientation = poLandscape
|
||||
Left = 168
|
||||
Top = 96
|
||||
end
|
||||
|
@ -54,8 +54,9 @@ uses
|
||||
|
||||
resourcestring
|
||||
RSNoPrinterDialog = 'No printer dialog';
|
||||
RSPageSetupDialog = 'Page-setup dialog';
|
||||
RSPageSetupDialog = 'Page setup dialog';
|
||||
RSPrinterDialog = 'Printer dialog';
|
||||
RSPrinterSetupDialog = 'Printer setup dialog';
|
||||
|
||||
RSNavigationButtons = 'Navigation buttons';
|
||||
RSNavigationEdit = 'Navigation edit';
|
||||
@ -70,11 +71,7 @@ resourcestring
|
||||
|
||||
procedure TMainForm.btnPrintClick(Sender: TObject);
|
||||
begin
|
||||
case cmbDialogs.ItemIndex of
|
||||
0: GridPrinter1.PrintDialogs := gpdNone;
|
||||
1: GridPrinter1.PrintDialogs := gpdPageSetup;
|
||||
2: GridPrinter1.PrintDialogs := gpdPrintDialog;
|
||||
end;
|
||||
GridPrinter1.ShowPrintDialog := TGridPrnDialog(cmbDialogs.ItemIndex);
|
||||
GridPrinter1.Print;
|
||||
end;
|
||||
|
||||
@ -204,6 +201,7 @@ begin
|
||||
cmbDialogs.Items[0] := RSNoPrinterDialog;
|
||||
cmbDialogs.Items[1] := RSPageSetupDialog;
|
||||
cmbDialogs.Items[2] := RSPrinterDialog;
|
||||
cmbDialogs.Items[3] := RSPrinterSetupDialog;
|
||||
cmbDialogs.ItemIndex := idx1;
|
||||
|
||||
// ... and of the preview dialog options check combobox.
|
||||
|
20
components/gridprinter/examples/readme.txt
Normal file
20
components/gridprinter/examples/readme.txt
Normal file
@ -0,0 +1,20 @@
|
||||
The folder "examples" of the GridPrinter installation contains several sample
|
||||
projects to demonstrate basic features of the TGridPrinter and the
|
||||
TGridPrintPreviewDialog:
|
||||
|
||||
- "stringgrid" - how to print a stringgrid
|
||||
- "stringgrid_formatted" - like "stringgrid" sample, but the stringgrid here
|
||||
has extra formatting due to the OnPrepareCanvas event handler.
|
||||
- "dbgrid" - how to print a DBGrid
|
||||
- "multi-language" - like "stringgrid" sample, but now as a multi-language
|
||||
application. Additional translations are welcome.
|
||||
- "actions" - demonstrates application of the GridPrinter standard actions in
|
||||
printing and previewing a stringgrid without writing a single line of code.
|
||||
|
||||
Data used in the grids are auto-generated dummy data.
|
||||
The csv data file in the "actions" folder is taken from
|
||||
https://people.math.sc.edu/Burkardt/datasets/csv/csv.html (license GNU LGPL).
|
||||
|
||||
Icons used in the demo are from the Lazarus "general-purpose" images, provided
|
||||
by Roland Hahn (license: Creative Commons CC0 1.0 Universal, freely available,
|
||||
no restrictions in usage).
|
@ -12,7 +12,7 @@
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
</CompilerOptions>
|
||||
<Files Count="6">
|
||||
<Files Count="7">
|
||||
<Item1>
|
||||
<Filename Value="source\gridprnheaderfooterform.pas"/>
|
||||
<UnitName Value="GridPrnHeaderFooterForm"/>
|
||||
@ -38,6 +38,10 @@
|
||||
<Filename Value="source\gridprnstrings.pas"/>
|
||||
<UnitName Value="GridPrnStrings"/>
|
||||
</Item6>
|
||||
<Item7>
|
||||
<Filename Value="source\gridprnactions.pas"/>
|
||||
<UnitName Value="GridPrnActions"/>
|
||||
</Item7>
|
||||
</Files>
|
||||
<CompatibilityMode Value="True"/>
|
||||
<i18n>
|
||||
|
@ -9,7 +9,7 @@ interface
|
||||
|
||||
uses
|
||||
GridPrnHeaderFooterForm, GridPrn, GridPrnPreviewForm, GridPrnReg,
|
||||
GridPrnPreviewDlg, GridPrnStrings, LazarusPackageIntf;
|
||||
GridPrnPreviewDlg, GridPrnStrings, GridPrnActions, LazarusPackageIntf;
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -108,10 +108,23 @@ msgstr ""
|
||||
"Seiten zuerst entlang der Spalten von oben nach unten,\n"
|
||||
"dann von links nach rechts drucken"
|
||||
|
||||
#: gridprnstrings.rsprintellipsis
|
||||
msgid "Print..."
|
||||
msgstr "Drucken..."
|
||||
|
||||
#: gridprnstrings.rsprintgrid
|
||||
msgid "Print grid"
|
||||
msgstr "Tabelle drucken"
|
||||
|
||||
#: gridprnstrings.rsprintpreview
|
||||
msgid "Print Preview"
|
||||
msgstr "Druckvorschau"
|
||||
|
||||
#: gridprnstrings.rsprintpreviewellipsis
|
||||
msgctxt "gridprnstrings.rsprintpreviewellipsis"
|
||||
msgid "Preview..."
|
||||
msgstr "Druckvorschau..."
|
||||
|
||||
#: gridprnstrings.rsprintrowsfirst
|
||||
msgid ""
|
||||
"First print rows from left to right,\n"
|
||||
|
@ -108,10 +108,23 @@ msgstr ""
|
||||
"First print columns from top to bottom,\n"
|
||||
"then print from left to right"
|
||||
|
||||
#: gridprnstrings.rsprintellipsis
|
||||
msgid "Print..."
|
||||
msgstr "Print..."
|
||||
|
||||
#: gridprnstrings.rsprintgrid
|
||||
msgid "Print grid"
|
||||
msgstr "Print grid"
|
||||
|
||||
#: gridprnstrings.rsprintpreview
|
||||
msgid "Print Preview"
|
||||
msgstr "Print Preview"
|
||||
|
||||
#: gridprnstrings.rsprintpreviewellipsis
|
||||
msgctxt "gridprnstrings.rsprintpreviewellipsis"
|
||||
msgid "Preview..."
|
||||
msgstr "Preview..."
|
||||
|
||||
#: gridprnstrings.rsprintrowsfirst
|
||||
msgid ""
|
||||
"First print rows from left to right,\n"
|
||||
|
@ -88,10 +88,23 @@ msgid ""
|
||||
"then print from left to right"
|
||||
msgstr ""
|
||||
|
||||
#: gridprnstrings.rsprintellipsis
|
||||
msgid "Print..."
|
||||
msgstr ""
|
||||
|
||||
#: gridprnstrings.rsprintgrid
|
||||
msgid "Print grid"
|
||||
msgstr ""
|
||||
|
||||
#: gridprnstrings.rsprintpreview
|
||||
msgid "Print Preview"
|
||||
msgstr ""
|
||||
|
||||
#: gridprnstrings.rsprintpreviewellipsis
|
||||
msgctxt "gridprnstrings.rsprintpreviewellipsis"
|
||||
msgid "Preview..."
|
||||
msgstr ""
|
||||
|
||||
#: gridprnstrings.rsprintrowsfirst
|
||||
msgid ""
|
||||
"First print rows from left to right,\n"
|
||||
|
@ -36,13 +36,17 @@ msgid "Page orientation buttons"
|
||||
msgstr "Schalter für Seitenausrichtung"
|
||||
|
||||
#: main.rspagesetupdialog
|
||||
msgid "Page-setup dialog"
|
||||
msgstr "Seiteneinrichtungs-Dialog"
|
||||
msgid "Page setup dialog"
|
||||
msgstr "Seiteneinrichtungsdialog"
|
||||
|
||||
#: main.rsprinterdialog
|
||||
msgid "Printer dialog"
|
||||
msgstr "Drucker-Dialog"
|
||||
|
||||
#: main.rsprintersetupdialog
|
||||
msgid "Printer setup dialog"
|
||||
msgstr "Druckereinrichtungsdialog"
|
||||
|
||||
#: main.rsprintorderbuttons
|
||||
msgid "Print order: colums first or rows first"
|
||||
msgstr "Druckreihenfolge: Spalten oder Zeilen zuerst"
|
||||
@ -66,4 +70,3 @@ msgstr "Mehrsprachige Demonstration von TGridPrinter"
|
||||
#: tmainform.label1.caption
|
||||
msgid "Language:"
|
||||
msgstr "Sprache:"
|
||||
|
||||
|
@ -36,13 +36,17 @@ msgid "Page orientation buttons"
|
||||
msgstr "Page orientation buttons"
|
||||
|
||||
#: main.rspagesetupdialog
|
||||
msgid "Page-setup dialog"
|
||||
msgstr "Page-setup dialog"
|
||||
msgid "Page setup dialog"
|
||||
msgstr "Page setup dialog"
|
||||
|
||||
#: main.rsprinterdialog
|
||||
msgid "Printer dialog"
|
||||
msgstr "Printer dialog"
|
||||
|
||||
#: main.rsprintersetupdialog
|
||||
msgid "Printer setup dialog"
|
||||
msgstr "Printer setup dialog"
|
||||
|
||||
#: main.rsprintorderbuttons
|
||||
msgid "Print order: colums first or rows first"
|
||||
msgstr "Print order: colums first or rows first"
|
||||
@ -66,4 +70,3 @@ msgstr "Multi-Language Demonstration of TGridPrinter"
|
||||
#: tmainform.label1.caption
|
||||
msgid "Language:"
|
||||
msgstr "Language:"
|
||||
|
||||
|
@ -26,13 +26,17 @@ msgid "Page orientation buttons"
|
||||
msgstr ""
|
||||
|
||||
#: main.rspagesetupdialog
|
||||
msgid "Page-setup dialog"
|
||||
msgid "Page setup dialog"
|
||||
msgstr ""
|
||||
|
||||
#: main.rsprinterdialog
|
||||
msgid "Printer dialog"
|
||||
msgstr ""
|
||||
|
||||
#: main.rsprintersetupdialog
|
||||
msgid "Printer setup dialog"
|
||||
msgstr ""
|
||||
|
||||
#: main.rsprintorderbuttons
|
||||
msgid "Print order: colums first or rows first"
|
||||
msgstr ""
|
||||
|
@ -10,7 +10,7 @@ uses
|
||||
type
|
||||
TGridPrinter = class; // forward declaration
|
||||
|
||||
TGridPrnDialog = (gpdNone, gpdPageSetup, gpdPrintDialog);
|
||||
TGridPrnDialog = (gpdNone, gpdPageSetup, gpdPrintDialog, gpdPrinterSetup);
|
||||
|
||||
TGridPrnGetCellTextEvent = procedure (Sender: TObject; AGrid: TCustomGrid;
|
||||
ACol, ARow: Integer; var AText: String) of object;
|
||||
@ -889,6 +889,7 @@ procedure TGridPrinter.Print;
|
||||
var
|
||||
pageDlg: TPageSetupDialog;
|
||||
printDlg: TPrintDialog;
|
||||
prnSetupDlg: TPrinterSetupDialog;
|
||||
begin
|
||||
if FGrid = nil then
|
||||
exit;
|
||||
@ -945,6 +946,19 @@ begin
|
||||
printDlg.Free;
|
||||
end;
|
||||
end;
|
||||
gpdPrinterSetup:
|
||||
begin
|
||||
prnSetupDlg := TPrinterSetupDialog.Create(nil);
|
||||
try
|
||||
if prnSetupDlg.Execute then
|
||||
begin
|
||||
//
|
||||
end else
|
||||
exit;
|
||||
finally
|
||||
prnSetupDlg.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if Assigned(FOnBeforePrint) then
|
||||
|
165
components/gridprinter/source/gridprnactions.pas
Normal file
165
components/gridprinter/source/gridprnactions.pas
Normal file
@ -0,0 +1,165 @@
|
||||
unit GridPrnActions;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, ActnList,
|
||||
GridPrn, GridPrnPreviewDlg;
|
||||
|
||||
type
|
||||
TGridPrinterAction = class(TCustomAction)
|
||||
private
|
||||
FGridPrinter: TGridPrinter;
|
||||
procedure SetGridPrinter(const AValue: TGridPrinter);
|
||||
protected
|
||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
procedure ExecuteTarget(Target: TObject); override;
|
||||
function HandlesTarget(Target: TObject): Boolean; override;
|
||||
procedure UpdateTarget(Target: TObject); override;
|
||||
published
|
||||
property GridPrinter: TGridPrinter read FGridPrinter write SetGridPrinter;
|
||||
property Caption;
|
||||
property Enabled;
|
||||
property HelpContext;
|
||||
property HelpKeyword;
|
||||
property HelpType;
|
||||
property Hint;
|
||||
property ImageIndex;
|
||||
property OnExecute;
|
||||
property OnHint;
|
||||
property OnUpdate;
|
||||
property SecondaryShortCuts;
|
||||
property ShortCut;
|
||||
property Visible;
|
||||
end;
|
||||
|
||||
TGridPrintPreviewAction = class(TCustomAction)
|
||||
private
|
||||
FPreviewDlg: TGridPrintPreviewDialog;
|
||||
protected
|
||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
procedure ExecuteTarget(Target: TObject); override;
|
||||
function HandlesTarget(Target: TObject): Boolean; override;
|
||||
procedure UpdateTarget(Target: TObject); override;
|
||||
published
|
||||
property PreviewDialog: TGridPrintPreviewDialog read FPreviewDlg write FPreviewDlg;
|
||||
property Caption;
|
||||
property Enabled;
|
||||
property HelpContext;
|
||||
property HelpKeyword;
|
||||
property HelpType;
|
||||
property Hint;
|
||||
property ImageIndex;
|
||||
property OnExecute;
|
||||
property OnHint;
|
||||
property OnUpdate;
|
||||
property SecondaryShortCuts;
|
||||
property ShortCut;
|
||||
property Visible;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
Grids, GridPrnStrings;
|
||||
|
||||
constructor TGridPrinterAction.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
Caption := RSPrint;
|
||||
Hint := RSPrintGrid;
|
||||
end;
|
||||
|
||||
procedure TGridPrinterAction.ExecuteTarget(Target: TObject);
|
||||
begin
|
||||
if HandlesTarget(Target) then
|
||||
FGridPrinter.Print;
|
||||
end;
|
||||
|
||||
function TGridPrinterAction.HandlesTarget(Target: TObject): Boolean;
|
||||
begin
|
||||
Result := (Target <> nil) and (Target = FGridPrinter);
|
||||
end;
|
||||
|
||||
procedure TGridPrinterAction.Notification(AComponent: TComponent;
|
||||
Operation: TOperation);
|
||||
begin
|
||||
inherited Notification(AComponent, Operation);
|
||||
if (Operation = opRemove) and (AComponent = FGridPrinter) then
|
||||
FGridPrinter := nil;
|
||||
end;
|
||||
|
||||
procedure TGridPrinterAction.SetGridPrinter(const AValue: TGridPrinter);
|
||||
begin
|
||||
if FGridPrinter <> AValue then
|
||||
begin
|
||||
FGridPrinter := AValue;
|
||||
if FGridPrinter.ShowPrintDialog = gpdNone then
|
||||
Caption := RSPrint
|
||||
else
|
||||
Caption := RSPrintEllipsis;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGridPrinterAction.UpdateTarget(Target: TObject);
|
||||
var
|
||||
grid: TCustomGrid;
|
||||
begin
|
||||
if HandlesTarget(Target) then
|
||||
begin
|
||||
grid := (Target as TGridPrinter).Grid;
|
||||
Enabled := (grid <> nil) and grid.Visible;
|
||||
end else
|
||||
Enabled := false;
|
||||
end;
|
||||
|
||||
|
||||
{ TGridPrintPreviewAction }
|
||||
|
||||
constructor TGridPrintPreviewAction.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
Caption := RSPrintPreviewEllipsis;
|
||||
Hint := RSPrintPreview;
|
||||
end;
|
||||
|
||||
procedure TGridPrintPreviewAction.ExecuteTarget(Target: TObject);
|
||||
begin
|
||||
if HandlesTarget(Target) then
|
||||
FPreviewDlg.Execute;
|
||||
end;
|
||||
|
||||
function TGridPrintPreviewAction.HandlesTarget(Target: TObject): Boolean;
|
||||
begin
|
||||
Result := (Target <> nil) and (Target = FPreviewDlg);
|
||||
end;
|
||||
|
||||
procedure TGridPrintPreviewAction.Notification(AComponent: TComponent;
|
||||
Operation: TOperation);
|
||||
begin
|
||||
inherited Notification(AComponent, Operation);
|
||||
if (Operation = opRemove) and (AComponent = FPreviewDlg) then
|
||||
FPreviewDlg := nil;
|
||||
end;
|
||||
|
||||
procedure TGridPrintPreviewAction.UpdateTarget(Target: TObject);
|
||||
var
|
||||
grid: TCustomGrid;
|
||||
prn: TGridPrinter;
|
||||
begin
|
||||
if HandlesTarget(Target) then
|
||||
begin
|
||||
prn := (Target as TGridPrintPreviewDialog).GridPrinter;
|
||||
Enabled := (prn <> nil) and (prn.Grid <> nil) and prn.Grid.Visible;
|
||||
end else
|
||||
Enabled := false;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -12,13 +12,14 @@ procedure Register;
|
||||
implementation
|
||||
|
||||
uses
|
||||
GridPrn, GridPrnPreviewDlg;
|
||||
ActnList, GridPrn, GridPrnPreviewDlg, GridPrnActions;
|
||||
|
||||
{$R gridprinter_icons.res}
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
RegisterComponents('Misc', [TGridPrinter, TGridPrintPreviewDialog]);
|
||||
RegisterActions('GridPrinter', [TGridPrinterAction, TGridPrintPreviewAction], nil);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -61,6 +61,11 @@ resourcestring
|
||||
RSTextInCenteredSection = 'Text in centered section';
|
||||
RSTextInRightAlignedSection = 'Text in right-aligned section';
|
||||
|
||||
// Actions
|
||||
RSPrintEllipsis = 'Print...';
|
||||
RSPrintPreviewEllipsis = 'Preview...';
|
||||
RSPrintGrid = 'Print grid';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user