DIRegEx: used for RegEx (regular expressions) search. 18 | asoRegEx search option is available only when this library is compiled in. 19 | After you install this library, enable its usage in 20 | ATBinHexOptions.inc and ATStreamSearchOptions.inc files, uncomment the "REGEX" define. 21 |
22 | 23 |Tnt Unicode Controls: used for search in Unicode-named files (TTntFileStream class is used). 25 | After you install this library, enable its 26 | usage in file ATStreamSearchOptions.inc, uncomment the "TNT" define. 27 |
28 | 29 |ATPrintPreview: used to show the "Print preview" form before the actual printing in 31 | Print and PrintPreview methods. 32 | After you install this library, enable its 33 | usage in file ATBinHexOptions.inc, uncomment the "PREVIEW" define. 34 |
35 |
17 | Alexey Torgashin
18 | http://www.uvviewsoft.com
19 |
20 |
21 |
--------------------------------------------------------------------------------
/help_delphi/source/Copyrights.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
24 |
231 | 232 | 1.3.2 (17 Jun 2006): 233 |
21 | Component will be installed into the "Samples" page of component pallette. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /help_delphi/source/Introduction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |25 | There are 5 view modes available: 26 |
Text mode
36 |
Binary mode
37 |
Hex mode
38 |
Unicode mode
39 |
Unicode/Hex mode
40 |
43 | There is extended version of this component available, 44 | ATViewer, 45 | which can show files in such modes as RTF, Image, Multimedia, Internet and WLX Plugins. 46 | But if you just need to show a plain file dump, ATBinHex should be enough. 47 | 48 |
49 | There is also FreePascal/Lazarus version (ported from original version), 50 | which is maintained by independent developer. 51 | This version is currently in beta stage, some features are not yet implemented. 52 | Refer to LuiPack page. 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /help_delphi/source/License.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |19 | Software distributed under the License is distributed on an "AS IS" 20 | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 21 | License for the specific language governing rights and limitations 22 | under the License. 23 | 24 |
25 | Copyright © 2006-2007 Alexey Torgashin.
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/help_delphi/source/Main.css:
--------------------------------------------------------------------------------
1 | body
2 | {
3 | font-family: Tahoma, Arial, Helvetica, sans-serif;
4 | font-size: 0.8em;
5 | background: #FFF;
6 | }
7 |
8 | table
9 | {
10 | border: 2px #CCC solid;
11 | border-collapse: collapse;
12 | border-spacing: 0px;
13 | margin-top: 0px;
14 | }
15 |
16 | td
17 | {
18 | border: 2px #CCC solid;
19 | font-family: Arial, Helvetica, sans-serif;
20 | font-size: 0.9em;
21 | }
22 |
23 | td.big
24 | {
25 | font-size: 1.1em;
26 | font-weight: bold;
27 | text-align: center;
28 | background-color: #EEE;
29 | }
30 |
31 | td pre
32 | {
33 | background-color: #EEE;
34 | }
35 |
36 | hr
37 | {
38 | border: 0;
39 | color: #CCC;
40 | background-color: #CCC;
41 | height: 2px;
42 | text-align: center;
43 | }
44 |
45 | h1, h2, h3
46 | {
47 | color: darkblue;
48 | }
49 |
50 | .blue
51 | {
52 | color: darkblue;
53 | }
54 |
55 | img
56 | {
57 | border: 0;
58 | vertical-align: middle;
59 | }
60 |
--------------------------------------------------------------------------------
/help_delphi/source/ModeBinary.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alexey-T/ATBinHex-Lazarus/ddee0136443abf71a1ab89c61f60beff98adcf29/help_delphi/source/ModeBinary.gif
--------------------------------------------------------------------------------
/help_delphi/source/ModeHex.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alexey-T/ATBinHex-Lazarus/ddee0136443abf71a1ab89c61f60beff98adcf29/help_delphi/source/ModeHex.gif
--------------------------------------------------------------------------------
/help_delphi/source/ModeText.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alexey-T/ATBinHex-Lazarus/ddee0136443abf71a1ab89c61f60beff98adcf29/help_delphi/source/ModeText.gif
--------------------------------------------------------------------------------
/help_delphi/source/ModeUHex.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alexey-T/ATBinHex-Lazarus/ddee0136443abf71a1ab89c61f60beff98adcf29/help_delphi/source/ModeUHex.gif
--------------------------------------------------------------------------------
/help_delphi/source/ModeUnicode.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alexey-T/ATBinHex-Lazarus/ddee0136443abf71a1ab89c61f60beff98adcf29/help_delphi/source/ModeUnicode.gif
--------------------------------------------------------------------------------
/help_delphi/source/Table of Contents.hhc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
OnFileReload | 17 |Fired after file auto-reload complete (when AutoReload = True). | 18 |
OnSelectionChange | 22 |Fired on text selection change. | 23 |
OnOptionsChange | 27 |Fired after an option has been changed by user. 28 | Examples of such changable options: 29 |
|
34 |
OnSearchProgress | 38 |Fired on text search progress. 39 | It is of type: 40 | 41 | TATStreamSearchProgress = procedure( 42 | const ACurrentPos, AMaximalPos: Int64; 43 | var AContinueSearching: Boolean) of object;44 | Parameters: 45 |
|
52 |
OnDrawLine | 56 |Fired before a line is to be drawn in variable length modes (Text, Unicode). 57 | You can use it to color the entire line or to disable line drawing. 58 | It is of type: 59 | 60 | TATBinHexDrawLine = procedure( 61 | ASender: TObject; 62 | ACanvas: TCanvas; 63 | const AStr, AStrAll: WideString; 64 | const ARect: TRect; 65 | const ATextPnt: TPoint; 66 | var ADone: Boolean) of object;67 | Parameters: 68 |
|
79 |
OnDrawLine2 | 83 |Fired after a line has been drawn in variable length modes (Text, Unicode). 84 | You can use it to color some parts of the line. 85 | It is of type: 86 | 87 | TATBinHexDrawLine2 = procedure( 88 | ASender: TObject; 89 | ACanvas: TCanvas; 90 | const AStr: WideString; 91 | const APnt: TPoint; 92 | const AOptions: TATBinHexOutputOptions) of object;93 | Parameters: 94 |
|
107 |
OnClickURL | 111 |Fired on URL/mail clicking, when URL highlighting is enabled. 112 | It is of type: 113 | 114 | TATBinHexClickURL = procedure( 115 | ASender: TObject; 116 | const AString: AnsiString) of object;117 | |
118 |
14 | Q1: How can I load the contents of an AnsiString or WideString? 15 | 16 |
17 | A: You should do it using OpenStream method, giving it a TMemoryStream as 18 | a parameter. Sample procedures for AnsiString and WideString are shown 19 | below. Note that you should free stream only after calling 20 | Viewer.OpenStream(nil), otherwise control will try to read deallocated 21 | memory on scrolling! 22 | 23 |
24 |
72 |
75 | Q2: I have an issue with horizontal scrollbar. Even when text becomes 76 | short enough, scrollbar doesn't disappear... 77 | 78 |
79 | A: This is done as workaround for Windows XP bug: when scrollbar is about 80 | to disappear, this may cause both scrollbars and window border to disappear. 81 | You can disable this workaround by commenting the "HSCROLLBAR_WORKAROUND" 82 | define in ATBinHexOptions.inc. 83 | 84 |
85 | The RichEdit control doesn't have this problem because it precalculates widths for all strings 86 | and sets scrollbar size to the max value. 87 | We cannot do this in ATBinHex control, so the scrollbar size is calculated dinamically. 88 | 89 |
90 |
94 | Q3: After changing a property, it is not applied. 95 | 96 |
97 | A: Many properties require that after changing them, file should 98 | be reopened (using Open/Reload methods). 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /help_delphi/source/Usage Methods.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |function Open(const AFileName: WideString; ARedraw: Boolean = True): Boolean; 16 | Opens a file and optionally redraws control. 17 | Result is True if file was successfully opened 18 | or False if file was not found or other open error occured. 19 | Pass the empty AFileName string to close the currently open file. 20 | Note: 21 |
|
28 |
function OpenStream(AStream: TStream; ARedraw: Boolean = True): Boolean; 31 | Opens a stream and optionally redraws control. 32 | Result is True if stream was successfully opened. 33 | Pass nil to stop use the currently used stream. 34 | Notes: 35 |
|
44 |
procedure Reload; 47 | Reloads current file or stream. 48 | |
49 |
function FindFirst(const AText: WideString; AOptions: TATStreamSearchOptions): Boolean; 52 | Starts text search. 53 | AText: text to search (Note: Unicode string must be in the Little-Endian format). 54 | AOptions: search options that are set of flags: 55 |
65 | Match position and length are saved in SearchResultStart and SearchResultLength properties. 66 | You should manually highlight found match using SetSelection method. 67 | Notes: 68 |
|
78 |
function FindNext(AFindPrevious: Boolean = False): Boolean; 81 | Continues text search. 82 | AFindPrevious: continue search in reverse direction (Note: not supported for RegEx search). 83 | Result is the same as for FindFirst method. 84 | Note: 85 |
|
90 |
procedure CopyToClipboard(AsHex: Boolean = False); 93 | Copies current selection (AnsiString or WideString depending on current view mode) 94 | to Clipboard. 95 | AsHex may be True in Text/Binary/Hex modes, in this case 96 | the hex-encoded string (bytes in the hex form separated by spaces) will be 97 | copied. 98 | Notes: 99 |
|
105 |
procedure SetSelection(const AStart, ALength: Int64; AScroll: Boolean; AFireEvent: Boolean = True; ARedraw: Boolean = True); 108 | Sets selection and optionally scrolls control to selection start. 109 | AStart: selection start (0-based), 110 | ALength: selection length, 111 | AScroll: scroll control to selection start afterwards, 112 | AFireEvent: fire the OnSelectionChange event afterwards, 113 | ARedraw: redraw control afterwards. 114 | Note: 115 |
|
120 |
procedure Scroll(const APos: Int64; AIndentVert, AIndentHorz: integer; ARedraw: Boolean = True); 123 | Scrolls control to specified position. 124 | Control will be scrolled vertically so that position APos (0-based) is visible 125 | by AIndentVert lines lower than top border; 126 | if after that the position is still out of screen, control will be 127 | scrolled horizontally so that position is visible by AIndentHorz chars righter than left border. 128 | ARedraw: allow to redraw control afterwards. 129 | |
130 |
133 | procedure SelectAll; 134 | procedure SelectNone; 135 | Selects all text. 136 | Deselects text. 137 | |
140 |
141 | procedure Print(
142 | APrintRange: TPrintRange;
143 | AFromPage: Integer = 1;
144 | AToPage: Integer = MaxInt;
145 | ACopies: Integer = 1;
146 | const ACaption: string = '');
147 | 148 | Shows "Print preview" dialog and allows user to print text. 149 | APrintRange: print range (type declared in Dialogs.pas): 150 |
156 | ACaption: caption of print job. 157 | Notes: 158 |
|
166 |
procedure PrintPreview; 169 | Shows "Print preview" dialog for current selection. 170 | When text is selected (SelLength <> 0), this method calls 171 | Print(prSelection), otherwise it calls Print(prAllPages). 172 | Note: 173 |
|
179 |
function IncreaseFontSize(AIncrement: Boolean): Boolean; 182 | Increases (AIncrement = True) or decreases current font size. 183 | Result is True if font size was changed or False if minimal 184 | or maximal size value is already set. 185 | Note: 186 |
|
191 |
procedure TextEncodingsMenu(AX, AY: Integer); 194 | Shows menu of all available encodings for the current mode. 195 | Menu is shown at point (AX, AY). 196 | Note: 197 |
|
202 |
Mode | 16 |Current view mode. 17 | Possible values: 18 |
|
26 |
TextEncoding | 29 |Current text encoding. 30 | Used in non-Unicode modes. 31 | Possible values: 32 |
|
55 |
TextEncodingName (public, read-only) | 58 |Name of current text encoding. 59 | Note: 60 |
|
65 |
TextWrap | 68 |Enables word wrap. 69 | Works in Text and Unicode modes. 70 | |
71 |
74 | TextWidth 75 | TextWidthHex 76 | TextWidthUHex 77 | |
78 | Width of text in fixed-length modes:
79 |
|
85 |
88 | TextWidthFit 89 | TextWidthFitHex 90 | TextWidthFitUHex 91 | |
92 | Enables width auto-fit in fixed-length modes. 93 |
99 |
|
105 |
108 | TextSearchIndentVert 109 | TextSearchIndentHorz 110 | |
111 | Text indents, used when text is highlighted with successfull FindText / FindNext methods call.
112 |
|
117 |
TextTabSize | 120 |Tabulation (#9) size. 121 | | 122 |
TextOemSpecial | 125 |Enables usage of special OEM font (when TextEncoding = vencOEM). 126 | Note: 127 |
|
134 |
138 |
139 | TextGutter 140 | TextGutterLines 141 | TextGutterLinesBufSize 142 | TextGutterLinesCount 143 | TextGutterLinesStep 144 | TextGutterLinesExtUse 145 | TextGutterLinesExtList 146 | 147 | |
148 | Gutter (vertical bar on the left) options:
149 |
|
162 |
166 | TextUrlHilight 167 | | 168 |
169 | Enables URL/mail highlighting. 170 | On URL clicking the OnClickURL event occurs. 171 | Note: 172 |
|
177 |
181 | TextNonPrintable 182 | | 183 |Enables displaying of non-printable characters. 184 | Note: 185 |
|
191 |
195 | Font (inherited) 196 | FontOEM 197 | FontFooter 198 | FontGutter 199 | |
200 | Fonts:
201 |
|
209 |
212 |
213 | Color
214 | (inherited) 215 | 216 | TextColorGutter 217 | TextColorURL 218 | TextColorHi 219 | TextColorHex 220 | TextColorHex2 221 | TextColorHexBack 222 | TextColorLines 223 | TextColorError 224 | |
225 |
226 | Colors of:
227 |
|
239 |
242 |
243 | AutoReload 244 | AutoReloadBeep 245 | AutoReloadFollowTail 246 | AutoReloadSimple 247 | AutoReloadSimpleTime 248 | 249 | |
250 | File auto-reloading options: 251 |
|
261 |
TextPopupCommands | 265 |Set of commands visible in the popup (right-click) menu. 266 | Commands available: 267 |
|
275 |
TextPopupCaption[AIndex: TATPopupCommand] (public, write-only) |
278 | Captions of popup (right-click) menu items. 279 | For possible values of AIndex see TextPopupCommands. 280 | |
281 |
MaxLengths[AIndex: TATBinHexMode] (public) | 285 |Maximal line lengths. 286 | These values are for all view modes of ATBinHex control: Text, Binary, Hex, Unicode. 287 | They set internal values that define the maximal length of a single string in a file. 288 | Values are 300 by default. 289 | For example, you may set MaxLengths[vbmodeText] to 1000 if user needs to work 290 | with strings of length 1000 in Text mode. Notes: 291 |
|
297 |
MaxClipboardDataSizeMb (public) | 299 |Maximal data size (in Mb) for copying to Clipboard. 300 | Default value is 16 (Mb), which prevents visual "hanging" when too large block 301 | is selected accidentally before copying. 302 | |
303 |
308 | SelStart (public) 309 | SelLength (public) 310 | SelText (public, read-only) 311 | SelTextW (public, read-only) 312 | SelTextShort (public, read-only) 313 | SelTextShortW (public, read-only) 314 | |
315 | Current selection properties:
316 |
325 |
|
330 |
334 |
335 | PosPercent 336 | PosOffset 337 | PosLine 338 | (public) 339 | |
340 |
341 | Current scroll position:
342 |
|
357 |
361 |
362 | SearchResultStart 363 | SearchResultLength 364 | SearchStarted 365 | SearchString 366 | (public, read-only) 367 | |
368 | Search-related:
369 |
|
377 |
381 |
382 | MarginLeft 383 | MarginTop 384 | MarginRight 385 | MarginBottom 386 | (public) 387 | |
388 | Printing margins. 389 | Currently in mm. 390 | |
391 |
395 | 396 | TextLineSpacing 397 | 398 | | 399 |400 | Interline spacing in pixels (default is 0). 401 | | 402 |
406 | 407 | TextEnableSel 408 | 409 | | 410 |
411 | Enables selection. 412 | If set to False, text cannot be selected by user. 413 | |
414 |
22 | Note: this may be a risk of receiving messages from several threads at almost the same time, 23 | so additional boolean "Busy flag" should be set on message-handler start and reset on exit. 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /help_delphi/source/c.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | "C:\Program Files\HTML Help Workshop\hhc.exe" ATBinHex.hhp 4 | -------------------------------------------------------------------------------- /history.txt: -------------------------------------------------------------------------------- 1 | 2024.07.01 2 | + add: props MarkerStart, MarkerLength, MarkerLineWidth, TextColorMarker 3 | 4 | 2023.12.01 5 | * change: disabled selection with UTF8 encoding, to hide wrong selection with UTF8 6 | * change: support proportional fonts, but now rendering is slower due to call of TCanvas.TextWidth for each char 7 | + add: DoubleBuffered property, it now allows correct rendering on macOS Retina if set to False 8 | - fix: TextWrap is now working 9 | 10 | 2019.09.19 11 | * change: require package EncConv (in github.com/alexey-t) instead of LConvEncoding 12 | 13 | 2018.04.10 14 | - fix: double-click worked wrong (must react in MouseUp, not in DblClick) 15 | - fix: wrong find of whole words 16 | 17 | 2018.04.07 18 | + add: update resource pic for "middle mouse click scroll" for hi-dpi 19 | + add: rewritten other resource files 20 | 21 | 2017.12.18 22 | + add: use unicode middle-dot U+00B7 for special chars 23 | 24 | 2017.12.15 25 | + big rework. ATStreamSearch works now. ATBinHex methods FindFirst/FindNext work now. Only case-insensitive search don't work for non-ascii text. Hard todo. 26 | + add: buttons Find/FindNext in demo 27 | + add: keys Home/End to goto file begin/end, in fixed modes 28 | + add: hide v-scrollbar in fixed modes (hex/ binary/ u-hex) 29 | - fix: OnScroll wasn't called in many cases 30 | - fix: huge file, if v-scrollbar dragged to end, file must also scroll to end 31 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | You can use ATBinHex under 2 licenses: MPL 2.0 or LGPL. 2 | Copyright (c) Alexey Torgashin 3 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ATBinHex was originally a Delphi component http://atviewer.sourceforge.net/atbinhex.htm 2 | 3 | This is Lazarus version. 4 | 5 | * Some features disabled via ATBinHexOptions.inc (printing, regex hiliting of URLs) 6 | * Removed method OpenFile (it used Win API), now use OpenStream 7 | * Encodings are supported again, via LConvEncoding, in non-unicode modes only 8 | --------------------------------------------------------------------------------