Initial commit of kcontrols

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1732 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-07-04 06:24:41 +00:00
parent 7e5e08146b
commit eb3ecee187
35 changed files with 36085 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,43 @@
Software: KControls component suite for Delphi and Lazarus
Original authorship: Tomas Krysl (tk@tkweb.eu)
-------------------
LICENSE:
-------------------
License information for each source file can be found in it's header.
If there is none, the code is public domain.
SYSTEM REQUIREMENTS:
-------------------
- platforms: Win32(98(SE)+), Win64(untested), GTK, GTK2, QT, Carbon(untested), WinCE(partially tested)
- works under Delphi 7 and higher (tested on Delphi 7, Delphi2007 till Delphi 2010)
and Lazarus 0.9.29(SVN#21827) and higher
- should work under Delphi 6
- some more problems might be experienced for older Lazarus versions
- see other readme files for additional informations about individual components
INSTALLATION:
-------------------
1. Compile and install package (it might be needed to specify some search paths in Delphi).
2. When compiling an application or demo, it might be needed to specify the search path to KControls sources
or JCL sources (if JCL is configured via kcontrols.inc).
PLANNED:
-------------------
- TKMemo - native Unicode enabled controls with rich text editing capabilities
TECHNICAL SUPPORT:
-------------------
Any suggestions, error reports and questions about this software please send to
the author or discuss on http://www.tkweb.eu.
VERSION HISTORY:
-------------------
Version 1.0 (October 2009):
Initial release - based on KGrid 1.5, KHexEditor 1.4, KIcon 1.8

View File

@ -0,0 +1,192 @@
Software: KGrid component for Delphi and Lazarus
Original authorship: Tomas Krysl (tk@tkweb.eu)
-------------------
LICENSE:
-------------------
License information for each source file can be found in it's header.
If there is none, the code is public domain.
SYSTEM REQUIREMENTS:
-------------------
- platforms: Win32(98(SE)+), Win64(untested), GTK, GTK2, QT, Carbon(untested), WinCE(untested)
- works under Delphi 7 and higher (tested on Delphi 7, Delphi2007 till Delphi 2010)
and Lazarus 0.9.29(SVN#21827) and higher
- should work under Delphi 6
- some more problems might be experienced for older Lazarus versions
INSTALLATION:
-------------------
1. Compile and install package (it might be needed to specify some search paths in Delphi).
2. Put the TKGrid component into your application instead of TStringGrid or TDrawGrid.
3. When compiling an application, it might be needed to specify the search path to KGrid sources
or JCL sources (if JCL is configured).
PLANNED:
-------------------
- filters (still a TODO, partially can be implemented now via editable fixed rows)
- multiple disjunct selections (like Excel, still a TODO)
- tree columns
KNOWN PROBLEMS:
-------------------
Delphi common:
-none, best performance
Lazarus common:
-KDBGrid demo does not draw unicode fields correctly for certain databases.
applies for all data aware controls, not just TKDBgrid
must be FPC/TWideStringField bug
-printing/Previewing works correctly in Win32 and Qt (for Lazarus versions with my implementation
of affine transformations for device contexts). For GTKx printing via TPostScriptPrinterCanvas,
there is no way to effectively implement affine transformations because this canvas is not implemented
via a device context mechanism.
Target specific:
Win32:
Delphi:
-none
-tested on Windows 98SE (some time ago), Windows XP 32bit, Windows Vista 32bit
Lazarus:
-transparent editor underpainting incorrect if TKGrid is placed onto TPageControl (LCL problem)
-tested on Windows XP 32bit
Win64: none
-untested, help appreciated!
WinCE:
-slow inplace editor performance (depending on device)
-tested partially, help appreciated!
GTK:
-bad check box painting, bad selected range color, drag window flickers, sometimes infinite painting,
sometimes clipping problems (all LCL/GTK problems)
-tested on Ubuntu Jaunty
GTK2:
-slightly slow inplace editor performance with huge grids (GTK2 problem)
-scrollbar arrows don't work correctly sometimes (GTK2 problem)
-tested on Ubuntu Jaunty
QT:
-slightly slow inplace editor performance with huge grids
-checkbox not transparent (cannot be solved)
-scrollbar arrows behave differently (cannot be solved)
-tested on QT4.5.2/Windows XP
Carbon:
-none
-untested, help appreciated!
TECHNICAL SUPPORT:
-------------------
Any suggestions, error reports and questions about this software please send to
the author or discuss on http://www.tkweb.eu.
CONTRIBUTORS:
-------------------
Gianluca Culot: idea for TKCustomGrid.OnChanged event
JR: some useful functions and ideas
aki: selectable fixed cells
VERSION HISTORY
-------------------
Version 1.7 (November 2010):
Added:
-Windows Vista/7 style selection,
-selectable and editable fixed cells (modified contibutions by aki)
-packages for Delphi XE
Modified:
-removed some obsolete methods, several bugfixes
Version 1.6 (October 2010):
Added:
-column/row/grid autosizing,
-automatic data type recognition and images in TKDBGrid,
-improvements in TKGridCellPainter (images, button shapes etc.),
-cell hints
-OnMouseDblClickCell event
-new features based on contributions by JR (OptionsEx property)
-PaintCell method
Modified:
-several bugfixes
Version 1.5 (October 2009):
Added:
-printing/previewing/on the fly previewing (TKPrintPreview, TKPrintPageSetup classes etc.),
in Lazarus works only for Win32(suppose Win64 too) widget set
-OnMouseClickCell and OnMouseLeaveCell, OnMouseClickCell events
Modified:
-painting and inplace editor performance for GTK2, QT yet slightly improved
Version 1.4 (October 2009):
Added:
-full Lazarus support (all official or beta state widget sets, tested on Win32/Win64, GTK, GTK2, QT)
-cell merging and splitting (CellSpan property & TKGridCell ColSpan and RowSpan properties)
-data aware control (TKDBGrid class)
-column/row individual maximum and minimum extent (TKGridAxisItem MinExtent & MaxExtent properties)
-smooth scrolling (ScrollModeHorz & ScrollModeVert properties)
-OnMouseEnterCell and OnMouseLeaveCell events
-KDBGrid demo for Delphi/Lazarus
Modified:
-HotFix 3.10: painting performance optimized for GTK2
-major modifications due to platform independency in Lazarus
-some generous functions moved from KGrids.pas to KGraphics.pas or KFunctions.pas
-(very) few incompatibilities with previous versions
-KGrid demo extended
-no more InnoSetup installation but generous zip package due to platform independency
-lower case introduced for unit names etc. due to platform independency
-documentation completed
Version 1.3 (August 2009):
Added:
-ported to Lazarus (Windows widgetset only)
-TKCustomGrid.ThroughClick property (clicking a cell will click the inplace editor as well)
-TKGridTextAttributes - text attributes (multiline text, end ellipsis, path ellipsis, word break)
-keyboard behavior extended
Modified:
-JCL not needed anymore (mainly because of the Lazarus support)
-inplace editor rendering
-documentation
Version 1.3 beta (July 2009):
Added:
-TKGridAxisItem.Visible property
-optional visual indication of hidden columns or rows
-goIndicateHiddenCells style in TKCustomGrid.Options
-goMouseCanHideCells style in TKCustomGrid.Options
-goHeaderAlignment style in TKCustomGrid.Options
-TKCustomGrid.SortStyle property
-TKCustomGrid.UpdateSortMode method
Modified:
-moving columns/rows via OnExchangeCols/OnExchangeRows (both normal and virtual mode)
-inplace editor rendering
-documentation
Version 1.2 (October 2008):
Added:
-OnChanged event handler
Modified:
-update to Delphi 2009
-painting of the themed header cells fixed
-painting of some inplace editors fixed (e.g. TRichEdit)
Version 1.1 (April 2008):
Added:
-sorting interface
-cell clipping and double buffering
-TKGridCellPainter class,
-improved compatibility with TStringGrid
-another small improvements and fixes
Modified:
-demo has been extended
-documentation
Version 1.0 (January 2008):
Added:
-index mapping
-small demo,
-documentation
-many other improvements and bug fixes
Version 0.9 (July 2007): Initial release

View File

@ -0,0 +1,92 @@
Software: KhexEditor component for Delphi and Lazarus
Original authorship: Tomas Krysl (tk@tkweb.eu)
-------------------
LICENSE:
-------------------
License information for each source file can be found in it's header.
If there is none, the code is public domain.
SYSTEM REQUIREMENTS:
-------------------
- platforms: Win32(98(SE)+), Win64(untested), GTK, GTK2, QT, Carbon(untested), WinCE(untested)
- works under Delphi 7 and higher (tested on Delphi 7, Delphi2007 till Delphi 2010)
and Lazarus 0.9.29(SVN#21827) and higher
- should work under Delphi 6
- some more problems might be experienced for older Lazarus versions
INSTALLATION:
-------------------
1. Compile and install package (it might be needed to specify some search paths in Delphi).
2. When compiling an application or demo, it might be needed to specify the search path to KHexEditor sources.
PLANNED:
-------------------
- improve performance for non-Win32 widget sets in Lazarus
- byte swaps (Little and Big Endian)
- considering: visual control of modified text
KNOWN PROBLEMS:
-------------------
Delphi common:
-none, best performance
Lazarus common:
-slow performance on non-Win32 widget sets
TECHNICAL SUPPORT:
-------------------
Any suggestions, error reports and questions about this software please send to
the author or discuss on http://www.tkweb.eu.
VERSION HISTORY:
-------------------
Version 1.5 (November 2010)
Added:
-Append method to append data at a position
Modified:
-packages for Delphi XE
Version 1.4 (October 2009)
Modified:
-printing and previewing to comply with kcontrols.pas
-update to Delphi 2010
-port to Lazarus
Version 1.3 (October 2008)
Modified:
-update to Delphi 2009
Version 1.22 (January 2008)
Modified:
-packages included for newer Delphi
Version 1.21 (June 2006)
Modified:
-bugs fixed when no printer installed
Version 1.2 (June 2006):
Added:
-runtime package
-UpdateCharMetrics method
-keyboard features into TKHexEditorPrintPreview
Modified:
-UpdateScrollRange modified to avoid
design-time exceptions in the IDE
-minor bugfixes
Version 1.1 (May 2006):
Added:
-print preview - new component (KHexEditorPreview.pas)
-PaintTo method to paint the outline to another canvas
Modified:
-little modifications
Version 1.0 (April 2006): Initial release

View File

@ -0,0 +1,135 @@
Software: TKIcon component for Delphi
Original authorship: Tomas Krysl (tk@tkweb.eu)
-------------------
LICENSE:
-------------------
License information for each source file can be found in it's header.
If there is none, the code is public domain.
SYSTEM REQUIREMENTS:
-------------------
- Microsoft Windows 98(SE)/ME/2000/XP/VI
- should work under Delphi 6 and higher (tested on Delphi 7, Delphi2007 and Delphi 2009) and Lazarus 0.9.26 and higher (Win32 only)
INSTALLATION:
-------------------
1. In your project or when compiling the demo, specify search path to
Source\KIcon.pas under Project/Options/Directories.
KNOWN PROBLEMS:
-------------------
CopyToBitmap does not work good in Delphi for 32 bpp images with alpha channel and in some versions of Lazarus.
Reason is errorneous TBitmap implementation.
I expect problems with the LoadFromAssoc... methods, although I�ve tested the methods heavily.
I have implemented these through the direct access to the registry, because other approach
(Shell) frustrated me.
PLANNED:
-------------------
TECHNICAL SUPPORT:
-------------------
Any suggestions, error reports and questions about this software please send to
the author or discuss on http://www.tkweb.eu.
CONTRIBUTORS:
-------------------
Goran Despalatovic: fixed many bugs
VERSION HISTORY:
-------------------
Version 2.2 (November 2010)
Modified:
-compilation for KControls 1.2
Version 2.1 (April 2010):
Modified:
-CopyToAlphaBitmap fixed, BlendLine function fixed
Added:
-CopyToAlphaBitmap demo
Version 2.0 (November 2009):
Modified:
-CopyToBitmap to be suitable for Glyph properties
Added:
-bugfixes (made by me or Goran Despalatovic)
Version 1.9 (October 2009):
Added:
-minor fixes
Version 1.8 (August 2009):
Added:
-ported to Lazarus
-full PNG support (read, write, display) optional. Under Delphi PngImage control is needed up to Delphi 2007.
Modified:
-JCL not needed anymore (mainly because of the Lazarus support)
Version 1.7 (October 2008):
Added:
-TIconDrawStyle.idsAlphaChannel for displaying the alpha channel (32 bit icon images) as grayscale image
-PNG icon read/write support (contributed by maro)
Modified:
-update to Delphi 2009
Version 1.6 (July 2006):
Added:
-DisplayHorz property
-install package
-exe demo
Modified:
-fixed bug in LoadHandles method (color table copying)
-MaxWidth and MaxHeight property behavior
-documentation (put into source code for automated *.chm generation)
Deleted:
-TotalWidth property (had never significant meaning)
Version 1.5 (July 2005):
Added:
-support for static cursors
Version 1.41 (April 2005):
Modified:
-minor bugfixes (icon rendering, module loading)
Version 1.4 (April 2005):
Added:
-icon can be stretched when drawn from now
-IconDrawStyle property (normal, mask only and no mask rendering)
-MaskFromColor method
Modified:
-icon rendering bug under W9x fixed (MaskBlt function removed)
-exception handling
Version 1.3 (March 2005):
Added:
-icon image manipulation functions
-several LoadFrom... methods (loading from file associations, resource identification by ID)
Modified:
-minor bugfixes
Version 1.2 (March 2005)
Added:
-several LoadFrom... methods,
-documentation
Modified:
-bug in the Assign method fixed
Version 1.1 (February 2005):
Added:
-OverSizeWeight property
Modified:
-minor bugfixes
-fatal bugs in LoadFromResource fixed
Version 1.0 (February 2005): Initial release

View File

@ -0,0 +1,285 @@
{ This file contains compiler distinctions and conditional defines for all
source files in the KControls Development Suite. It has been created from
several similar resources available. }
{$IFNDEF KCONTROLS_INC}
{$DEFINE KCONTROLS_INC}
{ Default compiler directives for entire KControls Development Suite }
{$IFDEF FPC}
{$MODE DELPHI}
{$B-,H+,J+,Q-,R-,T-,X+}
{$ELSE}
{$B-,H+,J+,Q-,R-,T-,X+}
{$ENDIF}
{ Specifies if native operating system theme support should be used (Themes.pas is needed) }
{$DEFINE USE_THEMES}
{ COMPILERx, DELPHIx and BCBx directives from VERx }
{$IFDEF VER220}
{$DEFINE COMPILER14}
{$IFDEF BCB}
{$DEFINE BCBXE}
{$ELSE}
{$DEFINE DELPHIXE}
{$ENDIF}
{$ENDIF}
{$IFDEF VER210}
{$DEFINE COMPILER13}
{$IFDEF BCB}
{$DEFINE BCB2010}
{$ELSE}
{$DEFINE DELPHI2010}
{$ENDIF}
{$ENDIF}
{$IFDEF VER200}
{$DEFINE COMPILER12}
{$IFDEF BCB}
{$DEFINE BCB2009}
{$ELSE}
{$DEFINE DELPHI2009}
{$ENDIF}
{$ENDIF}
{$IFDEF VER180}
{$IFDEF VER185}
{$DEFINE COMPILER11}
{$IFDEF BCB}
{$DEFINE BCB2007}
{$ELSE}
{$DEFINE DELPHI2007}
{$ENDIF}
{$ELSE}
{$DEFINE COMPILER10}
{$IFDEF BCB}
{$DEFINE BCB2006}
{$ELSE}
{$DEFINE DELPHI2006}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$IFDEF VER170}
{$DEFINE COMPILER9}
{$DEFINE DELPHI2005}
{$ENDIF}
{$IFDEF VER160}
{$DEFINE COMPILER8}
{$DEFINE DELPHI8}
{$ENDIF}
{$IFDEF VER150}
{$DEFINE COMPILER7}
{$DEFINE DELPHI7}
{$ENDIF}
{$IFDEF VER140}
{$DEFINE COMPILER6}
{$IFDEF BCB}
{$DEFINE BCB6}
{$ELSE}
{$DEFINE DELPHI6}
{$ENDIF}
{$ENDIF}
{$IFDEF VER130}
{$DEFINE COMPILER5}
{$IFDEF BCB}
{$DEFINE BCB5}
{$ELSE}
{$DEFINE DELPHI5}
{$ENDIF}
{$ENDIF}
{$IFDEF VER125}
{$DEFINE COMPILER4}
{$DEFINE BCB}
{$DEFINE BCB4}
{$ENDIF}
{$IFDEF VER120}
{$DEFINE COMPILER4}
{$DEFINE DELPHI4}
{$ENDIF}
{$IFDEF VER110}
{$DEFINE COMPILER3}
{$DEFINE BCB}
{$DEFINE BCB3}
{$ENDIF}
{$IFDEF VER100}
{$DEFINE COMPILER3}
{$DEFINE DELPHI3}
{$ENDIF}
{$IFDEF VER93}
{$DEFINE COMPILER2}
{$DEFINE BCB}
{$DEFINE BCB1}
{$ENDIF}
{$IFDEF VER90}
{$DEFINE COMPILER2}
{$DEFINE DELPHI2}
{$ENDIF}
{ What is used: DELPHI or BCB ? (BCB is defined by C++Builder 5 and later) }
{$IFNDEF BCB}
{$DEFINE DELPHI}
{$ENDIF}
{ COMPILERx_UP directives from COMPILERx }
{$IFDEF COMPILER14} {$DEFINE COMPILER14_UP} {$ENDIF}
{$IFDEF COMPILER13} {$DEFINE COMPILER13_UP} {$ENDIF}
{$IFDEF COMPILER12} {$DEFINE COMPILER12_UP} {$ENDIF}
{$IFDEF COMPILER11} {$DEFINE COMPILER11_UP} {$ENDIF}
{$IFDEF COMPILER10} {$DEFINE COMPILER10_UP} {$ENDIF}
{$IFDEF COMPILER9} {$DEFINE COMPILER9_UP} {$ENDIF}
{$IFDEF COMPILER8} {$DEFINE COMPILER8_UP} {$ENDIF}
{$IFDEF COMPILER7} {$DEFINE COMPILER7_UP} {$ENDIF}
{$IFDEF COMPILER6} {$DEFINE COMPILER6_UP} {$ENDIF}
{$IFDEF COMPILER5} {$DEFINE COMPILER5_UP} {$ENDIF}
{$IFDEF COMPILER4} {$DEFINE COMPILER4_UP} {$ENDIF}
{$IFDEF COMPILER3} {$DEFINE COMPILER3_UP} {$ENDIF}
{$IFDEF COMPILER2} {$DEFINE COMPILER2_UP} {$ENDIF}
{$IFDEF COMPILER14_UP} {$DEFINE COMPILER13_UP} {$ENDIF}
{$IFDEF COMPILER13_UP} {$DEFINE COMPILER12_UP} {$ENDIF}
{$IFDEF COMPILER12_UP} {$DEFINE COMPILER11_UP} {$ENDIF}
{$IFDEF COMPILER11_UP} {$DEFINE COMPILER10_UP} {$ENDIF}
{$IFDEF COMPILER10_UP} {$DEFINE COMPILER9_UP} {$ENDIF}
{$IFDEF COMPILER9_UP} {$DEFINE COMPILER8_UP} {$ENDIF}
{$IFDEF COMPILER8_UP} {$DEFINE COMPILER7_UP} {$ENDIF}
{$IFDEF COMPILER7_UP} {$DEFINE COMPILER6_UP} {$ENDIF}
{$IFDEF COMPILER6_UP} {$DEFINE COMPILER5_UP} {$ENDIF}
{$IFDEF COMPILER5_UP} {$DEFINE COMPILER4_UP} {$ENDIF}
{$IFDEF COMPILER4_UP} {$DEFINE COMPILER3_UP} {$ENDIF}
{$IFDEF COMPILER3_UP} {$DEFINE COMPILER2_UP} {$ENDIF}
{$IFDEF COMPILER2_UP} {$DEFINE COMPILER1_UP} {$ENDIF}
{ DELPHIx_UP directives from DELPHIx }
{$IFDEF DELPHIXE} {$DEFINE DELPHIXE_UP} {$ENDIF}
{$IFDEF DELPHI2010} {$DEFINE DELPHI2010_UP} {$ENDIF}
{$IFDEF DELPHI2009} {$DEFINE DELPHI2009_UP} {$ENDIF}
{$IFDEF DELPHI2007} {$DEFINE DELPHI2007_UP} {$ENDIF}
{$IFDEF DELPHI2006} {$DEFINE DELPHI2006_UP} {$ENDIF}
{$IFDEF DELPHI2005} {$DEFINE DELPHI2005_UP} {$ENDIF}
{$IFDEF DELPHI8} {$DEFINE DELPHI8_UP} {$ENDIF}
{$IFDEF DELPHI7} {$DEFINE DELPHI7_UP} {$ENDIF}
{$IFDEF DELPHI6} {$DEFINE DELPHI6_UP} {$ENDIF}
{$IFDEF DELPHI5} {$DEFINE DELPHI5_UP} {$ENDIF}
{$IFDEF DELPHI4} {$DEFINE DELPHI4_UP} {$ENDIF}
{$IFDEF DELPHI3} {$DEFINE DELPHI3_UP} {$ENDIF}
{$IFDEF DELPHI2} {$DEFINE DELPHI2_UP} {$ENDIF}
{$IFDEF DELPHIXE_UP} {$DEFINE DELPHI2010_UP} {$ENDIF}
{$IFDEF DELPHI2010_UP} {$DEFINE DELPHI2009_UP} {$ENDIF}
{$IFDEF DELPHI2009_UP} {$DEFINE DELPHI2007_UP} {$ENDIF}
{$IFDEF DELPHI2007_UP} {$DEFINE DELPHI2006_UP} {$ENDIF}
{$IFDEF DELPHI2006_UP} {$DEFINE DELPHI2005_UP} {$ENDIF}
{$IFDEF DELPHI2005_UP} {$DEFINE DELPHI8_UP} {$ENDIF}
{$IFDEF DELPHI8_UP} {$DEFINE DELPHI7_UP} {$ENDIF}
{$IFDEF DELPHI7_UP} {$DEFINE DELPHI6_UP} {$ENDIF}
{$IFDEF DELPHI6_UP} {$DEFINE DELPHI5_UP} {$ENDIF}
{$IFDEF DELPHI5_UP} {$DEFINE DELPHI4_UP} {$ENDIF}
{$IFDEF DELPHI4_UP} {$DEFINE DELPHI3_UP} {$ENDIF}
{$IFDEF DELPHI3_UP} {$DEFINE DELPHI2_UP} {$ENDIF}
{$IFDEF DELPHI2_UP} {$DEFINE DELPHI1_UP} {$ENDIF}
{ BCBx_UP directives from BCBx }
{$IFDEF BCBXE} {$DEFINE BCBXE_UP} {$ENDIF}
{$IFDEF BCB2010} {$DEFINE BCB2010_UP} {$ENDIF}
{$IFDEF BCB2009} {$DEFINE BCB2009_UP} {$ENDIF}
{$IFDEF BCB2007} {$DEFINE BCB2007_UP} {$ENDIF}
{$IFDEF BCB2006} {$DEFINE BCB2006_UP} {$ENDIF}
{$IFDEF BCB6} {$DEFINE BCB6_UP} {$ENDIF}
{$IFDEF BCB5} {$DEFINE BCB5_UP} {$ENDIF}
{$IFDEF BCB4} {$DEFINE BCB4_UP} {$ENDIF}
{$IFDEF BCB3} {$DEFINE BCB3_UP} {$ENDIF}
{$IFDEF BCB1} {$DEFINE BCB1_UP} {$ENDIF}
{$IFDEF BCBXE_UP} {$DEFINE BCB2010_UP} {$ENDIF}
{$IFDEF BCB2010_UP} {$DEFINE BCB2009_UP} {$ENDIF}
{$IFDEF BCB2009_UP} {$DEFINE BCB2007_UP} {$ENDIF}
{$IFDEF BCB2007_UP} {$DEFINE BCB2006_UP} {$ENDIF}
{$IFDEF BCB2006_UP} {$DEFINE BCB6_UP} {$ENDIF}
{$IFDEF BCB6_UP} {$DEFINE BCB5_UP} {$ENDIF}
{$IFDEF BCB5_UP} {$DEFINE BCB4_UP} {$ENDIF}
{$IFDEF BCB4_UP} {$DEFINE BCB3_UP} {$ENDIF}
{$IFDEF BCB3_UP} {$DEFINE BCB1_UP} {$ENDIF}
{ Unicode compiler directive for string type }
// Delphi 2009+ uses UTF16, Lazarus 0.9.25+ uses UTF8
{$IF DEFINED(COMPILER12_UP) OR DEFINED(FPC)}
{$DEFINE STRING_IS_UNICODE}
{$IFEND}
{ Prefers usage of TCanvas methods instead of WinAPI mainly to avoid Lazarus bugs. }
{$DEFINE USE_CANVAS_METHODS}
{ Allows to use WinAPI functions in Lazarus and Delphi }
{$IF NOT DEFINED(FPC) OR DEFINED(LCLWin32)}
{$DEFINE USE_WINAPI}
{$IFEND}
{ Allows to use WideWinProcs unit }
{$IFDEF USE_WINAPI}
{.$DEFINE USE_WIDEWINPROCS}
{$ENDIF}
{$DEFINE LAZARUS_HAS_DC_MAPPING}
{$IF DEFINED(USE_WINAPI) OR DEFINED(LAZARUS_HAS_DC_MAPPING)}
{$DEFINE USE_DC_MAPPING}
{$IFEND}
{ Conditional defines for unit KGrids: }
// we want TKGridObjectCell to be a descendant of TKGridAttrTextCell
{$DEFINE TKGRIDOBJECTCELL_IS_TKGRIDATTRTEXTCELL}
// we want TKGridObjectCell to be a descendant of TKGridTextCell
{.$DEFINE TKGRIDOBJECTCELL_IS_TKGRIDTEXTCELL}
// use JCLUnicode (only for TKGridAxisItem.Assign(Source: TWideStrings);)
{.$DEFINE TKGRID_USE_JCL}
{ Conditional defines for unit KDBGrids: }
// we want to use TKDBGrid
{$DEFINE TKDBGRID_USE}
// we want TKDBGridCell to be a descendant of TKGridAttrTextCell
{.$DEFINE TKDBGRIDCELL_IS_TKGRIDATTRTEXTCELL}
{ Conditional defines for unit KIcon: }
// register TKICON within TPicture automatically
{.$DEFINE TKICON_REGISTER}
// PngImage can be used
{$IF DEFINED(FPC) OR DEFINED(COMPILER12_UP)}
{$DEFINE USE_PNG_SUPPORT}
{$IFEND}
{$DEFINE DEFAULT_LANGUAGE_EN} // default language is english
{.$DEFINE DEFAULT_LANGUAGE_CZ} // default language is czech
{.$DEFINE DEFAULT_LANGUAGE_DE} // default language is german
{.$DEFINE DEFAULT_LANGUAGE_RU} // default language is russian
{$ENDIF ~KCONTROLS_INC}

View File

@ -0,0 +1,30 @@
LazarusResources.Add('kpreview_cursor_hand_free','CUR',[
#0#0#2#0#1#0' '#0#0#15#0#15#0'0'#1#0#0#22#0#0#0'('#0#0#0' '#0#0#0'@'#0#0#0#1
+#0#1#0#0#0#0#0#128#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#255#255#255
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#3#240#0
+#0#3#240#0#0#7#240#0#0#15#248#0#0#31#248#0#0#31#252#0#0'?'#252#0#0'w'#252#0#0
+'g'#254#0#0#7#246#0#0#13#182#0#0#13#178#0#0#25#176#0#0#25#176#0#0#1#128#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#248#7#255#255#248#7#255#255
+#240#7#255#255#224#3#255#255#192#3#255#255#192#1#255#255#128#1#255#255#0#1
+#255#255#0#0#255#255#144#0#255#255#224#0#255#255#224#0#255#255#192#5#255#255
+#192#7#255#255#228#15#255#255#254#127#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255
]);
LazarusResources.Add('kpreview_cursor_hand_grip','CUR',[
#0#0#2#0#1#0' '#0#0#15#0#15#0'0'#1#0#0#22#0#0#0'('#0#0#0' '#0#0#0'@'#0#0#0#1
+#0#1#0#0#0#0#0#128#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#255#255#255
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#7#224#0#0#7#224#0#0#15#224#0#0#31#240#0#0'?'#240#0#0'?'#248
+#0#0#15#248#0#0#15#248#0#0#31#232#0#0#27'`'#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#255#255#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+#255#255#240#15#255#255#240#15#255#255#224#15#255#255#192#7#255#255#128#7#255
+#255#128#3#255#255#192#3#255#255#224#3#255#255#192#3#255#255#192#7#255#255
+#228#159#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255#255
]);

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,130 @@
<?xml version="1.0"?>
<CONFIG>
<Package Version="3">
<PathDelim Value="\"/>
<Name Value="KControlsLaz"/>
<CompilerOptions>
<Version Value="8"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value=""/>
<OtherUnitFiles Value=""/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Other>
<Verbosity>
<ShowHints Value="False"/>
</Verbosity>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Version Major="1" Minor="2"/>
<Files Count="21">
<Item1>
<Filename Value="kfunctions.pas"/>
<UnitName Value="KFunctions"/>
</Item1>
<Item2>
<Filename Value="kgraphics.pas"/>
<UnitName Value="KGraphics"/>
</Item2>
<Item3>
<Filename Value="kcontrols.lrs"/>
<Type Value="LRS"/>
</Item3>
<Item4>
<Filename Value="kcontrols.pas"/>
<UnitName Value="KControls"/>
</Item4>
<Item5>
<Filename Value="kdialogs.pas"/>
<UnitName Value="KDialogs"/>
</Item5>
<Item6>
<Filename Value="keditcommon.pas"/>
<UnitName Value="KEditCommon"/>
</Item6>
<Item7>
<Filename Value="kgrids.lrs"/>
<Type Value="LRS"/>
</Item7>
<Item8>
<Filename Value="kgrids.pas"/>
<UnitName Value="KGrids"/>
</Item8>
<Item9>
<Filename Value="khexeditor.pas"/>
<UnitName Value="KHexEditor"/>
</Item9>
<Item10>
<Filename Value="kicon.pas"/>
<UnitName Value="KIcon"/>
</Item10>
<Item11>
<Filename Value="kprintpreview.lfm"/>
<Type Value="LFM"/>
</Item11>
<Item12>
<Filename Value="kprintpreview.lrs"/>
<Type Value="LRS"/>
</Item12>
<Item13>
<Filename Value="kprintpreview.pas"/>
<UnitName Value="KPrintPreview"/>
</Item13>
<Item14>
<Filename Value="kprintsetup.lfm"/>
<Type Value="LFM"/>
</Item14>
<Item15>
<Filename Value="kprintsetup.lrs"/>
<Type Value="LRS"/>
</Item15>
<Item16>
<Filename Value="kprintsetup.pas"/>
<UnitName Value="KPrintSetup"/>
</Item16>
<Item17>
<Filename Value="kwidewinprocs.pas"/>
<UnitName Value="KWideWinProcs"/>
</Item17>
<Item18>
<Filename Value="kcontrolsdesign.lrs"/>
<Type Value="LRS"/>
</Item18>
<Item19>
<Filename Value="kcontrolsdesign.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="kcontrolsdesign"/>
</Item19>
<Item20>
<Filename Value="kdbgrids.pas"/>
<UnitName Value="KDBGrids"/>
</Item20>
<Item21>
<Filename Value="kcontrols.inc"/>
<Type Value="Include"/>
</Item21>
</Files>
<Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="3">
<Item1>
<PackageName Value="Printer4Lazarus"/>
</Item1>
<Item2>
<PackageName Value="DBFLaz"/>
</Item2>
<Item3>
<PackageName Value="LCL"/>
<MinVersion Major="1" Valid="True"/>
</Item3>
</RequiredPkgs>
<UsageOptions>
<UnitPath Value="$(PkgOutDir)\"/>
</UsageOptions>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
</PublishOptions>
</Package>
</CONFIG>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,131 @@
{ @abstract(This unit contains all dialogs supplied with KControls.)
@author(Tomas Krysl (tk@tkweb.eu))
@created(18 Sep 2009)
@lastmod(14 Oct 2009)
This unit implements all dialogs supplied with KControls Development Suite.
Copyright � 2009 Tomas Krysl (tk@@tkweb.eu)<BR><BR>
<B>License:</B><BR>
This code is distributed as a freeware. You are free to use it as part
of your application for any purpose including freeware, commercial and
shareware applications. The origin of this source code must not be
misrepresented; you must not claim your authorship. You may modify this code
solely for your own purpose. Please feel free to contact the author if you
think your changes might be useful for other users. You may distribute only
the original package. The author accepts no liability for any damage
that may result from using this code. }
unit KDialogs;
{$include kcontrols.inc}
{$WEAKPACKAGEUNIT ON}
interface
uses
Classes, Controls, Forms, KControls, KPrintPreview, KPrintSetup;
type
{ @abstract(Encapsulates the print preview dialog) }
TKPrintPreviewDialog = class(TComponent)
private
FControl: TKCustomControl;
FPrintPreviewForm: TKPrintPreviewForm;
function GetPrintPreviewForm: TKPrintPreviewForm;
public
{ Creates the instance. Assigns default values to properties. }
constructor Create(AOwner: TComponent); override;
{ Shows the dialog. }
procedure Show;
{ Shows the dialog as modal dialog. }
function Execute: Boolean;
{ Specifies the associated preview form. }
property PrintPreviewForm: TKPrintPreviewForm read GetPrintPreviewForm;
published
{ Specifies the associated control. }
property Control: TKCustomControl read FControl write FControl;
end;
{ @abstract(Encapsulates the print preview dialog) }
TKPrintSetupDialog = class(TComponent)
private
FControl: TKCustomControl;
FPrintSetupForm: TKPrintSetupForm;
FPreviewDialog: TKPrintPreviewDialog;
FSelAvail: Boolean;
public
{ Creates the instance. Assigns default values to properties. }
constructor Create(AOwner: TComponent); override;
{ Shows the dialog as modal dialog. }
function Execute: Boolean;
published
{ Specifies the associated control. }
property Control: TKCustomControl read FControl write FControl;
{ Specifies the preview dialog for the Preview... button.
If not specified, the print setup dialog creates a new one. }
property PreviewDialog: TKPrintPreviewDialog read FPreviewDialog write FPreviewDialog;
{ If True, the Selection Only option will be checked (if selection is available
for the control). }
property SelAvail: Boolean read FSelAvail write FSelAvail default True;
end;
implementation
{ TKPrintPreviewDialog }
constructor TKPrintPreviewDialog.Create(AOwner: TComponent);
begin
inherited;
FPrintPreviewForm := nil;
FControl := nil;
end;
function TKPrintPreviewDialog.Execute;
begin
PrintPreviewForm.Preview.Control := FControl;
PrintPreviewForm.ShowModal;
Result := True;
end;
function TKPrintPreviewDialog.GetPrintPreviewForm: TKPrintPreviewForm;
begin
if not Assigned(FPrintPreviewForm) then
FPrintPreviewForm := TKPrintPreviewForm.Create(Self);
Result := FPrintPreviewForm;
end;
procedure TKPrintPreviewDialog.Show;
begin
PrintPreviewForm.Preview.Control := FControl;
PrintPreviewForm.Show;
end;
{ TKPrintSetupDialog }
constructor TKPrintSetupDialog.Create(AOwner: TComponent);
begin
inherited;
FControl := nil;
FPrintSetupForm := nil;
FPreviewDialog := nil;
FSelAvail := True;
end;
function TKPrintSetupDialog.Execute: Boolean;
begin
if Assigned(FControl) then
begin
if not Assigned(FPrintSetupForm) then
FPrintSetupForm := TKPrintSetupForm.Create(Self);
FPrintSetupForm.PageSetup := FControl.PageSetup;
if Assigned(FPreviewDialog) then
FPrintSetupForm.PreviewForm := FPreviewDialog.PrintPreviewForm;
FPrintSetupForm.SelAvail := FSelAvail;
Result := FPrintSetupForm.ShowModal = mrOk;
end else
Result := False;
end;
end.

View File

@ -0,0 +1,413 @@
{ @abstract(This unit contains the common declarations for all edit controls.)
@author(Tomas Krysl (tk@tkweb.eu))
@created(18 Sep 2009)
@lastmod(20 Jun 2010)
This unit defines common types and functions for all edit controls.
Copyright � 2009 Tomas Krysl (tk@@tkweb.eu)<BR><BR>
<B>License:</B><BR>
This code is distributed as a freeware. You are free to use it as part
of your application for any purpose including freeware, commercial and
shareware applications. The origin of this source code must not be
misrepresented; you must not claim your authorship. You may modify this code
solely for your own purpose. Please feel free to contact the author if you
think your changes might be useful for other users. You may distribute only
the original package. The author accepts no liability for any damage
that may result from using this code. }
unit KEditCommon;
{$include kcontrols.inc}
{$WEAKPACKAGEUNIT ON}
interface
uses
{$IFDEF FPC}
LCLType, LCLIntf, LCLProc, LResources,
{$ELSE}
Windows, Messages,
{$ENDIF}
SysUtils, Classes, Graphics, Controls, Forms;
type
{ Declares possible values for the edit control commands. }
TKEditCommand = (
{ Move caret left one char }
ecLeft,
{ Move caret right one char }
ecRight,
{ Move caret up one line }
ecUp,
{ Move caret down one line }
ecDown,
{ Move caret to beginning of line }
ecLineStart,
{ Move caret to end of line }
ecLineEnd,
{ Move caret up one page }
ecPageUp,
{ Move caret down one page }
ecPageDown,
{ Move caret left one page }
ecPageLeft,
{ Move caret right one page }
ecPageRight,
{ Move caret to top of page }
ecPageTop,
{ Move caret to bottom of page }
ecPageBottom,
{ Move caret to absolute beginning }
ecEditorTop,
{ Move caret to absolute end }
ecEditorBottom,
{ Move caret to specific coordinates, Data = ^TPoint }
ecGotoXY,
{ Move caret left one char }
ecSelLeft,
{ Move caret right one char, affecting selection }
ecSelRight,
{ Move caret up one line, affecting selection }
ecSelUp,
{ Move caret down one line, affecting selection }
ecSelDown,
{ Move caret to beginning of line, affecting selection }
ecSelLineStart,
{ Move caret to end of line, affecting selection }
ecSelLineEnd,
{ Move caret up one page, affecting selection }
ecSelPageUp,
{ Move caret down one page, affecting selection }
ecSelPageDown,
{ Move caret left one page, affecting selection }
ecSelPageLeft,
{ Move caret right one page, affecting selection }
ecSelPageRight,
{ Move caret to top of page, affecting selection }
ecSelPageTop,
{ Move caret to bottom of page, affecting selection }
ecSelPageBottom,
{ Move caret to absolute beginning, affecting selection }
ecSelEditorTop,
{ Move caret to absolute end, affecting selection }
ecSelEditorBottom,
{ Move caret to specific coordinates, affecting selection, Data = ^TPoint }
ecSelGotoXY,
{ Scroll up one line leaving caret position unchanged }
ecScrollUp,
{ Scroll down one line leaving caret position unchanged }
ecScrollDown,
{ Scroll left one char leaving caret position unchanged }
ecScrollLeft,
{ Scroll right one char leaving caret position unchanged }
ecScrollRight,
{ Scroll to center the caret position within client area }
ecScrollCenter,
{ Undo previous action }
ecUndo,
{ Redo last undone action }
ecRedo,
{ Copy selection to clipboard }
ecCopy,
{ Cut selection to clipboard }
ecCut,
{ Paste clipboard to current position }
ecPaste,
{ Insert character at current position, Data = ^Char }
ecInsertChar,
{ Insert digits (digit string) at current position, Data = ^string
(must contain digits only), TKCustomHexEditor only }
ecInsertDigits,
{ Insert string (multiple characters) at current position, Data = ^string }
ecInsertString,
{ Delete last character (i.e. backspace key) }
ecDeleteLastChar,
{ Delete character at caret (i.e. delete key) }
ecDeleteChar,
{ Delete from caret to beginning of line }
ecDeleteBOL,
{ Delete from caret to end of line }
ecDeleteEOL,
{ Delete current line }
ecDeleteLine,
{ Select everything }
ecSelectAll,
{ Delete everything }
ecClearAll,
{ Delete selection (no digit selection), TKCustomHexEditor only }
ecClearIndexSelection,
{ Delete selection (digit selection as well) }
ecClearSelection,
{ Search for text/digits }
ecSearch,
{ Replace text/digits }
ecReplace,
{ Set insert mode }
ecInsertMode,
{ Set overwrite mode }
ecOverwriteMode,
{ Toggle insert/overwrite mode }
ecToggleMode,
{ Adjust editor when getting input focus }
ecGotFocus,
{ Adjust editor when losing input focus }
ecLostFocus
);
{ @abstract(Declares the keystroke information structure for the Key member
of the @link(TKEditCommandAssignment) structure)
<UL>
<LH>Members:</LH>
<LI><I>Key</I> - virtual key code</LI>
<LI><I>Shift</I> - shift state that belongs to that key code</LI>
</UL>
}
TKEditKey = record
Key: Word;
Shift: TShiftState;
end;
{ @abstract(Declares the @link(TKEditKeyMapping) array item)
<UL>
<LH>Members:</LH>
<LI><I>Command</I> - command that is about to be executed</LI>
<LI><I>Key</I> - key combination necessary to execute that command</LI>
</UL>
}
TKEditCommandAssignment = record
Command: TKEditCommand;
Key: TKEditKey;
end;
{ @abstract(Declares OnDropFiles event handler)
<UL>
<LH>Parameters:</LH>
<LI><I>Sender</I> - identifies the event caller</LI>
<LI><I>X, Y</I> - mouse cursor coordinates (relative to the caller's window)</LI>
<LI><I>Files</I> - list of file names that were dropped on the caller's window)</LI>
</UL>
}
TKEditDropFilesEvent = procedure(Sender: TObject; X, Y: integer;
Files: TStrings) of object;
{ Declares key mapping array for the KeyMapping property }
TKEditKeyMapping = array of TKEditCommandAssignment;
{ Declares character mapping array for the @link(TKCustomHexEditor.CharMapping) property }
TKEditCharMapping = array of AnsiChar;
{ Pointer to @link(TKHexEditorCharMapping) }
PKEditCharMapping = ^TKEditCharMapping;
{ Declares options - possible values for the @link(TKCustomEdit.Options) property }
TKEditOption = (
{ The editor will receive dropped files }
eoDropFiles,
{ All undo/redo operations of the same kind will be grouped together }
eoGroupUndo,
{ The editor allows undo/redo operations after the @link(TKCustomEdit.Modified) property
has been set to False }
eoUndoAfterSave
);
{ Options can be arbitrary combined }
TKEditOptions = set of TKEditOption;
{ Declares possible values for the Action parameter in the @link(TKEditReplaceTextEvent) event }
TKEditReplaceAction = (
{ Quit replace sequence }
eraCancel,
{ Replace this occurence }
eraYes,
{ Don't replace this occurence }
eraNo,
{ Replace all following occurences without prompting }
eraAll
);
{ @abstract(Declares OnReplaceText event handler)
<UL>
<LH>Parameters:</LH>
<LI><I>Sender</I> - identifies the event caller</LI>
<LI><I>TextToFind</I> - current search string</LI>
<LI><I>TextToReplace</I> - current replace string</LI>
<LI><I>Action</I> - specifies how the replace function should continue</LI>
</UL>
}
TKEditReplaceTextEvent = procedure(Sender: TObject; const TextToFind, TextToReplace:
string; var Action: TKEditReplaceAction) of object;
{ Declares possible values for the ErrorReason member of the @link(TKEditSearchData) structure }
TKEditSearchError = (
{ No error occured }
eseOk,
{ There is a character in the search string that cannot be interpreted as hexadecimal digits}
eseNoDigitsFind,
{ There is a character in the replace string that cannot be interpreted as hexadecimal digits}
eseNoDigitsReplace,
{ No other search string found }
eseNoMatch
);
{ Declares search options - possible values for the Options member of the @link(TKEditSearchData) structure }
TKEditSearchOption = (
{ Replace all occurences }
esoAll,
{ Search backwards }
esoBackwards,
{ Search entire scope instead from current caret position }
esoEntireScope,
{ Include to identify search - this element will be automatically cleared
to provide the @link(TKEditSearchData) structure for additional search }
esoFirstSearch,
{ Match case when a binary search should be executed }
esoMatchCase,
{ Prompt user before a string is about to be replaced. This assumes @link(OnReplaceText)
is assigned }
esoPrompt,
{ Search the current selection only }
esoSelectedOnly,
{ Treat the supplied search and/or replace strings as hexadecimal sequence.
When the search string contains a character that cannot be interpreted as
hexadecimal digit, the execution stops and @link(eseNoDigits) error will
be returned. Similarly, @link(eseNoDigitsReplace) errors will be returned
on invalid replace string }
esoTreatAsDigits,
{ Internal option - don't modify }
esoWereDigits
);
{ Search options can be arbitrary combined }
TKEditSearchOptions = set of TKEditSearchOption;
{ @abstract(Declares the search/replace description structure for the @link(ecSearch)
and @link(ecReplace) commands)
<UL>
<LH>Members:</LH>
<LI><I>ErrorReason</I> - upon @link(ExecuteCommand)(ecSearch) or
ExecuteCommand(ecReplace), inspect this member to inform user about
search/replace result</LI>
<LI><I>Options</I> - defines search/replace options</LI>
<LI><I>SelStart, SelEnd</I> - internal parameters, don't modify</LI>
<LI><I>TextToFind</I> - search string</LI>
<LI><I>TextToReplace</I> - replace string</LI>
</UL>
}
TKEditSearchData = record
ErrorReason: TKEditSearchError;
Options: TKEditSearchOptions;
SelStart,
SelEnd: Integer;
TextToFind,
TextToReplace: string;
end;
{ Pointer to @link(TKEditSearchData) }
PKEditSearchData = ^TKEditSearchData;
{ Returns default key mapping structure }
function CreateDefaultKeyMapping: TKEditKeyMapping;
{ Returns default char mapping structure }
function DefaultCharMapping: TKEditCharMapping;
{ Returns default search data structure }
function DefaultSearchData: TKEditSearchData;
implementation
function CreateDefaultKeyMapping: TKEditKeyMapping;
procedure AddKey(Command: TKEditCommand; Key: Word; Shift: TShiftState);
var
I: Integer;
begin
I := Length(Result);
SetLength(Result, I + 1);
Result[I].Command := Command;
Result[I].Key.Key := Key;
Result[I].Key.Shift := Shift;
end;
begin
AddKey(ecLeft, VK_LEFT, []);
AddKey(ecRight, VK_RIGHT, []);
AddKey(ecRight, VK_RETURN, []);
AddKey(ecUp, VK_UP, []);
AddKey(ecDown, VK_DOWN, []);
AddKey(ecLineStart, VK_HOME, []);
AddKey(ecLineEnd, VK_END, []);
AddKey(ecPageUp, VK_PRIOR, []);
AddKey(ecPageDown, VK_NEXT, []);
AddKey(ecPageLeft, VK_LEFT, [ssCtrl, ssAlt]);
AddKey(ecPageRight, VK_RIGHT, [ssCtrl, ssAlt]);
AddKey(ecPageTop, VK_PRIOR, [ssCtrl]);
AddKey(ecPageBottom, VK_NEXT, [ssCtrl]);
AddKey(ecEditorTop, VK_HOME, [ssCtrl]);
AddKey(ecEditorBottom, VK_END, [ssCtrl]);
AddKey(ecSelLeft, VK_LEFT, [ssShift]);
AddKey(ecSelRight, VK_RIGHT, [ssShift]);
AddKey(ecSelUp, VK_UP, [ssShift]);
AddKey(ecSelDown, VK_DOWN, [ssShift]);
AddKey(ecSelLineStart, VK_HOME, [ssShift]);
AddKey(ecSelLineEnd, VK_END, [ssShift]);
AddKey(ecSelPageUp, VK_PRIOR, [ssShift]);
AddKey(ecSelPageDown, VK_NEXT, [ssShift]);
AddKey(ecSelPageLeft, VK_LEFT, [ssShift, ssCtrl, ssAlt]);
AddKey(ecSelPageRight, VK_RIGHT, [ssShift, ssCtrl, ssAlt]);
AddKey(ecSelPageTop, VK_PRIOR, [ssShift, ssCtrl]);
AddKey(ecSelPageBottom, VK_NEXT, [ssShift, ssCtrl]);
AddKey(ecSelEditorTop, VK_HOME, [ssShift, ssCtrl]);
AddKey(ecSelEditorBottom, VK_END, [ssShift, ssCtrl]);
AddKey(ecScrollUp, VK_UP, [ssCtrl]);
AddKey(ecScrollDown, VK_DOWN, [ssCtrl]);
AddKey(ecScrollLeft, VK_LEFT, [ssCtrl]);
AddKey(ecScrollRight, VK_RIGHT, [ssCtrl]);
AddKey(ecScrollCenter, VK_RETURN, [ssCtrl]);
AddKey(ecUndo, ord('Z'), [ssCtrl]);
AddKey(ecUndo, VK_BACK, [ssAlt]);
AddKey(ecRedo, ord('Z'), [ssShift, ssCtrl]);
AddKey(ecRedo, VK_BACK, [ssShift, ssAlt]);
AddKey(ecCopy, ord('C'), [ssCtrl]);
AddKey(ecCopy, VK_INSERT, [ssCtrl]);
AddKey(ecCut, ord('X'), [ssCtrl]);
AddKey(ecCut, VK_DELETE, [ssShift]);
AddKey(ecPaste, ord('V'), [ssCtrl]);
AddKey(ecPaste, VK_INSERT, [ssShift]);
AddKey(ecDeleteLastChar, VK_BACK, []);
AddKey(ecDeleteLastChar, VK_BACK, [ssShift]);
AddKey(ecDeleteChar, VK_DELETE, []);
AddKey(ecDeleteEOL, ord('Y'), [ssCtrl,ssShift]);
AddKey(ecDeleteLine, ord('Y'), [ssCtrl]);
AddKey(ecSelectAll, ord('A'), [ssCtrl]);
AddKey(ecToggleMode, VK_INSERT, []);
end;
function DefaultCharMapping: TKEditCharMapping;
var
I: Integer;
begin
SetLength(Result, 256);
for I := 0 to Length(Result) - 1 do
if (I < $20) or (I >= $80) then
Result[I] := '.'
else
Result[I] := AnsiChar(I);
end;
function DefaultSearchData: TKEditSearchData;
begin
with Result do
begin
ErrorReason := eseOk;
Options := [esoAll, esoFirstSearch, esoPrompt, esoTreatAsDigits];
SelStart := 0;
SelEnd := 0;
TextToFind := '';
TextToReplace := '';
end;
end;
end.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,101 @@
LazarusResources.Add('kgrid_hci_hbegin','BMP',[
'BMZ'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#3#0#0#0#3#0#0#0#1#0' '#0#0#0#0#0'$'#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#231#5#0#0#252#6#0'-'#255'2'#0#0#209#5#0
+#0#229#5#0#0#245#6#0#0#200#5#0#0#209#5#0#0#218#5#0
]);
LazarusResources.Add('kgrid_hci_hcenter','BMP',[
'BMN'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#2#0#0#0#3#0#0#0#1#0' '#0#0#0#0#0#24#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0':'#255'?'#0':'#255'?'#0#0#249#6#0#0#249#6
+#0#0#221#5#0#0#221#5#0
]);
LazarusResources.Add('kgrid_hci_hend','BMP',[
'BMZ'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#3#0#0#0#3#0#0#0#1#0' '#0#0#0#0#0'$'#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'F'#255'J'#0'm'#255'p'#0#151#255#153#0#0
+#253#6#0'.'#255'3'#0'o'#255'r'#0#0#225#5#0#0#239#6#0#21#255#27#0
]);
LazarusResources.Add('kgrid_hci_vbegin','BMP',[
'BMZ'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#3#0#0#0#3#0#0#0#1#0' '#0#0#0#0#0'$'#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#218#5#0#0#245#6#0'-'#255'2'#0#0#209#5#0
+#0#229#5#0#0#252#6#0#0#200#5#0#0#209#5#0#0#231#5#0
]);
LazarusResources.Add('kgrid_hci_vcenter','BMP',[
'BMN'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#3#0#0#0#2#0#0#0#1#0' '#0#0#0#0#0#24#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#221#5#0#0#249#6#0':'#255'?'#0#0#221#5#0
+#0#249#6#0':'#255'?'#0
]);
LazarusResources.Add('kgrid_hci_vend','BMP',[
'BMZ'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#3#0#0#0#3#0#0#0#1#0' '#0#0#0#0#0'$'#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'F'#255'J'#0'm'#255'p'#0#151#255#153#0#0
+#253#6#0'.'#255'3'#0'o'#255'r'#0#0#225#5#0#0#239#6#0#21#255#27#0
]);
LazarusResources.Add('kgrid_drag_arrow','BMP',[
'BM'#26#2#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#11#0#0#0#11#0#0#0#1#0' '#0#0#0#0#0#228
+#1#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+'5'#0#0#0#179#0#0#0'5'#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0'5'#0#0#0#179#8#175#8#255#0#0#0#179#0#0#0'5'#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0'5'#0#0#0#179#15#200#15#255'/'#227'/'#255'E'#204'E'#255
+#0#0#0#179#0#0#0'5'#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'5'#0#0#0#179#9#199#9#255','
+#226','#255'l'#236'l'#255#153#240#153#255#131#222#131#255#0#0#0#179#0#0#0'5'
+#0#0#0#0#0#0#0'5'#0#0#0#179#1#201#1#255#15#223#15#255'C'#229'C'#255#147#240
+#147#255#191#247#191#255#175#244#175#255']'#202']'#255#0#0#0#179#0#0#0'5'#0#0
+#0#179#0#0#0#255#0#0#0#255#0#0#0#255'A'#231'A'#255#147#240#147#255#191#247
+#191#255#0#0#0#255#0#0#0#255#0#0#0#255#0#0#0#179#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#255'4'#228'4'#255#130#238#130#255#179#245#179#255#0#0#0#255#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#255''''#226''''#255'l'#235'l'#255
+#156#242#156#255#0#0#0#255#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#255#21#223#21#255'A'#230'A'#255'a'#234'a'#255#0#0#0#255#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#255#7#222#7#255#21#223#21#255'!'#225
+'!'#255#0#0#0#255#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#255#0
+#0#0#255#0#0#0#255#0#0#0#255#0#0#0#255#0#0#0#0#0#0#0#0#0#0#0#0
]);
LazarusResources.Add('kgrid_sort_arrow','BMP',[
'BMf'#2#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#14#0#0#0#10#0#0#0#1#0' '#0#0#0#0#0'0'#2
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'Z'#0#0#0'Z'#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0'Z'#0#0#0#255#0#0#0#255#0#0#0'Z'#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'Z'#0#0#0#255'q'#255'q'#255'y'#255'y'
+#255#0#0#0#255#0#0#0'Z'#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0'Z'#0#0#0#255#153#255#153#255#180#255#180#255#195#255#195#255#189#255
+#189#255#0#0#0#255#0#0#0'Z'#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'Z'
+#0#0#0#255#138#255#138#255#172#255#172#255#208#255#208#255#241#255#241#255
+#225#255#225#255#189#255#189#255#0#0#0#255#0#0#0'Z'#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0'Z'#0#0#0#255'O'#255'O'#255'n'#255'n'#255#136#255#136#255#158#255#158#255
+#169#255#169#255#165#255#165#255#147#255#147#255'|'#255'|'#255#0#0#0#255#0#0
+#0'Z'#0#0#0#0#0#0#0'Z'#0#0#0#255#6#255#6#255'!'#255'!'#255'9'#255'9'#255'K'
+#255'K'#255'Y'#255'Y'#255'_'#255'_'#255']'#255']'#255'R'#255'R'#255'B'#255'B'
+#255','#255','#255#0#0#0#255#0#0#0'Z'#0#0#0#255#0#0#0#255#0#0#0#255#0#0#0#255
+#0#0#0#255#0#0#0#255#0#0#0#255#0#0#0#255#0#0#0#255#0#0#0#255#0#0#0#255#0#0#0
+#255#0#0#0#255#0#0#0#255#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
]);
LazarusResources.Add('kgrid_cursor_hresize','CUR',[
#0#0#2#0#1#0' '#0#0#15#0#15#0'0'#1#0#0#22#0#0#0'('#0#0#0' '#0#0#0'@'#0#0#0#1
+#0#1#0#0#0#0#0#128#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#255#255#255
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#3#192#0#0#2'@'#0
+#0#2'@'#0#0#2'@'#0#0#2'@'#0#0'2L'#0#0'RJ'#0#0#158'y'#0#1#0#0#128#1#0#0#128#0
+#158'y'#0#0'RJ'#0#0'2L'#0#0#2'@'#0#0#2'@'#0#0#2'@'#0#0#2'@'#0#0#3#192#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#255#255#255#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255#252'?'#255#255#252'?'#255#255#252'?'#255#255#252'?'#255#255
+#252'?'#255#255#204'3'#255#255#140'1'#255#255#0#0#255#254#0#0#127#254#0#0#127
+#255#0#0#255#255#140'1'#255#255#204'3'#255#255#252'?'#255#255#252'?'#255#255
+#252'?'#255#255#252'?'#255#255#252'?'#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
]);
LazarusResources.Add('kgrid_cursor_vresize','CUR',[
#0#0#2#0#1#0' '#0#0#15#0#15#0'0'#1#0#0#22#0#0#0'('#0#0#0' '#0#0#0'@'#0#0#0#1
+#0#1#0#0#0#0#0#128#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#255#255#255
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#1#128#0#0#2'@'#0
+#0#4' '#0#0#8#16#0#0#14'p'#0#0#2'@'#0#0#2'@'#0#1#254#127#128#1#0#0#128#1#0#0
+#128#1#254#127#128#0#2'@'#0#0#2'@'#0#0#14'p'#0#0#8#16#0#0#4' '#0#0#2'@'#0#0#1
+#128#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255#255#255#255#254#127#255#255#252'?'#255#255#248#31#255#255
+#240#15#255#255#240#15#255#255#252'?'#255#255#252'?'#255#254#0#0#127#254#0#0
+#127#254#0#0#127#254#0#0#127#255#252'?'#255#255#252'?'#255#255#240#15#255#255
+#240#15#255#255#248#31#255#255#252'?'#255#255#254#127#255#255#255#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255
]);

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,262 @@
LazarusResources.Add('tkhexeditor','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+#0#0#4'gAMA'#0#0#177#142'|'#251'Q'#147#0#0#0' cHRM'#0#0'z%'#0#0#128#131#0#0
+#249#255#0#0#128#232#0#0'u0'#0#0#234'`'#0#0':'#151#0#0#23'o'#151#169#153#212
+#0#0#4#12'IDATx'#156'b'#252#255#255'?'#3'y`?'#19#144'`'#7'b^ '#22#1'bq('#27#4
+'>'#1#241#11' ~'#3#16'@,$'#24#200#12'$X'#160#24#198#6#25'('#5#196'*@'#172#250
+#231#213#127#241#239#167#254#243#253'y'#199#254#155'M'#254#207'6n'#251#255
+#199#1#2#8'n'#1'###V'#175#0#197#25'XY'#153#25'xx8'#25'xy'#185#24#184#184'8'
+#24#216#217'Y'#193'b""'#252#12#26#26'r'#12'&Z'#26#12#218'3'#213#25#184'~'#9
+'2'#176#201's3|'#150#253#196#160#19#199#185#14#168#157#21' '#128'P|@lp'#253
+#251#252#155#129#129#137#145#129#137#27#162'}'#157#199't'#134#215'7?2'#200
+#240'q1'#252#229'gc'#224#239'V'#6#138'>'#3'*b'#248#5#16'@'#24'A'#196#200#216
+#136'da='#3'7w+'#131#148#20''''#131#158#158#16#131#137#137'0'#131#217#3'f'#6
+#149#223#252#12'o'#253#217#24#140#252'M'#25'NN^'#205#240#247#232'G'#6'i'#14
+#21#6'fA6'#6#233#185#22#12'O'#153#159#128#180#191#3#226'o'#0#1#132'a'#1#200
+'Pd'#240#245'k5'#156#189#196#178#151#129#235#154' '#3's'#160' '#131#142#182#6
+#195#183'G'#31#25#174'u\c0`'#6#26'.'#204#198' V'#175#199#192#174#202#203#240
+#227#218'O'#144#242#151' '#11#0#2#136#160#15'$%'#187#192'.'#15#10#146'g8p~'
+#31#131'>G'#12'D'#238#215'3'#134#147'yg'#24#20'>'#139'1p'#139#243'0'#240#7
+#139'2\'#149'z'#193'`'#197' '#199#240#253#251'/'#144#146'7@'#252#3' '#128#8
+#250#224#249#243'28{wF'#15'0'#249'03'#252'}'#251#147#225#221#220'/'#12#12'G>'
+'1'#136'3'#9'3p;J0'#136#214#152'0'#136's2'#131#213#253#253#251#15'D'#1#227
+#192#241#31'@'#0#17#244#129#130'B/'#131#189#189'8C|'#188'2\'#252#231#141#143
+#12#223'N'#191'e'#16'd'#226'c`'#228'`'#6')d'#248'u'#251#30#195#133'o'#31#24
+',,L'#25#152#153'AY'#4#148'G'#246#255#2#8' '#130'>x'#240#160#24#206#158#3#165
+#255'~'#254#195#240#227#199#15#134'{'#127#159'2'#8'}'#227'e`'#187#194#195#240
+'~.'#11#131'A'#162#10'X'#158#147#19#148#255#190#138#2#137'?'#0#1'D'#148#15#28
+#28'@>P'#129#139#179#136#176'3'#200'&I1'#188#186#201#196#176'o'#241#30#6#167
+#171#12#192#144#7#2'fF'#6'!'#14'U`~'#225#4#241#20#129#248';@'#0#145#228#131
+#217'P'#154'M'#129#135#129'UN'#154#193#189#200#146#225#206#191''''#12#251#150
+#158#1'["'#207#206#196#240'q'#229#3#6#142'0'#30#144'2P'#14#127#2#16'@'#4'} #'
+#211#205'`n.'#10'LEr('#234#152#249#191#130#233#192'Fo'#134#13#12'_'#24#142'/'
+#189#204#192'z'#158#133'A'#242#215'?'#6'n&'#9#134'?'#25'L'#162','#162#255'8'
+#1#2#136#17#150'{AE'#5#161#156#28#195#238#201#16#196#230#200#160#202','#203
+' ;'#209#156'A ^'#9','#254#253#195'W'#134'Ei'#211#24'x>'#177#2'c'#150#141'A'
+#239#159#2#131#176#15#235#20#225'<'#150#185#0#1#132'j'#1#194#233'`'#159#128
+'| '#208#206' '#15',_tt'#4#25'T><a'#144'Q'#147'c`f'#225'dx'#240#247'?CS_0'
+#131#175#239'\'#6'>>`'#14#150#230'b'#224#231'ge'#168#174#246'c'#184'u'#235#10
+#131#154#218'kG'#160'I'#15#1#2#8#167#5#148#128's'#231'N3'#24#25'}'#1#165#235
+#15#0#1#132#221#2'd'#128','#170'('#9'LB'#192't'#15#202'H'#223#129#197#193#243
+#183#16'qn'#14#136#248'G`'#188#8#243#1'KC'#160#158#247#155'@1'#253#27' '#128
+#240#251#0'XT'#195#249#172','#224#18#148#225#231'o'#136#24#136#15#178#232#223
+'?Tu'#8'6'#152#1#16'@LD'#251#251#207'_`'#225#251#7'b'#0#8#131#248'0'#135#160
+'9'#232#224#129#3'pm'#0#1'DB'#141#134#230';"'#1'@'#0#17#31'D'#200'l|rhA'#4#16
+'@X'#131#232#224#193#131'`'#140#194#135'y'#27#22'D'#12#144#160'@W'#135#14#0#2
+#136#145#252'V'#5'q'#0' '#128#136#143'd2'#1'@'#128#1#0#188' dE'#131#162#228
+'T'#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('tkprintpreview','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+#0#0#4'gAMA'#0#0#177#142'|'#251'Q'#147#0#0#0' cHRM'#0#0'z%'#0#0#128#131#0#0
+#249#255#0#0#128#232#0#0'u0'#0#0#234'`'#0#0':'#151#0#0#23'o'#151#169#153#212
+#0#0#6#175'IDATx'#156'b'#252#255#255'?'#3'###'#3#26'P'#7'bk fF'#151#128#1'VV'
+'fF'#1#1'^'#150#162#162#208#253#21#21#145' '#3#196#129#152#23'*'#253#9#136'_'
+#0#241#27#128#0'b'#193#162'7'#207#221#221#189'/<<'#156#153#149#149#21','#0'r'
+#196#127' '#253#239#223'?'#134'_'#191#127'3|'#250#242#157#225#213#219#247#12
+#127'~'#255'`8v'#236#240#221#7#15'^'#244')(HH'#252'y'#245'_'#252#251#169#255
+'|'#127#222#177#255'f'#147#255#179#141#219#254#255'q'#128#0'bD'#243#129#140
+#189#189#253#189#237';v'#178#190#255#240#137#225'/'#208'@'#16#128'H3'#2'-'
+#249#199#240#251#207'_'#134#239#223#127'2'#188#253#240#129#129#149#133#153'A'
+'B'#144#157#225#234#233'M'#31#149'{'#228#217'Y~'#242'p'#176#201's3'#176#169
+#179#191#150#236#254#145#6#212't'#5' '#128#208'}`'#228#229#229#205#250#225
+#211'g'#134#159'@'#151#194#12#7'9'#128#133#153#9#136'Y'#24#216#128#134'r'#252
+'a`'#224#17#20'f`'#228'fb'#16#23#17'a8'#155#193#193#255#244#198#27#6#25'>V'
+#134#191#188#140#127'EK'#255#173#1#234#2#25#240#11' '#128#152#208',`ffa'#6
+#187#150#133#153#25#138#129#134#178#178'0'#176#179#177'2pq'#178'1'#252'['#254
+#130#225'_'#251'c'#6#161#223#28#12'b'#194#252#12#23'f'#29'f'#248#127#236#27
+#131'4'#187'8'#3#179' '#27#131#232'$'#150#27',b'#140#15#129#134#188#3#226'o'
+#0#1#132#25#7#192' cf'#2#6#7#208#240#210#226'B'#6#7#7'{'#6'IIQ'#6'aa.'#134#27
+'9'''#24'4nK3'#200#6'j'#2'-'#252#193#240#231'%'#3#195#181#246#227#12#6#204'*'
+#12#204#194'l'#12'"5*'#12#187#238#175#149#214#230#146'y'#163#161'!'#247#18'd'
+#1'@'#0#161#251#0'd>'#3#19#19#19#208#18'&'#134#212#212'4'#6'C#c'#6'Y9y'#6#25
+#25'y'#134#3'WN0'#240'0rB'#212#253'bc8'#153#177#147'A'#225#179#24#3#183'('#15
+#3#127#176','#3'O'#176'"P}'#176'@v'#246#212#170#204#204'~P'#204#253#0#8' ,'
+#22#252#135'X'#0#12's'#14'NN'#134#175#223#190'1'#176#178's2|'#249#247#159#225
+#247#255#191#192't'#203#204#240#247#237'O'#134'ws'#31'00'#28#249#202' '#206
+'$'#204#192#237'('#206' Z'#163#202#240#233#243#7#134#151#239#191'3(i'#152')m'
+#218't'#220#132#129#193#241#31'@'#0'aZ'#192#0#178#128#17'l'#201#219#247#31#25
+#254#176'p0'#156'|'#244#140'AZT'#26#174#230#231#141#143#12#31#150'>c'#16'd'
+#226'c`'#228'`'#6'ib'#248'u'#251#3'0'#142#184#24#132#5#249#25#196'D'#133#24
+#132#132'x'#129'i|?3@'#0'a'#245#1'('#213#252#250#253#135#129#137#149#131'a'
+#251#149#187#12':**'#12#191#160'I'#22#4#254'~'#254#195#240#227#199#15#134#187
+#127#159'2'#188#248#246#138#225#199#149#143#12#239#231#2#243#213#245#239#192
+'T%'#196#160#166','#195#160#163#163#200#7'T'#202#9#16'@'#24#145#12#14'"F&'
+#134'g/_3'#220'|'#249#129#129'_L'#148#225#237#175#223#12#146#127'~'#194#213
+#176#136#176'3'#200'&'#169'2'#188#186#249#151'a'#223#226#131#12'NW'#25#24#228
+#192'i'#144#145'A E'#129'AIQ'#138#193#216'X'#21#148#179#5#0#2#8'k$3'#2#131
+#232#237#187#143#12'w'#223'|`'#248#250#235#23#195#251#31#191#24#190#253#250#1
+'W'#195#166#192#195#192'*'#199#206#224'>'#211#135'A"Z'#129'a'#223#159'3'#12
+#143#174#222'c'#248'~'#238#29#195#231#213'O'#25'$'#152#133#129#137'BL'#8#168
+#148#15' '#128#176#250#0#20#253#159#191'~'#5#27#254#229#203#15#134'w_'#190'1'
+#188#255#134#170#148#153#159#149#225#253#247#223#12'Q'#147#210#24#150'3'#204
+'d8'#190#244'2'#3#235'y'#22#6#201'_'#255#24#184#25'D'#24#4#180#249#193'A'#4
+#16'@'#216#131#8#24#193#255#254#254'c'#224#5'f'#176#23#159'>'#0#195'['#140
+#225#211#15'`'#156#0#173#190#241#247#1#131#234#145#191#12#255'|'#4#24#158'*'
+#253'f'#248#241#247'/'#131'Vn'#0#195#197#215#235#24#238'}}'#207#240#130#249
+#23#131#198#254#175#12#28'_'#185'D'#24'B'#24#254#2#4#16'N'#31#240#243#241'0'
+#200#11#240'0<'#127#249#150#225'70'#14'>|'#254#198#224#148#23#204' '#160'%'
+#199#240#133#135#135#225#157#18#11#195#179'w_'#24#222'}'#252#194#240#253#219
+'W'#6#139':'#31#6'9q'#17#6')qi'#134#157#187#214'3'#156'?w'#230#132#3#131#198
+'G'#128#0#194#154#138'@'#5#144#154#146'<'#195#231#215#175#24'd9'#217#25'>'
+#127#252#204#240#237#251#31#6#209'pC'#6'&3i'#134#239#154#252#12#175#127'~'#5
+#166#251#31#12'O'#158#191'c'#248#255#237#31#195#181#171#183#24#4#248'E'#24
+#128#217#133#225'9P'#236#194#133#219#175#129#198'}'#4#8' ,>``x'#252#236'%'
+#195#174'C'''#25#148#149#20#24#190#253#248#201#240#20'T<?'#127#201#192'''-'
+#193' '#12#196#224#4#203#254#157#225#237#179#215#12'|'#192#164#204#240#225#13
+#131#150#145'.'#3'70'#31#252#249#251#135#225#221#187#207#12#231#206#221#254#8
+'T'#245#5' '#128#208'-`|'#248#244'9'#195#198']'#135#25'L'#244'5'#25'$D'#4#25
+'.\'#189#205'p'#247#238'}'#6'!v'#5#134'_'#223#127'1'#220#190'|'#5#172#240#251
+'?&'#134'o/'#223'0'#188'{'#248#128#193'@K'#133#193#194'X'#23'^'#172#131#138
+#243#251#247'_'#0#147#157#227'/'#128#0'B'#182'@'#148#133#133#181#129#141'G'
+#136#193'HW'#157'AIV'#146#225'.0'#7'_'#186'v'#131'AEV'#140#225#194#197's'#12
+#23'O'#255'e'#224#227#231'g'#248#15#204't'#31#128#245#129#152#176#0#131#185
,#161'6'#131#146#156#20#195#223'?'#127#24#152#217#216#192#241#247#15#20#12'P'
+#0#16'@0'#11'D'#129#229#244#222#144#184't]'#31'Ow'#6'e'#160#134'G'#192'`:t'
+#236#20#131#158#154'<'#131#150#154'"'#131#181#153#1'0o'#188'g'#248#0#140#15
+'}}}'#6'!'#1'>'#6'n.N'#244#16'F'#196'#'#20#0#4#16#204#130#249'v'#158#193#186
+#22#150'V'#12#252#188'<'#12#183#238'=f8}'#233':'#131#139#189'%'#131#149#177
+#30'$'#236#128#254#255#11'L'#146#204#204'8'#171'i0'#0#213#130#127#254#128'+'
+#171#191' '#2' '#128#160#22'0r'#139'KJ'#131'S'#207#165'k'#183#24#238'>|'#194
+#224'lk'#198'`'#172#171#201#240#243#215'o'#20#3'@U&.'#0#170#179#223#188#251
+#192#176'w'#207#30#144#166's 1'#128#0#130'Z'#240#191'y'#255#182'5'#214','#192
+'Hx'#3'L'#154'O'#239'^e'#16#229#250#199'p'#253#226'Y'#188#174'E'#7#191#129'.'
+#223#182'e'#243#223'S''O'#148#0#185'O@b'#0#1#132'\'#233#187#2#233#6' '#253#11
+'('#6#162#149#25#240'4[p'#0#144#247#142#2#241'M'#176#179#129'f'#3#4#24#0#252
+'1e'#249#212#25#172'k'#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('tkprintpreviewdialog','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+#0#0#4'gAMA'#0#0#177#142'|'#251'Q'#147#0#0#0' cHRM'#0#0'z%'#0#0#128#131#0#0
+#249#255#0#0#128#232#0#0'u0'#0#0#234'`'#0#0':'#151#0#0#23'o'#151#169#153#212
+#0#0#5#198'IDATx'#156'b'#252#255#255'?'#3'y`?'#19#144'`'#7'b^ '#22#1'bq('#27
+#4'>'#1#241#11' ~'#3#16'@,'#251#246#29#248#191'k'#215'e'#130#198'111'#194'1#'
+'##'#3'33'#19#3';;'#11#3'//'#7#131#136#8#15#131#176'07'#3#215#127#22#6#166
+''''#255#24'Dx'#4#25'$D?Fr'#219#255'?'#14#16'@, '#195#195#211#146#240#26#14
+'4'#143#129#9'd('#19#136'f'#0'['#0#18'S'#191'u'#144#225#169#158'#'#131#216
+#179'+'#12'w3_00'#127#254#201#192'&'#207#205#240'W'#253';'#3'w'#247#255#31'@'
+#173#172#0#1#196#2'2'#224#228#205'/'#184']'#206#8'R'#197#200#192#205#193#196
+#192#3#196#28'l'#140#12#236'?'#255'2X'#254#186#206'p'#244#212'U'#6'ku9'#134
+#213#133#187#25#4'/'#241'2'#200#240'I2'#252#229'cax'#225#246#159#225#243'E'
+#254#245#250#250#31#229#1#2#8'l'#193#229#7'_qZ'#192#6'4'#156#159#155#153'AZ'
+#152#133#129#159#139#149'Ax'#227'S'#6#193'G?'#24#30#165#170'2XgJ3'#156'\t'#11
+#232'B'#6#6'i'#14'q'#6'fA6'#6#134'.]'#134#143#31'.3'#176#255#249#11#210#254
+#13' '#128#192#22#240'>'#220#138#211#2'..6'#6#17'q'#1#6'9q'#9#134'giG'#24#248
+'nK2'#8#7'j2H'#8'}c'#248#246#225'7'#195#181#246#19#12#6#204#170#12#204#194'l'
+#12#130'U'#210#12#247'Y'#238'3'#188'}'#251#133'A@'#0#28#223#223#0#2#8'lAGG.'
+#134#193#215#175'_gX'#180'h'#17'0'#172#217#25'8'#217#254'0'#8#243#243'2,'#187
+'r'#140#193#132'#'#6','#255#255#23#23#195#201#188#189#12#10#159#197#25#184
+#197'y'#24#248#131#229#25'D"'#245#193#201#233#248#241'E'#12'rr`'#31#252#0#8
+' '#22#152#129#15#30#220#129#27#254#237#219'7'#134#137#19#167'2'#180'ut'#2'S'
+#13#19#3#11#11'3'#3#27'+3'#195#239#255#147#24#152#129#240#239#219#159#12#239
+#230#2#131#230#200''''#6'q&a'#6'nGq'#6#209#26'e'#160#190#247'@s'#30'3'#252
+#252#249#135#225#223'?P'#242'w'#252#7#16'@,'#12'X'#192#157';w'#24'\'#221#220
+#25'>'#127#253#206#192#2'L:'#28#236#172#192#136'f'#135#203#255#188#241#145
+#225#219#233'?'#12#130'L|'#12#140#28#204'@'#239'00'#252#186#253#141#129'Y'
+#157#157#129#21#232#16'P'#242#5'%g`^a'#6#8' &l'#22#128#242#30'()'#178#178#176
+'0'#236#219#187#131#225#241#227#187#12#159'>>'#131#203#255#253#252#135#225
+#199#143#31#12'w'#255'>ex'#241#237#21#195#143'+'#31#25#222#207'}'#196#240#239
+#218'w'#6#30#30'Np'#190'`c'#3#187#157#19' '#128#176#250#0'j'#13#208#2'f'#6'Y'
+'Yy'#6#14#14'.`ze'#133#203#176#136#176'3'#200'&'#169'1'#188#186#249#159'a'
+#223#226#253#12'NW'#25#24#228'@'#18#204#140#12'<'#9#162#12#210#210#130'@=l'
+#160'('#16#0#8' '#156#22#128'|'#193#2#244#129#128#160#8#195#163'O?'#24#4#196
+#197#225'rl'#10'<'#12#172'rl'#12#238'E~'#12'w'#254'=f'#216#183#244#12#216#18
+'yv&'#6'f~'#22#6#9#23'^'#134#127#236'`'#7#241#1#4#16#214' '#130#135#245#175
+'_'#12#23#30'<g'#248#195#198#206#240#235#31'j'#153#197#204#207#198#240#245
+#199'w'#134#244#25#5#12#146#209#242#12#199#255'\fxv'#254#1#195#231#157'/'#24
+'x'#246#0#19#198#31'Fp'#16#1#4#16'N'#11'@'#133#224#171'7'#239#25#238'~'#250
+#198#240#252#215#127#134'G'#31#191'00102'#220#248#251#128#225#211#145#231#12
+#207'o'#191'g8}'#231#25#195#7#160#184'K'#190#23#3#159#187'8'#195#3#139'O'#12
+'g'#184#175'1'#188#219#7#140#143#139#223'A'#198#252#5#8' '#140' '#250#247#159
+#17#26#3#12#12'_'#190'}gx'#249#241'+'#195#191'W'#239#25#24#255#254'd'#176#202
+#242'g'#224#212'Qbx'#201#195#195#240'F'#138#129#225#245#227#247#12#146'\'#2
+#12#239#191'|cpl'#241'd'#144#145'Q`x'#247#238#29#195#249#243#183#25#20#21#193
+'n'#255#8#16'@'#24#22'01'#254#135'G'#2#7#27'+'#3#255#255#191#12#223'?}b'#248
+#6','#135'$'#162#205#24#190#3#173'~'#247#247#31#195#195'Wo'#25'X'#191#253'd'
+#248#247#231'?'#195#251#15#159#129'i'#255#7#176'D'#253#201#240#254#253#23#134
+'g'#207'>2HJ'#10#131'-'#0#8' '#188'A'#196#195#205#197' '#2'L'#25'L@'#131'8X'
+#216#24#184#152'A'#185#154#139#225#215'/F'#134#175#31#190'1p|'#255#202' /+'
+#197#240#245#235#15#134'/_'#190#3#197#127#3#217#223#193'E'#197#175'_'#127'@'
+#198'|'#1#8' '#156#22#220#184#243#144#225#220#149'['#12#14#22#134#12#188#159
+#222'3||'#0#12#215#207'_'#25#254#3#13#250#249#238#19#3#203#235#23#12#158#246
+'V'#192'L'#200#198#240#7'X'#176#129#240#191#127#255#24'~'#255#6#250#248#251
+'o'#134#191'@_'#2's'#242'/'#128#0#194#176#0#148#129#166#205#152#205' ,.'#197
+'`'#172#171#206'p'#251#222'#'#6#3'5y'#6#158#127#191#25'n]'#187#201'p'#237#226
+#21#6#150'Oo'#24#2#156'-'#25#196#132#249#193#25#242#31#158'Z'#17' '#128'P'
+#226#128#137#137#153#161#180#188#154'A'#203#216#142#193#216'@'#151#225#212
+#133'k'#12'"'#2#220#12#186#234'J@'#23#253#5#7#155#188#188'<'#216'Pd'#0'r=##+'
+#3'6'#0#16'@p'#11#238#221'{'#2#166#223#190#253#192#160#207#203#207#176'i'#251
+'^'#6#3']-'#6#11#19#3#20#13#31'>}F'#243#241'O'#134#237#219#182'2'#196'D'#199
+#192#205'@'#6#0#1#196'X^>'#9#197#127#239#223#191'f8xx+'#216#149#194#192'\'
+#140#230'X'#12#0#10#29'MM'#19'`'#10#18'G'#17'ws'#211'eprr`'#4#8' '#176#246
+#189'{'#247#147#219#180#192#11'@'#22#0#4#16'#'#249#205#22#226#0'@'#128#1#0'R'
,#186#239#253'E'#255#199#222#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('tkprintsetupdialog','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+#0#0#4'gAMA'#0#0#177#142'|'#251'Q'#147#0#0#0' cHRM'#0#0'z%'#0#0#128#131#0#0
+#249#255#0#0#128#232#0#0'u0'#0#0#234'`'#0#0':'#151#0#0#23'o'#151#169#153#212
+#0#0#5#227'IDATx'#156'b'#252#255#255'?'#3'y`?'#19#144'`'#7'b^ '#22#1'bq('#27
+#4'>'#1#241#11' ~'#3#16'@,'#251#246#29#248#191'k'#215'e'#130#198'111'#194'1#'
+'##'#3'33'#19#3';;'#11#3'//'#7#131#136#8#15#131#176'07'#3#215#127#22#6#166
+''''#255#24'Dx'#4#25'$D?Fr'#219#255'?'#14#16'@, '#195#195#211#146#240#26#14
+'4'#143#129#9'd('#19#136'f'#0'['#0#18'S'#191'u'#144#225#169#158'#'#131#216
+#179'+'#12'w3_00'#127#254#201#192'&'#207#205#240'W'#253';'#3'w'#247#255#31'@'
+#173#172#0#1#196#2'2'#224#228#205'/'#184']'#206#8'R'#197#200#192#205#193#196
+#192#3#196#28'l'#140#12#236'?'#255'2X'#254#186#206'p'#244#212'U'#6'ku9'#134
+#213#133#187#25#4'/'#241'2'#200#240'I2'#252#229'cax'#225#246#159#225#243'E'
+#254#245#250#250#31#229#1#2#8'l'#193#229#7'_qZ'#192#6'4'#156#159#155#153'AZ'
+#152#133#129#159#139#149'Ax'#227'S'#6#193'G?'#24#30#165#170'2XgJ3'#156'\t'#11
+#232'B'#6#6'i'#14'q'#6'fA6'#6#134'.]'#134#143#31'.3'#176#255#249#11#210#254
+#13' '#128#192#22#240'>'#220#138#211#2'..6'#6#17'q'#1#6'9q'#9#134'giG'#24#248
+'nK2'#8#7'j2H'#8'}c'#248#246#225'7'#195#181#246#19#12#6#204#170#12#204#194'l'
+#12#130'U'#210#12#247'Y'#238'3'#188'}'#251#133'A@'#0#28#223#223#0#2#8'lAGG.V'
+#195'?||'#207#240#239#223'_'#6#22#22'f'#6'66V'#134#244'+]'#12'&'#28'1`'#185
+#255#191#248#25'N'#230#237'`P'#248','#206#192'-'#206#195#192#31','#207' '#18
+#169#15'NN'#199#143'/b'#144#147#3#251#224#7'@'#0#177#192#12'{'#240#224#14#134
+#5'?'#127#255'dPTP'#134#164#26'&f'#134#223#255#255'20'#3#225#223#183'?'#25
+#222#205#189#203#192'p'#228#19#131'8'#147'0'#3#183#163'8'#131'h'#141'2'#195
+#183'o'#239#129#230'<f'#248#249#243#15#208'a'#160#228#239#248#15' '#128#152
+#176#185#252#241#147''''#12's'#231#205#5#186#156#149#129#141#149#3#24#201#236
+#192#228#201#130#176#248#198'G'#134#15'K'#31'3'#8'2'#241'10r0'#3#189#195#192
+#240#235#246'7p'#210'eee'#6'''_Pr'#6#230#21'f'#128#0#194'j'#193#237'['#183#24
+#152'Y'#217#224#252#255#12#127#128#248#31#156#255#247#243#31#134#31'?~0'#220
+#253#251#148#225#197#183'W'#12'?'#174'|dx?'#247#17#195#191'k'#223#25'xx8'#193
+#249#130#141#13#236' N'#128#0'b'#193'4'#158#129#225#212#153#211#12#255#128'9'
+#252#227#167#143#12#127#254#255#2'z'#249#7'05'#177#194#229'YD'#216#25'd'#147
+'T'#24'^'#221#252#204#176'o'#241'i'#6#167#171#12#12'r '#9'fF'#6#158#4'Q'#6'i'
+'iA'#6#14#14#144#3#127#8#0#4#16'V'#11#30'<z'#10#166#223#189'}'#199#240#247
+#207#31#134'?'#127'~1'#176'03'#194#229#217#20'x'#24'X'#229'8'#24#220#139#172
+#24#238#252'{'#200#176'o'#233#25#176'%'#242#236'L'#12#204#252','#12#18'.'#188
+#12#255#216#193#14#226#3#8' '#20#11#190'|'#249#194#240#236#217's'#134#156#172
+#12#134'}'#7#14'0'#156'?'#127#1#152'L9'#25#216#128#225',).'#132#226#8'f~'#160
+#15'?'#254'gH'#158#146#203'0'#15#8#143'/'#189#204#192'z'#158#133'A'#242#215
+'?'#6#30#6'Q'#134'oA`'#7'q'#2#4#16'J'#28#188#255#240#158'AKK'#155#193#199#203
+#15'X'#150'H0H'#203'H3'#188'x'#249#146#225#211#7'`'#164#190#255#200#192#196
+#192#200'p'#227#239#3#134'OG'#158'3|'#188#243#137#225#254#253#183#12#28#236
+'R'#12#17#205#201#12#2#30#18#12#15',>1'#156#225#190#198#240'n'#31'0>.~'#7'G'
+#23'@'#0#161#248#0'T'#178#254#250#253#155#225#243#151#143#12'/^'#191'f'#16
+#145#16'ex'#246#226'9'#3#23''''#27'0'#243#240'3'#216'%'#218'2'#240'iK1|'#226
+'fg'#248','#247#150#225#246#149#135#12#26#26#230#12#191#24#255'2x'#244#6'1'#8
+#11#137'1'#188'{'#247#14#232#243#219#12#138#138'`'#183#127#4#8' '#140'8'#248
+#245#235#7#195#253#7'w'#25#222#0#195#127#215#238'}@K'#129'^'#230#230#0#230'L'
+#30#6#17'e>'#134#207#255#238'1'#252'y'#255#151#225#219#211'_'#12'?'#128#233
+#253#205#149#205#12#31'8'#213#24'~'#255#250#5't'#8'?'#195#251#247#160'`'#254
+#200' ))'#12#182#0' '#128'0,'#248#3',CXYY'#25#244#244't'#24'n'#221#190#203
+#192#2'L'#207#172',l'#192#224'a'#1#198#209#127#6'&'#150#223#12#255#129#153#8
+#232'Q'#6#21'eu'#6#1'M'#15#134#239'/_'#1#227#227'9'#208'q'#191#25#190'~'#253
+#14'.*~'#253#250#3#142'V'#128#0'B'#177#0'd'#240#206'];'#128'.'#251#9#230#203
+#203'H0'#128#162#10'\<3Ah'#6#6'Hjb'#4#6#231#219#215'/'#25#166'L'#157#10#204
+'Xl'#12#22'f'#22#192#220#251#15'h'#241'_'#134#239#223#127'3'#252#253#11#202
+'7'#142#191#0#2#8#197#2'I'#9'I'#134'g'#207'_0|'#251#250#133'AS['#147#225#210
+#165'k'#232#30'D'#1#250#250#218#12#215#174'\'#3#6#159'0'#131#188#188'<'#208
+#213#191'0'#212#0#4#16#138#5'L'#192#242'FCC'#131'a'#214#172#185#12#206#174
+#206#12#188#252#2'x-'#224#227#229'fX'#184'p9CFj2'#176#172#194'Z(0'#0#4#16#220
+#130'{'#247#158#128'ie'#5'5'#134#142#230'f'#134#163''''#142#130'k'#173#223
+#191#255#128'#'#240'/'#176'T'#5#149'9'#140'@G'#128#202#27'6`p'#254#3#6'Wk}='
+#131#162#146'2'#195#213'k'#152#133'%'#8#0#4#16#216#130#138#138#201#24#18'r'
+#178'Z'#12#220'\'#236#12#191#129'9'#249#215#239'_'#12#255#128#145#255#31#236
+'K&p\'#177#178#178#0'K'#207'_'#12#251#15#222#5'c\'#0' '#128#192'1'#182'w'#239
,'~r'#155#22'x'#129#147#147#3'#@'#0'1'#146#223'l!'#14#0#4#24#0'/h'#237#236'7['
+#12#214#0#0#0#0'IEND'#174'B`'#130
]);

View File

@ -0,0 +1,36 @@
unit khexeditordesign;
{$include kcontrols.inc}
interface
procedure Register;
implementation
{$IFNDEF FPC}
{$R *.dcr}
{$ENDIF}
uses
Classes, KControls, KDialogs, KHexEditor
{$IFDEF FPC}
, LResources
{$ENDIF}
;
procedure Register;
begin
RegisterComponents('TK', [
TKHexEditor,
TKPrintPreview,
TKPrintSetupDialog,
TKPrintPreviewDialog
]);
end;
{$IFDEF FPC}
initialization
{$i khexeditordesign.lrs}
{$ENDIF}
end.

View File

@ -0,0 +1,114 @@
<?xml version="1.0"?>
<CONFIG>
<Package Version="4">
<PathDelim Value="\"/>
<Name Value="KHexEditorLaz"/>
<AddToProjectUsesSection Value="True"/>
<CompilerOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<SearchPaths>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<UseAnsiStrings Value="False"/>
</SyntaxOptions>
</Parsing>
<Other>
<Verbosity>
<ShowHints Value="False"/>
</Verbosity>
<CompilerMessages>
<UseMsgFile Value="True"/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Version Major="1" Minor="5"/>
<Files Count="16">
<Item1>
<Filename Value="kcontrols.lrs"/>
<Type Value="LRS"/>
</Item1>
<Item2>
<Filename Value="kcontrols.pas"/>
<UnitName Value="KControls"/>
</Item2>
<Item3>
<Filename Value="khexeditordesign.lrs"/>
<Type Value="LRS"/>
</Item3>
<Item4>
<Filename Value="khexeditordesign.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="khexeditordesign"/>
</Item4>
<Item5>
<Filename Value="kdialogs.pas"/>
<UnitName Value="KDialogs"/>
</Item5>
<Item6>
<Filename Value="kfunctions.pas"/>
<UnitName Value="KFunctions"/>
</Item6>
<Item7>
<Filename Value="kgraphics.pas"/>
<UnitName Value="KGraphics"/>
</Item7>
<Item8>
<Filename Value="khexeditor.pas"/>
<UnitName Value="KHexEditor"/>
</Item8>
<Item9>
<Filename Value="kprintpreview.lfm"/>
<Type Value="LFM"/>
</Item9>
<Item10>
<Filename Value="kprintpreview.lrs"/>
<Type Value="LRS"/>
</Item10>
<Item11>
<Filename Value="kprintpreview.pas"/>
<UnitName Value="KPrintPreview"/>
</Item11>
<Item12>
<Filename Value="kprintsetup.lfm"/>
<Type Value="LFM"/>
</Item12>
<Item13>
<Filename Value="kprintsetup.lrs"/>
<Type Value="LRS"/>
</Item13>
<Item14>
<Filename Value="kprintsetup.pas"/>
<UnitName Value="KPrintSetup"/>
</Item14>
<Item15>
<Filename Value="kwidewinprocs.pas"/>
<UnitName Value="KWideWinProcs"/>
</Item15>
<Item16>
<Filename Value="kcontrols.inc"/>
<Type Value="Include"/>
</Item16>
</Files>
<Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="2">
<Item1>
<PackageName Value="Printer4Lazarus"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
<MinVersion Major="1" Valid="True"/>
</Item2>
</RequiredPkgs>
<UsageOptions>
<UnitPath Value="$(PkgOutDir)"/>
</UsageOptions>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
</PublishOptions>
</Package>
</CONFIG>

View File

@ -0,0 +1,22 @@
{ This file was automatically created by Lazarus. Do not edit!
This source is only used to compile and install the package.
}
unit KHexEditorLaz;
interface
uses
KControls, khexeditordesign, KDialogs, KFunctions, KGraphics, KHexEditor,
KPrintPreview, KPrintSetup, KWideWinProcs, LazarusPackageIntf;
implementation
procedure Register;
begin
RegisterUnit('khexeditordesign', @khexeditordesign.Register);
end;
initialization
RegisterPackage('KHexEditorLaz', @Register);
end.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,228 @@
{ @abstract(This unit contains print preview form.)
@author(Tomas Krysl (tk@tkweb.eu))
@created(18 Sep 2009)
@lastmod(20 Jun 2010)
Copyright � 2009 Tomas Krysl (tk@@tkweb.eu)<BR><BR>
<B>License:</B><BR>
This code is distributed as a freeware. You are free to use it as part
of your application for any purpose including freeware, commercial and
shareware applications. The origin of this source code must not be
misrepresented; you must not claim your authorship. You may modify this code
solely for your own purpose. Please feel free to contact the author if you
think your changes might be useful for other users. You may distribute only
the original package. The author accepts no liability for any damage
that may result from using this code. }
unit KPrintPreview;
{$include kcontrols.inc}
interface
uses
{$IFDEF FPC}
LCLType, LCLIntf, LResources,
{$ELSE}
Windows, Messages, ToolWin, ImgList,
{$ENDIF}
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ActnList, Buttons, StdCtrls,
ExtCtrls, KControls;
type
{ TKPrintPreviewForm }
TKPrintPreviewForm = class(TForm)
ILMain: TImageList;
ALMain: TActionList;
ACPageFirst: TAction;
ACPageLast: TAction;
ACPageNext: TAction;
ACPagePrevious: TAction;
ACClose: TAction;
ILMainDis: TImageList;
ToBMain: TToolBar;
TBPageFirst: TToolButton;
TBPagePrevious: TToolButton;
ToolButton1: TToolButton;
ToolButton3: TToolButton;
TBPageNext: TToolButton;
TBPageLast: TToolButton;
PNPage: TPanel;
EDPage: TEdit;
UDPage: TUpDown;
ToolButton6: TToolButton;
PNScale: TPanel;
CoBScale: TComboBox;
TBClose: TToolButton;
Preview: TKPrintPreview;
TBPrint: TToolButton;
ToolButton4: TToolButton;
ACPrint: TAction;
procedure CoBScaleExit(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure ACPageFirstExecute(Sender: TObject);
procedure ACPageFirstUpdate(Sender: TObject);
procedure ACPagePreviousExecute(Sender: TObject);
procedure ACPageNextExecute(Sender: TObject);
procedure ACPageNextUpdate(Sender: TObject);
procedure ACPageLastExecute(Sender: TObject);
procedure ACCloseExecute(Sender: TObject);
procedure ACCloseUpdate(Sender: TObject);
procedure EDPageExit(Sender: TObject);
procedure UDPageClick(Sender: TObject; Button: TUDBtnType);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure PreviewChanged(Sender: TObject);
procedure ACPrintExecute(Sender: TObject);
procedure ACPrintUpdate(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
procedure ScaleChanged;
{ Private declarations }
public
{ Public declarations }
end;
implementation
uses
KFunctions;
procedure TKPrintPreviewForm.FormCreate(Sender: TObject);
begin
CoBScale.ItemIndex := 9; // page width
Preview.DoubleBuffered := True;
end;
procedure TKPrintPreviewForm.FormShow(Sender: TObject);
begin
UDPage.Min := Preview.StartPage;
UDPage.Max := Preview.EndPage;
end;
procedure TKPrintPreviewForm.CoBScaleExit(Sender: TObject);
begin
ScaleChanged;
end;
procedure TKPrintPreviewForm.ACPageFirstExecute(Sender: TObject);
begin
Preview.FirstPage;
end;
procedure TKPrintPreviewForm.ACPageFirstUpdate(Sender: TObject);
begin
TAction(Sender).Enabled := Preview.Page > Preview.StartPage;
end;
procedure TKPrintPreviewForm.ACPagePreviousExecute(Sender: TObject);
begin
Preview.PreviousPage;
end;
procedure TKPrintPreviewForm.ACPageNextExecute(Sender: TObject);
begin
Preview.NextPage;
end;
procedure TKPrintPreviewForm.ACPageNextUpdate(Sender: TObject);
begin
TAction(Sender).Enabled := Preview.Page < Preview.EndPage;
end;
procedure TKPrintPreviewForm.ACPageLastExecute(Sender: TObject);
begin
Preview.LastPage;
end;
procedure TKPrintPreviewForm.ACPrintExecute(Sender: TObject);
begin
Preview.Control.PrintOut;
end;
procedure TKPrintPreviewForm.ACPrintUpdate(Sender: TObject);
begin
TAction(Sender).Enabled := Assigned(Preview.Control) and Preview.Control.CanPrint;
end;
procedure TKPrintPreviewForm.ACCloseExecute(Sender: TObject);
begin
Close;
end;
procedure TKPrintPreviewForm.ACCloseUpdate(Sender: TObject);
begin
TAction(Sender).Enabled := True;
end;
procedure TKPrintPreviewForm.EDPageExit(Sender: TObject);
begin
Preview.Page := MinMax(StrToIntDef(EDPage.Text, Preview.Page), Preview.StartPage, Preview.EndPage);
EDPage.Text := IntToStr(Preview.Page);
end;
procedure TKPrintPreviewForm.UDPageClick(Sender: TObject; Button: TUDBtnType);
begin
EDPageExit(nil);
end;
procedure TKPrintPreviewForm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then
begin
Close;
Key := 0;
end;
end;
procedure TKPrintPreviewForm.PreviewChanged(Sender: TObject);
begin
EDPage.Text := IntToStr(Preview.Page);
end;
procedure TKPrintPreviewForm.ScaleChanged;
var
S: string;
begin
S := CoBScale.Text;
if CoBScale.Items.IndexOf(S) < 0 then
CoBScale.ItemIndex := -1;
case CoBScale.ItemIndex of
-1:
begin
while (S <> '') and not CharInSetEx(S[Length(S)], ['0'..'9']) do Delete(S, Length(S), 1);
Preview.Scale := StrToIntDef(S, 100);
end;
0: Preview.Scale := 25;
1: Preview.Scale := 50;
2: Preview.Scale := 75;
3: Preview.Scale := 100;
4: Preview.Scale := 125;
5: Preview.Scale := 150;
6: Preview.Scale := 200;
7: Preview.Scale := 500;
end;
case CoBScale.ItemIndex of
-1:
begin
Preview.ScaleMode := smScale;
CobScale.Text := Format('%d %%', [Preview.Scale]);
end;
0..7: Preview.ScaleMode := smScale;
8: Preview.ScaleMode := smWholePage;
9: Preview.ScaleMode := smPageWidth;
end;
end;
{$IFDEF FPC}
initialization
{$i kprintpreview.lrs}
{$ELSE}
{$R *.dfm}
{$ENDIF}
end.

View File

@ -0,0 +1,427 @@
object KPrintSetupForm: TKPrintSetupForm
Left = 808
Top = 247
ActiveControl = CBFitToPage
BorderStyle = bsDialog
Caption = 'Page setup'
ClientHeight = 357
ClientWidth = 464
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = True
Position = poScreenCenter
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object GBFileToPrint: TGroupBox
Left = 8
Top = 8
Width = 449
Height = 45
Caption = 'Title of printed document:'
TabOrder = 0
object EDTitle: TEdit
Left = 8
Top = 16
Width = 432
Height = 21
TabOrder = 0
Text = 'EDTitle'
end
end
object GBPrintOptions: TGroupBox
Left = 8
Top = 109
Width = 249
Height = 105
Caption = 'Print options:'
TabOrder = 1
object Label1: TLabel
Left = 162
Top = 23
Width = 29
Height = 13
Caption = 'Scale:'
Color = clBtnFace
FocusControl = EDPrintScale
ParentColor = False
end
object CBFitToPage: TCheckBox
Left = 8
Top = 21
Width = 70
Height = 17
Caption = '&Fit to page'
TabOrder = 0
OnClick = EDTopExit
end
object CBPageNumbers: TCheckBox
Left = 8
Top = 40
Width = 86
Height = 17
Caption = 'Pa&ge numbers'
TabOrder = 1
OnClick = CBPageNumbersClick
end
object CBUseColor: TCheckBox
Left = 8
Top = 59
Width = 62
Height = 17
Caption = '&Use color'
TabOrder = 2
OnClick = CBPageNumbersClick
end
object EDPrintScale: TEdit
Left = 162
Top = 39
Width = 48
Height = 21
TabOrder = 3
OnExit = EDTopExit
end
object CBPaintSelection: TCheckBox
Left = 8
Top = 78
Width = 87
Height = 17
Caption = 'Pa&int selection'
TabOrder = 4
OnClick = CBPageNumbersClick
end
object CBPrintTitle: TCheckBox
Left = 134
Top = 78
Width = 61
Height = 17
Caption = 'Print tit&le'
TabOrder = 5
OnClick = CBPageNumbersClick
end
end
object BUPrint: TButton
Left = 89
Top = 325
Width = 74
Height = 25
Caption = '&Print'
TabOrder = 4
OnClick = BUPrintClick
end
object BUCancel: TButton
Left = 383
Top = 325
Width = 74
Height = 25
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 5
end
object GBMargins: TGroupBox
Left = 264
Top = 109
Width = 193
Height = 211
Caption = 'Margins:'
TabOrder = 3
object LBMarginUnits: TLabel
Left = 8
Top = 23
Width = 62
Height = 13
Caption = 'Margin u&nits:'
Color = clBtnFace
FocusControl = CoBMarginUnits
ParentColor = False
end
object LBLeft: TLabel
Left = 8
Top = 86
Width = 23
Height = 13
Caption = 'Left:'
Color = clBtnFace
FocusControl = EDLeft
ParentColor = False
end
object LBRight: TLabel
Left = 102
Top = 86
Width = 29
Height = 13
Caption = 'Right:'
Color = clBtnFace
FocusControl = EDRight
ParentColor = False
end
object LBTop: TLabel
Left = 9
Top = 131
Width = 22
Height = 13
Caption = 'Top:'
Color = clBtnFace
FocusControl = EDTop
ParentColor = False
end
object LBBottom: TLabel
Left = 102
Top = 131
Width = 38
Height = 13
Caption = 'Bottom:'
Color = clBtnFace
FocusControl = EDBottom
ParentColor = False
end
object LBUnitsLeft: TLabel
Left = 58
Top = 105
Width = 7
Height = 13
Caption = 'A'
Color = clBtnFace
ParentColor = False
end
object LBUnitsTop: TLabel
Left = 58
Top = 150
Width = 7
Height = 13
Caption = 'A'
Color = clBtnFace
ParentColor = False
end
object LBUnitsRight: TLabel
Left = 152
Top = 105
Width = 7
Height = 13
Caption = 'A'
Color = clBtnFace
ParentColor = False
end
object LBUnitsBottom: TLabel
Left = 152
Top = 150
Width = 7
Height = 13
Caption = 'A'
Color = clBtnFace
ParentColor = False
end
object CoBMarginUnits: TComboBox
Left = 8
Top = 39
Width = 176
Height = 21
Style = csDropDownList
ItemHeight = 13
TabOrder = 0
OnChange = CoBMarginUnitsChange
Items.Strings = (
'milimeters'
'centimeters'
'inches'
'hundredths of inches')
end
object CBMirrorMargins: TCheckBox
Left = 8
Top = 181
Width = 86
Height = 17
Caption = '&Mirror margins'
TabOrder = 5
OnClick = CBPageNumbersClick
end
object EDLeft: TEdit
Left = 8
Top = 102
Width = 48
Height = 21
TabOrder = 1
OnExit = EDTopExit
end
object EDRight: TEdit
Left = 102
Top = 102
Width = 48
Height = 21
TabOrder = 2
OnExit = EDTopExit
end
object EDTop: TEdit
Left = 8
Top = 147
Width = 48
Height = 21
TabOrder = 3
OnExit = EDTopExit
end
object EDBottom: TEdit
Left = 102
Top = 147
Width = 48
Height = 21
TabOrder = 4
OnExit = EDTopExit
end
end
object GBPageSelection: TGroupBox
Left = 8
Top = 215
Width = 249
Height = 105
Caption = 'Page selection:'
TabOrder = 2
object LBRangeTo: TLabel
Left = 163
Top = 51
Width = 14
Height = 13
Caption = 'to:'
Color = clBtnFace
ParentColor = False
end
object LBCopies: TLabel
Left = 8
Top = 78
Width = 87
Height = 13
Caption = 'Number of &copies:'
Color = clBtnFace
FocusControl = EDCopies
ParentColor = False
end
object RBAll: TRadioButton
Left = 8
Top = 22
Width = 61
Height = 17
Caption = '&All pages'
Checked = True
TabOrder = 0
TabStop = True
OnClick = RBAllClick
end
object RBRange: TRadioButton
Left = 8
Top = 48
Width = 78
Height = 17
Caption = '&Range from:'
TabOrder = 1
OnClick = RBAllClick
end
object RBSelectedOnly: TRadioButton
Left = 128
Top = 22
Width = 82
Height = 17
Caption = 'Selected &only'
TabOrder = 2
OnClick = RBAllClick
end
object EDRangeFrom: TEdit
Left = 108
Top = 46
Width = 48
Height = 21
TabOrder = 3
OnExit = EDTopExit
end
object EDRangeTo: TEdit
Left = 193
Top = 46
Width = 48
Height = 21
TabOrder = 4
OnExit = EDTopExit
end
object EDCopies: TEdit
Left = 126
Top = 73
Width = 48
Height = 21
TabOrder = 5
end
object CBCollate: TCheckBox
Left = 179
Top = 75
Width = 51
Height = 17
Caption = 'Collate'
TabOrder = 6
OnClick = CBPageNumbersClick
end
end
object BUPreview: TButton
Left = 8
Top = 325
Width = 75
Height = 25
Caption = 'Previe&w...'
TabOrder = 6
OnClick = BUPreviewClick
end
object BUOk: TButton
Left = 303
Top = 325
Width = 74
Height = 25
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 7
end
object GBPrinter: TGroupBox
Left = 8
Top = 56
Width = 449
Height = 50
Caption = 'Printer settings'
TabOrder = 8
object LBPrinterName: TLabel
Left = 8
Top = 20
Width = 65
Height = 13
Caption = 'Printer name:'
Color = clBtnFace
FocusControl = EDCopies
ParentColor = False
end
object CoBPrinterName: TComboBox
Left = 112
Top = 17
Width = 206
Height = 21
ItemHeight = 13
TabOrder = 0
Text = 'CoBPrinterName'
OnChange = EDTopExit
end
object BUConfigure: TButton
Left = 328
Top = 15
Width = 113
Height = 25
Caption = 'Configure...'
TabOrder = 1
OnClick = BUConfigureClick
end
end
object PSDMain: TPrinterSetupDialog
Left = 416
Top = 29
end
end

View File

@ -0,0 +1,423 @@
object KPrintSetupForm: TKPrintSetupForm
Left = 838
Height = 357
Top = 417
Width = 464
ActiveControl = EDTitle
BorderStyle = bsDialog
Caption = 'Page setup'
ClientHeight = 357
ClientWidth = 464
Font.Height = -11
Font.Name = 'Tahoma'
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '0.9.29'
object GBFileToPrint: TGroupBox
Left = 8
Height = 45
Top = 8
Width = 449
Caption = 'Title of printed document:'
ClientHeight = 27
ClientWidth = 445
TabOrder = 0
object EDTitle: TEdit
Left = 8
Height = 21
Top = 2
Width = 432
TabOrder = 0
Text = 'EDTitle'
end
end
object GBPrintOptions: TGroupBox
Left = 8
Height = 105
Top = 109
Width = 249
Caption = 'Print options:'
ClientHeight = 87
ClientWidth = 245
TabOrder = 1
object Label1: TLabel
Left = 162
Height = 14
Top = 4
Width = 30
Caption = 'Scale:'
FocusControl = EDPrintScale
ParentColor = False
end
object CBFitToPage: TCheckBox
Left = 8
Height = 17
Top = 2
Width = 70
Caption = '&Fit to page'
OnClick = EDTopExit
TabOrder = 0
end
object CBPageNumbers: TCheckBox
Left = 8
Height = 17
Top = 21
Width = 86
Caption = 'Pa&ge numbers'
OnClick = CBPageNumbersClick
TabOrder = 1
end
object CBUseColor: TCheckBox
Left = 8
Height = 17
Top = 40
Width = 62
Caption = '&Use color'
OnClick = CBPageNumbersClick
TabOrder = 2
end
object EDPrintScale: TEdit
Left = 162
Height = 21
Top = 20
Width = 48
OnExit = EDTopExit
TabOrder = 3
end
object CBPaintSelection: TCheckBox
Left = 8
Height = 17
Top = 59
Width = 87
Caption = 'Pa&int selection'
OnClick = CBPageNumbersClick
TabOrder = 4
end
object CBPrintTitle: TCheckBox
Left = 134
Height = 17
Top = 59
Width = 61
Caption = 'Print tit&le'
OnClick = CBPageNumbersClick
TabOrder = 5
end
end
object BUPrint: TButton
Left = 89
Height = 25
Top = 325
Width = 74
Caption = '&Print'
OnClick = BUPrintClick
TabOrder = 4
end
object BUCancel: TButton
Left = 383
Height = 25
Top = 325
Width = 74
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 5
end
object GBMargins: TGroupBox
Left = 264
Height = 211
Top = 109
Width = 193
Caption = 'Margins:'
ClientHeight = 193
ClientWidth = 189
TabOrder = 3
object LBMarginUnits: TLabel
Left = 8
Height = 14
Top = 6
Width = 63
Caption = 'Margin u&nits:'
FocusControl = CoBMarginUnits
ParentColor = False
end
object LBLeft: TLabel
Left = 8
Height = 14
Top = 67
Width = 24
Caption = 'Left:'
FocusControl = EDLeft
ParentColor = False
end
object LBRight: TLabel
Left = 102
Height = 14
Top = 67
Width = 30
Caption = 'Right:'
FocusControl = EDRight
ParentColor = False
end
object LBTop: TLabel
Left = 9
Height = 14
Top = 126
Width = 23
Caption = 'Top:'
FocusControl = EDTop
ParentColor = False
end
object LBBottom: TLabel
Left = 102
Height = 14
Top = 112
Width = 39
Caption = 'Bottom:'
FocusControl = EDBottom
ParentColor = False
end
object LBUnitsLeft: TLabel
Left = 58
Height = 14
Top = 86
Width = 8
Caption = 'A'
ParentColor = False
end
object LBUnitsTop: TLabel
Left = 58
Height = 14
Top = 131
Width = 8
Caption = 'A'
ParentColor = False
end
object LBUnitsRight: TLabel
Left = 152
Height = 14
Top = 86
Width = 8
Caption = 'A'
ParentColor = False
end
object LBUnitsBottom: TLabel
Left = 152
Height = 14
Top = 131
Width = 8
Caption = 'A'
ParentColor = False
end
object CoBMarginUnits: TComboBox
Left = 8
Height = 21
Top = 22
Width = 176
ItemHeight = 13
Items.Strings = (
'milimeters'
'centimeters'
'inches'
'hundredths of inches'
)
OnChange = CoBMarginUnitsChange
Style = csDropDownList
TabOrder = 0
end
object CBMirrorMargins: TCheckBox
Left = 8
Height = 17
Top = 162
Width = 86
Caption = '&Mirror margins'
OnClick = CBPageNumbersClick
TabOrder = 5
end
object EDLeft: TEdit
Left = 8
Height = 21
Top = 83
Width = 48
OnExit = EDTopExit
TabOrder = 1
end
object EDRight: TEdit
Left = 102
Height = 21
Top = 83
Width = 48
OnExit = EDTopExit
TabOrder = 2
end
object EDTop: TEdit
Left = 8
Height = 21
Top = 128
Width = 48
OnExit = EDTopExit
TabOrder = 3
end
object EDBottom: TEdit
Left = 102
Height = 21
Top = 128
Width = 48
OnExit = EDTopExit
TabOrder = 4
end
end
object GBPageSelection: TGroupBox
Left = 8
Height = 105
Top = 215
Width = 249
Caption = 'Page selection:'
ClientHeight = 87
ClientWidth = 245
TabOrder = 2
object LBRangeTo: TLabel
Left = 163
Height = 14
Top = 32
Width = 15
Caption = 'to:'
ParentColor = False
end
object LBCopies: TLabel
Left = 8
Height = 14
Top = 59
Width = 88
Caption = 'Number of &copies:'
FocusControl = EDCopies
ParentColor = False
end
object RBAll: TRadioButton
Left = 8
Height = 17
Top = 3
Width = 61
Caption = '&All pages'
Checked = True
OnClick = RBAllClick
State = cbChecked
TabOrder = 0
end
object RBRange: TRadioButton
Left = 8
Height = 17
Top = 29
Width = 78
Caption = '&Range from:'
OnClick = RBAllClick
TabOrder = 1
TabStop = False
end
object RBSelectedOnly: TRadioButton
Left = 128
Height = 17
Top = 3
Width = 82
Caption = 'Selected &only'
OnClick = RBAllClick
TabOrder = 2
TabStop = False
end
object EDRangeFrom: TEdit
Left = 108
Height = 21
Top = 27
Width = 48
OnExit = EDTopExit
TabOrder = 3
end
object EDRangeTo: TEdit
Left = 193
Height = 21
Top = 27
Width = 48
OnExit = EDTopExit
TabOrder = 4
end
object EDCopies: TEdit
Left = 126
Height = 21
Top = 54
Width = 48
TabOrder = 5
end
object CBCollate: TCheckBox
Left = 179
Height = 17
Top = 56
Width = 51
Caption = 'Collate'
OnClick = CBPageNumbersClick
TabOrder = 6
end
end
object BUPreview: TButton
Left = 8
Height = 25
Top = 325
Width = 75
Caption = 'Previe&w...'
OnClick = BUPreviewClick
TabOrder = 6
end
object BUOk: TButton
Left = 303
Height = 25
Top = 325
Width = 74
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 7
end
object GBPrinter: TGroupBox
Left = 8
Height = 50
Top = 56
Width = 449
Caption = 'Printer settings'
ClientHeight = 32
ClientWidth = 445
TabOrder = 8
object LBPrinterName: TLabel
Left = 8
Height = 14
Top = 6
Width = 66
Caption = 'Printer name:'
FocusControl = EDCopies
ParentColor = False
end
object CoBPrinterName: TComboBox
Left = 112
Height = 21
Top = 2
Width = 206
ItemHeight = 13
OnChange = EDTopExit
TabOrder = 0
Text = 'CoBPrinterName'
end
object BUConfigure: TButton
Left = 328
Height = 25
Top = 1
Width = 113
Caption = 'Configure...'
OnClick = BUConfigureClick
TabOrder = 1
end
end
object PSDMain: TPrinterSetupDialog
left = 376
top = 104
end
end

View File

@ -0,0 +1,102 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TKPrintSetupForm','FORMDATA',[
'TPF0'#16'TKPrintSetupForm'#15'KPrintSetupForm'#4'Left'#3'F'#3#6'Height'#3'e'
+#1#3'Top'#3#161#1#5'Width'#3#208#1#13'ActiveControl'#7#7'EDTitle'#11'BorderS'
+'tyle'#7#8'bsDialog'#7'Caption'#6#10'Page setup'#12'ClientHeight'#3'e'#1#11
+'ClientWidth'#3#208#1#11'Font.Height'#2#245#9'Font.Name'#6#6'Tahoma'#12'OnCl'
+'oseQuery'#7#14'FormCloseQuery'#8'OnCreate'#7#10'FormCreate'#9'OnDestroy'#7
+#11'FormDestroy'#6'OnShow'#7#8'FormShow'#8'Position'#7#14'poScreenCenter'#10
+'LCLVersion'#6#6'0.9.29'#0#9'TGroupBox'#13'GBFileToPrint'#4'Left'#2#8#6'Heig'
+'ht'#2'-'#3'Top'#2#8#5'Width'#3#193#1#7'Caption'#6#26'Title of printed docum'
+'ent:'#12'ClientHeight'#2#27#11'ClientWidth'#3#189#1#8'TabOrder'#2#0#0#5'TEd'
+'it'#7'EDTitle'#4'Left'#2#8#6'Height'#2#21#3'Top'#2#2#5'Width'#3#176#1#8'Tab'
+'Order'#2#0#4'Text'#6#7'EDTitle'#0#0#0#9'TGroupBox'#14'GBPrintOptions'#4'Lef'
+'t'#2#8#6'Height'#2'i'#3'Top'#2'm'#5'Width'#3#249#0#7'Caption'#6#14'Print op'
+'tions:'#12'ClientHeight'#2'W'#11'ClientWidth'#3#245#0#8'TabOrder'#2#1#0#6'T'
+'Label'#6'Label1'#4'Left'#3#162#0#6'Height'#2#14#3'Top'#2#4#5'Width'#2#30#7
+'Caption'#6#6'Scale:'#12'FocusControl'#7#12'EDPrintScale'#11'ParentColor'#8#0
+#0#9'TCheckBox'#11'CBFitToPage'#4'Left'#2#8#6'Height'#2#17#3'Top'#2#2#5'Widt'
+'h'#2'F'#7'Caption'#6#12'&Fit to page'#7'OnClick'#7#9'EDTopExit'#8'TabOrder'
+#2#0#0#0#9'TCheckBox'#13'CBPageNumbers'#4'Left'#2#8#6'Height'#2#17#3'Top'#2
+#21#5'Width'#2'V'#7'Caption'#6#13'Pa&ge numbers'#7'OnClick'#7#18'CBPageNumbe'
+'rsClick'#8'TabOrder'#2#1#0#0#9'TCheckBox'#10'CBUseColor'#4'Left'#2#8#6'Heig'
+'ht'#2#17#3'Top'#2'('#5'Width'#2'>'#7'Caption'#6#10'&Use color'#7'OnClick'#7
+#18'CBPageNumbersClick'#8'TabOrder'#2#2#0#0#5'TEdit'#12'EDPrintScale'#4'Left'
+#3#162#0#6'Height'#2#21#3'Top'#2#20#5'Width'#2'0'#6'OnExit'#7#9'EDTopExit'#8
+'TabOrder'#2#3#0#0#9'TCheckBox'#16'CBPaintSelection'#4'Left'#2#8#6'Height'#2
+#17#3'Top'#2';'#5'Width'#2'W'#7'Caption'#6#16'Pa&int selection'#7'OnClick'#7
+#18'CBPageNumbersClick'#8'TabOrder'#2#4#0#0#9'TCheckBox'#12'CBPrintTitle'#4
+'Left'#3#134#0#6'Height'#2#17#3'Top'#2';'#5'Width'#2'='#7'Caption'#6#12'Prin'
+'t tit&le'#7'OnClick'#7#18'CBPageNumbersClick'#8'TabOrder'#2#5#0#0#0#7'TButt'
+'on'#7'BUPrint'#4'Left'#2'Y'#6'Height'#2#25#3'Top'#3'E'#1#5'Width'#2'J'#7'Ca'
+'ption'#6#6'&Print'#7'OnClick'#7#12'BUPrintClick'#8'TabOrder'#2#4#0#0#7'TBut'
+'ton'#8'BUCancel'#4'Left'#3#127#1#6'Height'#2#25#3'Top'#3'E'#1#5'Width'#2'J'
+#6'Cancel'#9#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#5#0#0#9
+'TGroupBox'#9'GBMargins'#4'Left'#3#8#1#6'Height'#3#211#0#3'Top'#2'm'#5'Width'
+#3#193#0#7'Caption'#6#8'Margins:'#12'ClientHeight'#3#193#0#11'ClientWidth'#3
+#189#0#8'TabOrder'#2#3#0#6'TLabel'#13'LBMarginUnits'#4'Left'#2#8#6'Height'#2
+#14#3'Top'#2#6#5'Width'#2'?'#7'Caption'#6#14'Margin u&nits:'#12'FocusControl'
+#7#14'CoBMarginUnits'#11'ParentColor'#8#0#0#6'TLabel'#6'LBLeft'#4'Left'#2#8#6
+'Height'#2#14#3'Top'#2'C'#5'Width'#2#24#7'Caption'#6#5'Left:'#12'FocusContro'
+'l'#7#6'EDLeft'#11'ParentColor'#8#0#0#6'TLabel'#7'LBRight'#4'Left'#2'f'#6'He'
+'ight'#2#14#3'Top'#2'C'#5'Width'#2#30#7'Caption'#6#6'Right:'#12'FocusControl'
+#7#7'EDRight'#11'ParentColor'#8#0#0#6'TLabel'#5'LBTop'#4'Left'#2#9#6'Height'
+#2#14#3'Top'#2'~'#5'Width'#2#23#7'Caption'#6#4'Top:'#12'FocusControl'#7#5'ED'
+'Top'#11'ParentColor'#8#0#0#6'TLabel'#8'LBBottom'#4'Left'#2'f'#6'Height'#2#14
+#3'Top'#2'p'#5'Width'#2''''#7'Caption'#6#7'Bottom:'#12'FocusControl'#7#8'EDB'
+'ottom'#11'ParentColor'#8#0#0#6'TLabel'#11'LBUnitsLeft'#4'Left'#2':'#6'Heigh'
+'t'#2#14#3'Top'#2'V'#5'Width'#2#8#7'Caption'#6#1'A'#11'ParentColor'#8#0#0#6
+'TLabel'#10'LBUnitsTop'#4'Left'#2':'#6'Height'#2#14#3'Top'#3#131#0#5'Width'#2
+#8#7'Caption'#6#1'A'#11'ParentColor'#8#0#0#6'TLabel'#12'LBUnitsRight'#4'Left'
+#3#152#0#6'Height'#2#14#3'Top'#2'V'#5'Width'#2#8#7'Caption'#6#1'A'#11'Parent'
+'Color'#8#0#0#6'TLabel'#13'LBUnitsBottom'#4'Left'#3#152#0#6'Height'#2#14#3'T'
+'op'#3#131#0#5'Width'#2#8#7'Caption'#6#1'A'#11'ParentColor'#8#0#0#9'TComboBo'
+'x'#14'CoBMarginUnits'#4'Left'#2#8#6'Height'#2#21#3'Top'#2#22#5'Width'#3#176
+#0#10'ItemHeight'#2#13#13'Items.Strings'#1#6#10'milimeters'#6#11'centimeters'
+#6#6'inches'#6#20'hundredths of inches'#0#8'OnChange'#7#20'CoBMarginUnitsCha'
+'nge'#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#0#0#0#9'TCheckBox'#15'CBMi'
+'rrorMargins'#4'Left'#2#8#6'Height'#2#17#3'Top'#3#162#0#5'Width'#2'V'#7'Capt'
+'ion'#6#15'&Mirror margins'#7'OnClick'#7#18'CBPageNumbersClick'#8'TabOrder'#2
+#5#0#0#5'TEdit'#6'EDLeft'#4'Left'#2#8#6'Height'#2#21#3'Top'#2'S'#5'Width'#2
+'0'#6'OnExit'#7#9'EDTopExit'#8'TabOrder'#2#1#0#0#5'TEdit'#7'EDRight'#4'Left'
+#2'f'#6'Height'#2#21#3'Top'#2'S'#5'Width'#2'0'#6'OnExit'#7#9'EDTopExit'#8'Ta'
+'bOrder'#2#2#0#0#5'TEdit'#5'EDTop'#4'Left'#2#8#6'Height'#2#21#3'Top'#3#128#0
+#5'Width'#2'0'#6'OnExit'#7#9'EDTopExit'#8'TabOrder'#2#3#0#0#5'TEdit'#8'EDBot'
+'tom'#4'Left'#2'f'#6'Height'#2#21#3'Top'#3#128#0#5'Width'#2'0'#6'OnExit'#7#9
+'EDTopExit'#8'TabOrder'#2#4#0#0#0#9'TGroupBox'#15'GBPageSelection'#4'Left'#2
,#8#6'Height'#2'i'#3'Top'#3#215#0#5'Width'#3#249#0#7'Caption'#6#15'Page selec'
+'tion:'#12'ClientHeight'#2'W'#11'ClientWidth'#3#245#0#8'TabOrder'#2#2#0#6'TL'
+'abel'#9'LBRangeTo'#4'Left'#3#163#0#6'Height'#2#14#3'Top'#2' '#5'Width'#2#15
+#7'Caption'#6#3'to:'#11'ParentColor'#8#0#0#6'TLabel'#8'LBCopies'#4'Left'#2#8
+#6'Height'#2#14#3'Top'#2';'#5'Width'#2'X'#7'Caption'#6#18'Number of &copies:'
+#12'FocusControl'#7#8'EDCopies'#11'ParentColor'#8#0#0#12'TRadioButton'#5'RBA'
+'ll'#4'Left'#2#8#6'Height'#2#17#3'Top'#2#3#5'Width'#2'='#7'Caption'#6#10'&Al'
+'l pages'#7'Checked'#9#7'OnClick'#7#10'RBAllClick'#5'State'#7#9'cbChecked'#8
+'TabOrder'#2#0#0#0#12'TRadioButton'#7'RBRange'#4'Left'#2#8#6'Height'#2#17#3
+'Top'#2#29#5'Width'#2'N'#7'Caption'#6#12'&Range from:'#7'OnClick'#7#10'RBAll'
+'Click'#8'TabOrder'#2#1#7'TabStop'#8#0#0#12'TRadioButton'#14'RBSelectedOnly'
+#4'Left'#3#128#0#6'Height'#2#17#3'Top'#2#3#5'Width'#2'R'#7'Caption'#6#14'Sel'
+'ected &only'#7'OnClick'#7#10'RBAllClick'#8'TabOrder'#2#2#7'TabStop'#8#0#0#5
+'TEdit'#11'EDRangeFrom'#4'Left'#2'l'#6'Height'#2#21#3'Top'#2#27#5'Width'#2'0'
+#6'OnExit'#7#9'EDTopExit'#8'TabOrder'#2#3#0#0#5'TEdit'#9'EDRangeTo'#4'Left'#3
+#193#0#6'Height'#2#21#3'Top'#2#27#5'Width'#2'0'#6'OnExit'#7#9'EDTopExit'#8'T'
+'abOrder'#2#4#0#0#5'TEdit'#8'EDCopies'#4'Left'#2'~'#6'Height'#2#21#3'Top'#2
+'6'#5'Width'#2'0'#8'TabOrder'#2#5#0#0#9'TCheckBox'#9'CBCollate'#4'Left'#3#179
+#0#6'Height'#2#17#3'Top'#2'8'#5'Width'#2'3'#7'Caption'#6#7'Collate'#7'OnClic'
+'k'#7#18'CBPageNumbersClick'#8'TabOrder'#2#6#0#0#0#7'TButton'#9'BUPreview'#4
+'Left'#2#8#6'Height'#2#25#3'Top'#3'E'#1#5'Width'#2'K'#7'Caption'#6#11'Previe'
+'&w...'#7'OnClick'#7#14'BUPreviewClick'#8'TabOrder'#2#6#0#0#7'TButton'#4'BUO'
+'k'#4'Left'#3'/'#1#6'Height'#2#25#3'Top'#3'E'#1#5'Width'#2'J'#7'Caption'#6#2
+'OK'#7'Default'#9#11'ModalResult'#2#1#8'TabOrder'#2#7#0#0#9'TGroupBox'#9'GBP'
+'rinter'#4'Left'#2#8#6'Height'#2'2'#3'Top'#2'8'#5'Width'#3#193#1#7'Caption'#6
+#16'Printer settings'#12'ClientHeight'#2' '#11'ClientWidth'#3#189#1#8'TabOrd'
+'er'#2#8#0#6'TLabel'#13'LBPrinterName'#4'Left'#2#8#6'Height'#2#14#3'Top'#2#6
+#5'Width'#2'B'#7'Caption'#6#13'Printer name:'#12'FocusControl'#7#8'EDCopies'
+#11'ParentColor'#8#0#0#9'TComboBox'#14'CoBPrinterName'#4'Left'#2'p'#6'Height'
+#2#21#3'Top'#2#2#5'Width'#3#206#0#10'ItemHeight'#2#13#8'OnChange'#7#9'EDTopE'
+'xit'#8'TabOrder'#2#0#4'Text'#6#14'CoBPrinterName'#0#0#7'TButton'#11'BUConfi'
+'gure'#4'Left'#3'H'#1#6'Height'#2#25#3'Top'#2#1#5'Width'#2'q'#7'Caption'#6#12
+'Configure...'#7'OnClick'#7#16'BUConfigureClick'#8'TabOrder'#2#1#0#0#0#19'TP'
+'rinterSetupDialog'#7'PSDMain'#4'left'#3'x'#1#3'top'#2'h'#0#0#0
]);

View File

@ -0,0 +1,369 @@
{ @abstract(This unit contains page setup dialog.)
@author(Tomas Krysl (tk@tkweb.eu))
@created(18 Sep 2009)
@lastmod(15 Oct 2009)
Copyright � 2009 Tomas Krysl (tk@@tkweb.eu)<BR><BR>
<B>License:</B><BR>
This code is distributed as a freeware. You are free to use it as part
of your application for any purpose including freeware, commercial and
shareware applications. The origin of this source code must not be
misrepresented; you must not claim your authorship. You may modify this code
solely for your own purpose. Please feel free to contact the author if you
think your changes might be useful for other users. You may distribute only
the original package. The author accepts no liability for any damage
that may result from using this code. }
unit KPrintSetup;
{$include kcontrols.inc}
interface
uses
{$IFDEF FPC}
LCLType, LCLIntf, LResources, PrintersDlgs,
{$ELSE}
Windows, Messages, Dialogs,
{$ENDIF}
SysUtils, Variants, Classes, Graphics, Controls, Forms,
StdCtrls, ExtCtrls, KControls, KPrintPreview;
resourcestring
sPrinterSetup = 'Printer setup';
sAllPages = 'All pages (%d)';
sErrPrintSetup = 'Print setup error';
sErrNoPrinterInstalled = 'No printer is installed on this computer.';
type
{ TKPrintSetupForm }
TKPrintSetupForm = class(TForm)
BUConfigure: TButton;
CoBPrinterName: TComboBox;
EDTitle: TEdit;
GBFileToPrint: TGroupBox;
GBPrinter: TGroupBox;
GBPrintOptions: TGroupBox;
LBPrinterName: TLabel;
BUPrint: TButton;
BUCancel: TButton;
CBFitToPage: TCheckBox;
CBPageNumbers: TCheckBox;
CBUseColor: TCheckBox;
GBMargins: TGroupBox;
CoBMarginUnits: TComboBox;
LBMarginUnits: TLabel;
CBMirrorMargins: TCheckBox;
GBPageSelection: TGroupBox;
RBAll: TRadioButton;
RBRange: TRadioButton;
RBSelectedOnly: TRadioButton;
LBRangeTo: TLabel;
LBCopies: TLabel;
EDLeft: TEdit;
LBLeft: TLabel;
LBRight: TLabel;
EDRight: TEdit;
EDTop: TEdit;
LBTop: TLabel;
EDBottom: TEdit;
LBBottom: TLabel;
EDRangeFrom: TEdit;
EDRangeTo: TEdit;
EDCopies: TEdit;
Label1: TLabel;
EDPrintScale: TEdit;
LBUnitsLeft: TLabel;
LBUnitsTop: TLabel;
LBUnitsRight: TLabel;
LBUnitsBottom: TLabel;
BUPreview: TButton;
CBPaintSelection: TCheckBox;
BUOk: TButton;
CBPrintTitle: TCheckBox;
CBCollate: TCheckBox;
PSDMain: TPrinterSetupDialog;
procedure BUConfigureClick(Sender: TObject);
procedure CoBMarginUnitsChange(Sender: TObject);
procedure RBAllClick(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure BUPreviewClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure EDTopExit(Sender: TObject);
procedure CBPageNumbersClick(Sender: TObject);
procedure BUPrintClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
FPrevSetup: TKPrintPageSetup;
FPageSetup: TKPrintPageSetup;
FPreviewForm: TKPrintPreviewForm;
FPreviewCreated: Boolean;
FSelAvail: Boolean;
FUpdateLock: Boolean;
procedure SetPageSetup(const Value: TKPrintPageSetup);
procedure SetPreviewForm(const Value: TKPrintPreviewForm);
protected
procedure PageSetupToForm; virtual;
procedure FormToPageSetup; virtual;
procedure ValidateForm;
public
{ Public declarations }
property PageSetup: TKPrintPageSetup read FPageSetup write SetPageSetup;
property PreviewForm: TKPrintPreviewForm read FPreviewForm write SetPreviewForm;
property SelAvail: Boolean read FSelAvail write FSelAvail;
end;
implementation
uses
Printers, KFunctions;
procedure TKPrintSetupForm.FormCreate(Sender: TObject);
begin
FPageSetup := nil;
FPrevSetup := TKPrintPageSetup.Create(nil);
FPreviewForm := nil;
FPreviewCreated := False;
{$IFDEF FPC}
PSDMain.Title := sPrinterSetup;
{$ENDIF}
end;
procedure TKPrintSetupForm.FormDestroy(Sender: TObject);
begin
if FPreviewCreated then
begin
FPreviewForm.Free;
FPreviewCreated := False;
end;
FPrevSetup.Free;
end;
procedure TKPrintSetupForm.FormShow(Sender: TObject);
begin
PageSetupToForm;
end;
procedure TKPrintSetupForm.PageSetupToForm;
function FmtMargin(Value: Double): string;
const
Fmt = '%.*f';
var
Precision: Integer;
begin
case FPageSetup.Units of
puCM: Precision := 1;
puMM: Precision := 0;
puInch: Precision := 2;
else
Precision := 0;
end;
Result := Format(Fmt, [Precision, Value]);
end;
function FmtUnit: string;
begin
case FPageSetup.Units of
puMM: Result := 'mm';
puInch: Result := '"';
puHundredthInch: Result := '".100';
else
Result := 'cm';
end;
end;
var
S: string;
begin
if Assigned(FPageSetup) then
begin
FUpdateLock := True;
try
CBCollate.Checked := poCollate in FPageSetup.Options;
CBFitToPage.Checked := poFitToPage in FPageSetup.Options;
CBPageNumbers.Checked := poPageNumbers in FPageSetup.Options;
CBUseColor.Checked := poUseColor in FPageSetup.Options;
CBPaintSelection.Checked := poPaintSelection in FPageSetup.Options;
CBPrintTitle.Checked := poTitle in FPageSetup.Options;
CBMirrorMargins.Checked := poMirrorMargins in FPageSetup.Options;
CoBPrinterName.Items.Assign(Printer.Printers);
CoBPrinterName.ItemIndex := CoBPrinterName.Items.IndexOf(FPageSetup.PrinterName);
if CoBPrinterName.ItemIndex < 0 then CoBPrinterName.ItemIndex := Printer.PrinterIndex;
RBSelectedOnly.Enabled := FPageSetup.SelAvail;
if RBSelectedOnly.Enabled and FSelAvail then
RBSelectedOnly.Checked := True
else if FPageSetup.Range = prRange then
RBRange.Checked := True
else
RBAll.Checked := True;
RBAll.Caption := Format(sAllPages, [FPageSetup.PageCount]);
EDRangeFrom.Enabled := RBRange.Checked;
EDRangeFrom.Text := IntToStr(FPageSetup.StartPage);
EDRangeTo.Enabled := RBRange.Checked;
EDRangeTo.Text := IntToStr(FPageSetup.EndPage);
EDCopies.Text := IntToStr(FPageSetup.Copies);
EDPrintScale.Enabled := not CBFitTopage.Checked;
EDPrintScale.Text := IntToStr(FPageSetup.Scale);
EDTitle.Text := FPageSetup.Title;
CoBMarginUnits.ItemIndex := Integer(FPageSetup.Units);
S := FmtUnit;
EDBottom.Text := FmtMargin(FPageSetup.MarginBottom); LBUnitsBottom.Caption := S;
EDLeft.Text := FmtMargin(FPageSetup.MarginLeft); LBUnitsLeft.Caption := S;
EDRight.Text := FmtMargin(FPageSetup.MarginRight); LBUnitsRight.Caption := S;
EDTop.Text := FmtMargin(FPageSetup.MarginTop); LBUnitsTop.Caption := S;
finally
FUpdateLock := False;
end;
end;
end;
procedure TKPrintSetupForm.FormToPageSetup;
var
Options: TKPrintOptions;
begin
if Assigned(FPageSetup) and not FUpdateLock then
begin
FPageSetup.LockUpdate;
try
Options := [];
if CBCollate.Checked then Include(Options, poCollate);
if CBFitToPage.Checked then Include(Options, poFitToPage);
if CBPageNumbers.Checked then Include(Options, poPageNumbers);
if CBUseColor.Checked then Include(Options, poUseColor);
if CBPaintSelection.Checked then Include(Options, poPaintSelection);
if CBPrintTitle.Checked then Include(Options, poTitle);
if CBMirrorMargins.Checked then Include(Options, poMirrorMargins);
FPageSetup.PrinterName := CoBPrinterName.Text;
FPageSetup.Options := Options;
if RBSelectedOnly.Checked then FPageSetup.Range := prSelectedOnly
else if RBRange.Checked then FPageSetup.Range := prRange
else FPageSetup.Range := prAll;
FPageSetup.StartPage := StrToIntDef(EDRangeFrom.Text, FPageSetup.StartPage);
FPageSetup.EndPage := StrToIntDef(EDRangeTo.Text, FPageSetup.EndPage);
FPageSetup.Copies := StrToIntDef(EDCopies.Text, FPageSetup.Copies);
FPageSetup.Scale := StrToIntDef(EDPrintScale.Text, FPageSetup.Scale);
FPageSetup.Title := EDTitle.Text;
FPageSetup.Units := TKPrintUnits(CoBMarginUnits.ItemIndex);
FPageSetup.MarginBottom := StrToFloatDef(AdjustDecimalSeparator(EDBottom.Text), FPageSetup.MarginBottom);
FPageSetup.MarginLeft := StrToFloatDef(AdjustDecimalSeparator(EDLeft.Text), FPageSetup.MarginLeft);
FPageSetup.MarginRight := StrToFloatDef(AdjustDecimalSeparator(EDRight.Text), FPageSetup.MarginRight);
FPageSetup.MarginTop := StrToFloatDef(AdjustDecimalSeparator(EDTop.Text), FPageSetup.MarginTop);
finally
FPageSetup.UnlockUpdate;
end;
end;
end;
procedure TKPrintSetupForm.BUPrintClick(Sender: TObject);
begin
FormToPageSetup;
FPageSetup.PrintOut;
end;
procedure TKPrintSetupForm.BUConfigureClick(Sender: TObject);
begin
FormToPageSetup;
try
if PSDMain.Execute then
begin
FPageSetup.LockUpdate;
try
FPageSetup.PrinterName := '';
finally
FPageSetup.UnlockUpdate;
end;
PageSetupToForm;
end;
except
MessageBox(Handle, PChar(sErrNoPrinterInstalled), PChar(sErrPrintSetup), MB_OK);
end;
end;
procedure TKPrintSetupForm.EDTopExit(Sender: TObject);
begin
ValidateForm;
end;
procedure TKPrintSetupForm.CoBMarginUnitsChange(Sender: TObject);
begin
if Assigned(FPageSetup) then
begin
FPageSetup.Units := TKPrintUnits(CoBMarginUnits.ItemIndex);
PageSetupToForm;
end;
end;
procedure TKPrintSetupForm.CBPageNumbersClick(Sender: TObject);
begin
FormToPageSetup;
end;
procedure TKPrintSetupForm.RBAllClick(Sender: TObject);
begin
FSelAvail := RBSelectedOnly.Checked;
ValidateForm;
end;
procedure TKPrintSetupForm.SetPageSetup(const Value: TKPrintPageSetup);
begin
if Value <> FPageSetup then
begin
FPrevSetup.Assign(Value);
FPageSetup := Value;
PageSetupToForm;
end;
end;
procedure TKPrintSetupForm.SetPreviewForm(const Value: TKPrintPreviewForm);
begin
if Value <> FPreviewForm then
begin
if FPreviewCreated then
begin
FPreviewForm.Free;
FPreviewCreated := False;
end;
FPreviewForm := Value;
end;
end;
procedure TKPrintSetupForm.ValidateForm;
begin
FormToPageSetup;
PageSetupToForm;
end;
procedure TKPrintSetupForm.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
if FPreviewCreated then
FPreviewForm.Hide;
if ModalResult = mrOk then
FormToPageSetup
else if Assigned(FPageSetup) then
FPageSetup.Assign(FPrevSetup);
end;
procedure TKPrintSetupForm.BUPreviewClick(Sender: TObject);
begin
ValidateForm;
if FPreviewForm = nil then
begin
FPreviewForm := TKPrintPreviewForm.Create(nil);
FPreviewCreated := True;
end;
FPreviewForm.Preview.Control := FPageSetup.Control;
FPreviewForm.Show;
end;
{$IFDEF FPC}
initialization
{$i kprintsetup.lrs}
{$ELSE}
{$R *.dfm}
{$ENDIF}
end.

View File

@ -0,0 +1,96 @@
{ @abstract(This unit contains Unicode equivalents of ANSI Win32 API functions
not supported in Win9X without Unicode Layer for Win9X)
@author(Tomas Krysl (tk@tkweb.eu))
@created(10 Jun 2008)
@lastmod(14 Oct 2009)
Copyright � 2008 Tomas Krysl (tk@@tkweb.eu)<BR><BR>
<B>License:</B><BR>
This code is distributed as a freeware. You are free to use it as part
of your application for any purpose including freeware, commercial and
shareware applications. The origin of this source code must not be
misrepresented; you must not claim your authorship. You may modify this code
solely for your own purpose. Please feel free to contact the author if you
think your changes might be useful for other users. You may distribute only
the original package. The author accepts no liability for any damage
that may result from using this code. }
unit KWideWinProcs;
{$include kcontrols.inc}
interface
{$IFDEF USE_WIDEWINPROCS}
type
{ Procedural type for @link(TKWideWinProcs.CompareString). }
TCompareStringW = function(Locale, dwCmpFlags: Cardinal; lpString1: PWideChar; cchCount1:
Integer; lpString2: PWideChar; cchCount2: Integer): Integer; stdcall;
{ Procedural type for @link(TKWideWinProcs.LStrLenW). }
TLStrLenW = function(lpString: PWideChar): Integer;
{ Unicode equivalents of ANSI Win32 API functions not available in Win9X
without Unicode Layer for Win9X. Only those used in KControls. }
TKWideWinProcs = class(TObject)
private
FCompareStringW: TCompareStringW;
FLStrLenW: TLStrLenW;
public
{ Creates the instance. }
constructor Create;
{ See MSDN for help. }
function CompareString(Locale, dwCmpFlags: Cardinal; lpString1: PWideChar;
cchCount1: Integer; lpString2: PWideChar; cchCount2: Integer): Integer;
{ See MSDN for help. }
function LStrLenW(lpString: PWideChar): Integer;
end;
var
WideWinProcs: TKWideWinProcs;
{$ENDIF}
implementation
{$IFDEF USE_WIDEWINPROCS}
uses
Windows, KFunctions;
{ TWideWinProcs }
constructor TKWideWinProcs.Create;
begin
FCompareStringW := GetProcAddress(GetModuleHandle('kernel32.dll'), 'CompareStringW');
FLStrLenW := GetProcAddress(GetModuleHandle('kernel32.dll'), 'lstrlenW');
end;
function TKWideWinProcs.CompareString(Locale, dwCmpFlags: Cardinal;
lpString1: PWideChar; cchCount1: Integer; lpString2: PWideChar;
cchCount2: Integer): Integer;
begin
if Assigned(FCompareStringW) then
Result := FCompareStringW(Locale, dwCmpFlags, lpString1, cchCount1,
lpString2, cchCount2)
else
Result := CompareStringA(Locale, dwCmpFlags, PAnsiChar(WideCharToAnsiString(lpString1)),
cchCount1, PAnsiChar(WideCharToAnsiString(lpString2)), cchCount2);
end;
function TKWideWinProcs.LStrLenW(lpString: PWideChar): Integer;
begin
if Assigned(FLStrLenW) then
Result := FLStrLenW(lpString)
else
Result := LStrLenA(PAnsiChar(WideCharToAnsiString(lpString)));
end;
initialization
WideWinProcs := TKWideWinProcs.Create;
finalization
WideWinProcs.Free;
{$ENDIF}
end.

Binary file not shown.