Introduction

ATViewer Component

ATViewer is a component for Delphi/C++Builder, which allows to view files of various types. There is no edit possibility, just quick view - so it's useful to implement "View file" feature in your Delphi/C++Builder application.

The following view modes are implemented:

  • Text, Binary, Hex, Unicode: all files, of unlimited size.
    Plain file dump is shown. Used ATBinHex component: only visible part of file is loaded into memory. Modes are suitable for huge files and files of unknown type.
  • RTF/UTF-8: RTF and UTF-8 encoded texts.
    File is shown using RichEdit control.
  • Image: all general image formats: BMP JPG ICO GIF PNG... plus all formats supported by IrfanView/XnView external viewers.
    File is shown using ATImageBox component.
  • Multimedia: all file types supported by MS Windows Media Player: AVI MPEG WMV MP3...
    File is shown using WMP ActiveX control.
  • Internet: all file types supported by MS Internet Explorer: HTML XML DOC XLS...
    File is shown using MSIE ActiveX control.
  • Plugins: all files supported by Total Commander Lister plugins.

Collections of Lister plugins can be found at the following two sites:

  • totalcmd.net
  • totalcmd.pl


Installation

First, install and enable additional libraries needed, see Additional libraries topic. After that you may install ATViewer package into Delphi/C++Builder IDE.

Package installation:

  • Delphi 5: compile and install package "Delphi\ATViewerD5.dpk"
  • Delphi 6, 7: compile and install package "Delphi\ATViewerD7.dpk"
  • Delphi 2006, 2007: compile and install package "Delphi\ATViewerD2006.dpk"
  • Delphi 2009: compile and install package "Delphi\ATViewerD2009.dproj"
  • C++Builder 5: compile and install package "CBuilder\ATViewerC5.bpk"
  • C++Builder 6: compile and install package "CBuilder\ATViewerC6.bpk"
  • C++Builder 2006, 2007: compile and install package "CBuilder\ATViewerC2006.bdsproj"

Components ATViewer, ATBinHex, ATImageBox, ATStreamSearch and ATFileNotification will be installed into the "Samples" page of component pallette. Helper components WMP and WMP9 will be installed into the "ActiveX" page of component pallette.

Note: Delphi 2005 may sometimes show "External Exception" error when application with ATViewer component closes. To prevent this, run the application outside of IDE.


Additional libraries

Additional optional libraries/units used in ATViewer are:
  1. Graphic libraries:
    1. GIFImage: used to support animated GIF graphic.
      After you install this library, enable its usage in ATViewerOptions.inc, uncomment the "GIF" define.

    2. PNGImage: used to support PNG graphic.
      After you install this library, enable its usage in ATViewerOptions.inc, uncomment the "PNG" define.

    3. LibTiffDelphi: used to support TIFF.
      After you install this library, enable its usage in ATViewerOptions.inc, uncomment the "TIFF" define. Also you need to compile VTiff.dll (Source\DLL) and place it into application folder.

    4. IJL (Intel JPEG Library): used to fully support JPEG.
      You need IJL15.dll in application folder, IJL.pas and JPEG_IO.pas. After you install them, enable library usage in ATViewerOptions.inc, uncomment the "IJL" define.

    5. GraphicEx: used to support many formats: TGA, TIFF, PSD etc.
      After you install this library, enable its usage in ATViewerOptions.inc, uncomment the "GEX" define.
      Note: You should disable GIF, PNG support in GraphicEx, as they are supported better by GIFImage/PNGImage.

    6. Jpeg2000 lib for Delphi: used to support JP2 graphic.
      After you install this library, enable its usage in ATViewerOptions.inc, uncomment the "JP2" define.

    7. AmnAni DLL: used to support ANI graphic.
      You need amnani.dll, amnani_impl.pas files. After you install this library, enable its usage in ATViewerOptions.inc, uncomment the "ANI" define.

  2. Tnt Unicode Controls: used to load Unicode-named files in some cases. It is used in the following functions:

    • To load Unicode-named files in Image mode (TTntPicture/TTntFileStream classes are used)
    • To load Unicode-named files in RTF mode (TTntFileStream class is used)
    • To read Unicode-named files during text search (TTntFileStream class is used)

    After you install this library, enable its usage in 3 files: ATViewerOptions.inc / ATImageBoxOptions.inc / ATStreamSearchOptions.inc; uncomment the "TNT" define in all these files.

  3. DIRegEx: used to support RegEx (regular expressions) search. After you install this library, enable its usage in file ATStreamSearchOptions.inc, uncomment the "REGEX" define.

  4. ATPrintPreview: used to show the "Print preview" form before the actual printing. After you install this unit, enable its usage in files ATViewerOptions.inc / ATBinHexOptions.inc, uncomment the "PREVIEW" define.

  5. nmzIrfanXnView: used to integrate IfranView/XnView external viewers into Image mode. This unit is included in the ATViewer package. Enable its usage in file ATViewerOptions.inc, uncomment the "IVIEW" define.
Download links for mentioned libraries are listed in the Copyrights topic.


Usage: Properties, General

Properties, General

Mode Current view mode.
Possible values:
  • vmodeText: Text mode
  • vmodeBinary: Binary mode (fixed line length)
  • vmodeHex: Hex mode
  • vmodeUnicode: Unicode and Unicode/Hex modes
  • vmodeRTF: RTF/UTF-8 mode
  • vmodeMedia: Image/Multimedia mode
  • vmodeWeb: Internet mode
  • vmodeWLX: Plugins mode
  • vmodeOffice: MS Office mode
Notes:
  • To activate the combined Unicode/Hex mode, user should call the Unicode mode twice.
  • Plugins mode is available only when "WLX" define is uncommented in ATViewerOptions.inc file.
  • MS Office mode is available only when "MSO" define is uncommented in ATViewerOptions.inc file. It also needs dsoframer.dll, with registered state, at runtime.
  • UTF-8 encoded texts can be shown only under Windows 2000/XP+. This is due to a limitation of MS RichEdit control.
ModeDetect Enables mode auto-detection on file opening.
File type may be determined by extension or sometimes by contents (extension has higher priority than contents). The global variable ATViewerOptions contains extensions lists for different modes, it's declared as record:
  type
    TATViewerGlobalOptions = record
      ExtText: string; //Text mode extensions
      ExtRTF: string; //RTF mode ext
      ExtImages: string; //Images ext
      ExtMedia: string; //Video/audio ext
      ExtInet: string; //Internet mode ext
      ExtOoo: string; //OpenOffice docs ext (for Internet mode)
      ExtMso: string; //MS Office docs ext (for MS Office mode)
      ExtImagesUse: Boolean; //Enables ExtImages field
      ExtMediaUse: Boolean; //Enables ExtMedia field
      ExtInetUse: Boolean; //Enables ExtInet field
      ExtOooUse: Boolean; //Enables ExtOoo field
      ExtMsoUse: Boolean; //Enables ExtMso field
    end;
Note:
  • For Plugins mode the different plugin detection scheme is used: matched plugin is determined first by plugin detect-string, or, if plugin detect-string is empty, the first plugin that can load given file is shown. Plugins mode can have higher or lower priority than internal viewers: see PluginsHighPriority property.
ModesDisabledForDetect
ModeUndetected
ModeUndetectedCfm 		Mode detection options (used when ModeDetect = True):
  • Set of modes that won't be auto-detected.
  • Default mode that is set when nothing is detected.
  • Allows to show confirmation (yellow panel at the top) for unknown file types. When user clicks this message, file is shown in ModeUndetected mode.
FileName
FileSize
FileTime (public, read-only) 		Properties of currently opened file or folder:
  • Name (WideString)
  • Size (Int64)
  • Time (TFileTime record)
Note:
  • To convert FileTime value to a readable string, you may use, for example, the FormatFileTime function from "Universal Viewer" demo.
IsFocused Enables control focusing on file opening.
Note:
  • Set to True if you use component as main form control (e.g. you have something like Universal Viewer demo). Set to False if you use component as additional optional control (e.g. you have something like Browser demo).
BorderStyle (inherited)
BorderStyleInner 		Border styles:
  • Border style of entire TATViewer control.
  • Border style of embedded controls (TATBinHex, TWebBrowser etc).
Note:
  • Set both BorderStyle and BorderStyleInner to bsNone to hide border completely.
PosPercent
PosOffset
PosLine (public) 		Current scroll position:
  • Relative position in percents (%).
    Valid in text, Internet, Plugins modes.
  • Absolute offset (Int64, 0-based).
    Valid in text, Internet modes.
  • Line number (1-based, 0 if line number is not found).
    Valid in text modes only.
Notes for line numbers in ATBinHex control:
  • Lines are separated by: #13#10, #13, #10.
  • Line numbers are counted only for the first portion of file (see TextGutterLines*).
  • Line numbers are counted for the "current" copy of file, they may be incorrect if file was changed (and not reloaded) since the last display.
SearchStarted
SearchFinished (public, read-only) 		Search state flags:
  • Flag that is set after FindFirst method was called once.
  • Flag indicating that FindFirst / FindNext methods returned False on last call.
MarginLeft
MarginTop
MarginRight
MarginBottom (public) 		Printing margins.
Currently in mm.
ParentWnd (public, write-only) Used in ActiveX context. Must be set to parent window's handle.


Usage: Properties, Text-related

Properties, Text-related

TextEncoding Text encoding.
It can be used in Text, Binary, Hex and Plugins modes.
Possible values:
  • vencANSI: ANSI encoding (locale dependent)
  • vencOEM: OEM encoding (locale dependent)
  • vencEBCDIC: IBM EBCDIC US encoding
  • vencKOI8: KOI8-R encoding
  • vencISO: ISO encoding (locale dependent)
  • vencMac: Macintosh encoding (locale dependent)
  • plus many others, see the complete list in ATxCodepages.pas.
Notes:
  • For Plugins mode only ANSI and OEM encodings are available.
  • For Text/Binary/Hex modes ANSI, OEM, EBCDIC, KOI8, ISO, Mac encodings are always available.
  • EBCDIC, KOI8, ISO, Mac encodings are used via MultiByteToWideChar API, if possible. But if they are not installed on OS (for example, on Win9x), then the hardcoded codepages are used.
  • All other encodings are used via MultiByteToWideChar API, they are available only when installed on OS.
TextEncodingName (public, read-only) Name of current text encoding.
Note:
  • It can be read in all text modes, even in Unicode and RTF/UTF-8 modes. In Unicode mode is will show "UTF-16 LE" or "UTF-16 BE". In RTF/UTF-8 mode it will show "RTF" or "UTF-8".
TextDetect
TextDetectOEM
TextDetectSize
TextDetectLimit 		Text auto-detection options.
Text, Unicode and UTF-8 files can be detected.
  • TextDetect: enables auto-detection.
  • TextDetectOEM: enables also detection of OEM codepage.
  • TextDetectSize: size of block (in Kb) read to detect text.
  • TextDetectLimit: maximal file size (in Kb) allowed for detection, 0: don't limit.
TextWrap | Enables word wrap.
TextWidth
TextWidthHex
TextWidthUHex 		Width of text in fixed-length modes:
  • TextWidth: Binary mode.
  • TextWidthHex: Hex mode.
  • TextWidthUHex: Unicode/Hex mode.
TextWidthFit
TextWidthFitHex
TextWidthFitUHex 		Enables width auto-fit in fixed-length modes.
  • TextWidthFit: Binary mode.
  • TextWidthFitHex: Hex mode.
  • TextWidthFitUHex: Unicode/Hex mode.
Note:
  • These properties work correctly only with monospaced fonts. With fonts of variable width you can get text partially not fitting in the control.
TextSearchIndentVert
TextSearchIndentHorz 		Text indents, used when text is highlighted with successfull FindText / FindNext methods call.
  • TextSearchIndentVert: number of lines above selection.
  • TextSearchIndentHorz: average number of chars lefter than selection.
TextTabSize | Tabulation (#9) size.
TextOemSpecial Enables usage of special OEM font (when TextEncoding = vencOEM).
Note:
  • This property should be set to True only on older Win9x systems. NT systems support displaying of OEM text in Unicode (using MultiByteToWideChar API and Unicode fonts), so special OEM font is not needed.
TextNonPrintable Enables displaying of non-printable characters.
Note:
  • When enabled, spaces are shown as small dots, tabs (#9) are shown as "right arrows", and line ends are shown as "paragraphs".
TextUrlHilight Enables URL/mail highlighting.
Note:
  • For this option to work the RegEx library must be compiled in. See ATBinHexOptions.inc file: "REGEX" and "SEARCH" defines must be enabled.
TextGutter
TextGutterLines
TextGutterLinesBufSize
TextGutterLinesCount
TextGutterLinesStep
TextGutterLinesExtUse
TextGutterLinesExtList 		Gutter (vertical bar on the left) options:
  • Enables gutter.
  • Enables line numbers on gutter (in var length modes).
  • Buffer size for line numbers. Lines below this buffer are not counted. Recommended is ~300Kb .. 1Mb.
  • Maximal count of line numbers shown.
  • Step for line numbers. Minimal is 1, means "show numbers for all lines".
  • Enables lines numbers only for specified file extensions.
  • List of file extensions for the previous option. It can be, for example, 'c,cpp,h,hpp,pas,dpr'.
TextFont
TextFontOEM
TextFontFooter
TextFontGutter 		Fonts:
  • Text font.
  • OEM text font. Used in Text/Binary/Hex modes when (TextEncoding = vEncOEM) and (TextOemSpecial = True).
  • Font for printing footer.
  • Font for gutter line numbers.
TextColor
TextColorGutter
TextColorURL
TextColorHi
TextColorHex
TextColorHex2
TextColorHexBack
TextColorLines
TextColorError 		Colors of:
  • Text background
  • Gutter
  • URLs
  • Search highlight color (for option asoShowAll)
  • Hex digits (even)
  • Hex digits (odd)
  • Hex digits background
  • Hex mode vertical lines
  • Error messages (displayed when read error occurs)
TextAutoCopy | Enables auto-copying to Clipboard at the end of text selection operation.
TextAutoReload
TextAutoReloadBeep
TextAutoReloadFollowTail 		File auto-reloading options:
  • TextAutoReload: enables auto-reload.
  • TextAutoReloadBeep: enables beep on reload.
  • TextAutoReloadFollowTail: enables repositioning at the file end, if previous view position was also at the end.
TextPopupCommands Set of commands visible in the popup (right-click) menu.
Commands available:
  • vpCmdCopy: Copy selection to Clipboard.
  • vpCmdCopyHex: Copy selection in hex form in Hex mode.
  • vpCmdSelectLine: Select current line.
  • vpCmdSelectAll: Select all text.
  • vpCmdEncMenu: Show encodings menu.
TextPopupCaption[AIndex: TATPopupCommand]
(public, write-only) 		Captions of popup (right-click) menu items.
For possible values of AIndex see TextPopupCommands.
TextMaxLengths[AIndex: TATBinHexMode] (public) Maximal line lengths.
These values are for all view modes of ATBinHex control. They set internal values that define the maximal length of a single string in a file. Values are 300 by default.
For example, you may set TextMaxLengths[vbmodeText] to 1000 if user needs to work with strings of length 1000 in Text mode.
Notes:
  • Larger values increase size of memory buffer for a file, so slow down file reading.
  • Values are applied after file reopening: after calling Open, Reload methods or after changing Mode property.
TextMaxClipboardDataSizeMb Maximal data size (in Mb), for copying to Clipboard.
Default value is 16 (Mb), which prevents visual "hanging" when too large block is selected accidentally before copying.
TextSelStart (public)
TextSelLength (public)
TextSelText (public, read-only)
TextSelTextW (public, read-only)
TextSelTextShort (public, read-only)
TextSelTextShortW (public, read-only) 		Current selection properties:
  • TextSelStart: Selection start (Int64, 0-based).
  • TextSelLength: Selection length (Int64).
  • TextSelText: Selection text (AnsiString) in non-Unicode modes.
  • TextSelTextW: Selection text (WideString) in Unicode mode.
  • TextSelTextShort: Same as TextSelText, but limited to the length of 256 chars.
  • TextSelTextShortW: Same as TextSelTextW, but limited to the length of 256 chars.
Note:
  • You should call TextSelText/TextSelTextW inside try...except block, because when selection is too big, exception is generated.
BinHex (public, read-only) Embedded text control object (of type TATBinHex).
You can use this object to access advanced text-related properties not published in TATViewer.


Usage: Properties, Media-related

Properties, Media-related

MediaMode Player mode (used when Mode = vmodeMedia).
Possible values:
  • vmmodeNone: "Uninitialized" value that is set when no other modes are available - see Notes.
  • vmmodeMCI: Usage of TMediaPlayer component (Windows MCI interface).
  • vmmodeWMP64: Usage of Windows Media Player 6.4 ActiveX.
  • vmmodeWMP9: Usage of Windows Media Player 9.0 ActiveX.
  • wmmodeCE: Usage of DirectX (Cubic Explorer version).
Notes:
  • MCI and WMP modes are available only when corresponding defines are uncommented in ATViewerOptions.inc.
  • WMP 9.0 mode will not work on end user's machine if no Windows Media Player 9+ is installed, while WMP 6.4 mode should work on all machines since Windows Media Player 6.4 is preinstalled even on Windows 95. Use ATxWMP unit from Universal Viewer demo to check availability of different WMP versions.
MediaAutoPlay
MediaPlayCount
MediaLoop
MediaPlaylistPause
MediaShowControls
MediaShowTracker 		Media properties (when IsMedia = True).
  • Enables auto-start of media playback.
  • Number of times (default is 1) media will be played.
  • Loops media playback. When it is set, MediaPlayCount is ignored.
  • Pause (in msec, default is 500 msec) between media playback end and firing the OnMediaPlaybackEnd event.
  • WMP 6.4 only: Show play controls on WMP control.
  • WMP 6.4 only: Show play tracker on WMP control.
MediaVolume (public) Volume of media player (when IsMedia = True).
It is in the range from 0 to 10.
Notes:
  • Currently not supported with MediaMode = vmmodeMCI.
  • WMP ActiveX controls use different volume ranges in 6.4 and 9+ versions. This property correctly handles both cases.
  • WMP 6.4 ActiveX has an issue: it doesn't always update its Volume property when state is changed using visual controls (when volume slider is dragged by mouse).
MediaMute (public) Mute state of media player (when IsMedia = True).
Note:
  • Currently not supported with MediaMode = vmmodeMCI.
  • WMP 6.4 ActiveX has an issue: it doesn't always update its Mute property when state is changed using visual control (when Mute button is pressed by mouse).
MediaFit
MediaFitOnlyBig
MediaCenter 		Media/image fitting options:
  • Enables fitting of images.
    Works in Multimedia (both for images and for movies) and Plugins modes.
  • Enables fitting of big images only.
    Works in Multimedia (for images only) and Plugins modes.
  • Enables centering of smaller images.
    Works in Multimedia (for images only) and Plugins modes.
IsImage
IsIcon
IsMetafile
IsMedia (public, read-only) 		Flags which show what media type is loaded in Multimedia mode:
  • IsImage: Image (any format).
  • IsIcon: Image which is an icon (ICO).
  • IsMetafile: Image which is a metafile (WMF, EMF).
  • IsMedia: Video or audio clip.
Note:
  • Images and media files are detected by file extension using global variable ATViewerOptions. See description of ModeDetect property for details.
ImageWidth
ImageHeight
ImageBPP (public, read-only) 		Image properties (when IsImage = True):
  • Width.
  • Height.
  • Bits per pixel.
Notes:
  • ImageBPP is supported for GIF, PNG, BMP, JPG (with IJL usage), GraphicEx types. Otherwise it is 0.
  • ImageWidth, ImageHeight change when size effect is applied (ImageEffect method).
ImageColor
ImageDrag
ImageCursor
ImageDragCursor
ImageTransparent
ImageResample
ImageKeepPosition 		Image control properties (when IsImage = True):
  • ImageColor: Color of image background.
  • ImageDrag: Enables dragging of large images by mouse.
  • ImageCursor: Cursor of image object (default is crDefault).
  • ImageDragCursor: Cursor used for image dragging (default is crSizeAll).
  • ImageTransparent: Enables image transparency showing. Affects only formats with transparency (GIF, PNG etc).
  • ImageResample: Enables image resampling on scaling.
  • ImageKeepPosition: Enables keeping of image view position on image scaling and control resizing.
ImageScale (public) Current image scale in percents (%).
Notes:
  • When MediaFit = False, this value is 100 initially; when MediaFit = True, this value is affected by current control size.
  • Changing of this property sets MediaFit to False.
  • You can increase/decrease ImageScale in predefined row of values using ImageScaleInc / ImageScaleDec methods.
ImageBox (public, read-only) Embedded imagebox object (of type TATImageBox, declared in ATImageBox.pas).
Note:
  • Use this object to access advanced image-related properties, such as image label caption/visibility, border size, scrollbars etc.
ImageError
ImageErrorMessage (public, read-only)
ImageErrorMessageBox 		Image error state (when IsImage = True):
  • ImageError: True if image loading error occured.
  • ImageErrorMessage: String describing the error.
  • ImageErrorMessageBox: Enables to display messagebox when error occurs.
Note:
  • When ImageErrorMessageBox = True, messagebox is displayed on image loading error and you don't need to read ImageError/ImageErrorMessage properties. When ImageErrorMessageBox = False, you should read these properties and show error text inside image label, like in this example:
    procedure TFormView.UpdateImageLabel;
begin
  with ATViewer1 do
    if IsImage and Assigned(ImageBox) then
      if ImageError then
      begin
        ImageBox.ImageLabel.Visible := True;
        ImageBox.ImageLabel.Caption := ImageErrorMessage;
        ImageBox.ImageLabel.Font.Color := clRed;
      end
      else
      begin
        ImageBox.ImageLabel.Visible := FImageLabelVisibleFlag;
        ImageBox.ImageLabel.Caption := Format(
          '%d x %d (%d%%)',
          [ImageWidth, ImageHeight, ImageScale]);
        ImageBox.ImageLabel.Font.Color := clBlue;
      end;
end;
IViewIntegration Options that allow to integrate IrfanView/XnView applications into Image mode.
This is record that contains the following fields:
  • Enabled: Enables integration.
  • ExeName: IrfanView or XnView application executable path.
  • ExtList: List (comma separated) of file extensions supported by IrfanView/XnView.
  • HighPriority: Sets the priority for IrfanView/XnView higher than for internal image library. This option works when a file extension (e.g. 'JPG') can be handled by both the internal library and IrfanView/XnView.
Notes:
  • This property is available only when "IVIEW" define is uncommented in ATViewerOptions.inc file.
  • User can switch image loading between internal library and IrfanView/XnView by setting the Mode to vmodeMedia.
IJLIntegration Options that allow to integrate IJL (Intel JPEG Library, ijl15.dll) into Image mode.
This is record that contains the following fields:
  • Enabled: Enables integration.
  • ExtList: List (comma separated) of JPEG file extensions.
Notes:
  • This property is available only when "IJL" define is uncommented in ATViewerOptions.inc file.
  • IJL is used when Enabled = True, and "ijl15.dll" file is present in %PATH%. DLL is loaded dynamically.


Usage: Properties, Web-related

Properties, Web-related

WebOffline Sets the "Offline connection" mode before a browser navigation operation.
Notes:
  • This property is available only when "OFFLINE" define is uncommented in ATViewerOptions.inc. When the property is used, the "wininet.dll" is linked to the application at runtime.
  • This will toggle the global MSIE Offline flag (not TWebBrowser.Offline, since it doesn't work).
  • You don't need to read the global Offline flag at application startup and then restore it on exit. The component performs this task by itself.
WebBusy (public, read-only) Returns the busy state of browser object.
You must check this value in your form's OnCloseQuery event handler like this:
   procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
   begin
     CanClose := not ATViewer1.WebBusy;
   end;
WebAcceptAllFiles Enables the "File Download" browser dialog when attempt to open an unknown file type is performed in Internet mode.
Note:
  • When "IE4X" conditional define is commented in ATViewerOptions.inc, this property is not used. When "IE4X" define is uncommented, this property is used and is False by default so no "File Download" dialogs appear.
WebWaitForNavigate Enables the waiting for browser navigation completion.
Note:
  • Default is False: usually this is not needed and also not recommended (because the time for navigation completion may be significant and this will look like the application is "frozen"). But sometimes it may be useful: for example, if you want to scroll the control (using PosPercent property) immediately after page opening.


Usage: Properties, Plugins-related

Properties, Plugins-related

ActivePluginName
(read-only) 		Name of currently active plugin (or empty string if plugins are not loaded).
It also can be used in Image mode: it shows the name of IrfanView/XnView executable, or the name of IJL library, if it was used to load graphics.
ActivePluginSupportsSearch
ActivePluginSupportsPrint
ActivePluginSupportsCommands
(read-only) 		Indicates does active plugin support:
  • Find / Find Next commands.
  • Print command.
  • Copy / Select All / Go To / Set Parameters commands.
ActivePluginWindowHandle | Handle of active plugin's window (or 0 if plugins are not loaded).
PluginsHighPriority | Sets priority for plugins higher than for internal viewers. When this priority is high, plugins are tried first for a new file, and if no matched plugin is found then matched internal viewer is used (match is determined by file extension and sometimes by contents). When this priority is low, matched internal viewer is used first.


Usage: Methods, General

Methods, General

function Open(const AFileName: WideString; APicture: TPicture = nil): Boolean;
Opens a file.
Result is True if file was successfully opened or False if file was not found or other open error occured.
Pass the empty string to close the currently opened file.
APicture optional parameter can specify the preloaded image object.
Notes:
  • APicture parameter is introduced to reduce flickering when user loads multiple images. For example, user goes through an image directory using "File -- Next" interface command. After user has loaded an image, you can create a thread, that will load the next image in background and save it into TPicture object. When user performs "File -- Next" command again, you can quickly load the preloaded object using APicture parameter, and then create a thread that will load the next image etc.
  • APicture parameter is used only when Image mode is activated (this depends on filename and mode detection properties).
function OpenStream(AStream: TStream; AMode: TATViewerMode): Boolean;
Opens a stream in a given view mode.
Pass nil to stop use the currently used stream.
Result is True if stream was successfully read.
The AMode parameter can be:
  • vmodeText, vmodeBinary, vmodeHex, vmodeUnicode: Stream is passed to ATBinHex control. You can free stream object only after you call OpenStream(nil), because stream is constantly read.
  • vmodeRTF: Stream is read into RichEdit control.
  • vmodeMedia: Stream must contain image data, which will be read into ATImageBox control using OnLoadImageStream event handler.
  • vmodeWeb: Stream must contain data valid for WebBrowser control, it will be read using OnLoadWebStream event handler.
Notes:
  • See "ViewerStream" demo for example of OnLoadImageStream / OnLoadWebStream event handlers.
  • Mode property cannot be changed while stream is opened.
function OpenFolder(const AFolderName: WideString): Boolean;
Opens a folder using Lister plugin.
Result is True if folder was opened using some plugin.
Pass the empty string to close the currently opened plugin (you can also call Open('') for this).
Notes:
  • Examples of Lister plugins which can show folders are VisualDirSize and IEView.
  • Mode property cannot be changed while folder is opened: internal viewers cannot be used for folders.
procedure Reload;
Reloads the currently opened file or folder.
Note:
  • This method just reassigns the old value of Mode property. As the result:
    • when performed in Unicode mode, it switches between pure Unicode and Unicode/Hex modes;
    • when performed in Plugins mode, it loads the next matched plugin.
function FindFirst(const AText: WideString; AOptions: TATStreamSearchOptions): Boolean;
Starts text search.
AText: text to search (Note: Unicode string must be in the Little-Endian format).
AOptions: search options that are set of flags:
  • asoWholeWords: Search for whole words only
  • asoCaseSens: Case-sensitive search
  • asoBackward: Backward search (Note: not supported in RTF mode and for RegEx)
  • asoRegEx: RegEx search (Note: supported only in Text/Binary/Hex/Unicode modes)
  • asoRegExMLine: Multiline regex search (used with asoRegEx)
  • asoFromPage: Starts search from the current page, otherwise in entire file (Note: supported in all text modes)
  • asoShowAll: Highlights all occurances of search string (Note: supported in all text modes)
Result is True if text was found and highlighted.
Notes:
  • RegEx search (asoRegEx option) is available only when RegEx library is compiled in. See ATStreamSearchOptions.inc file.
  • Unicode-named files can be handled during search only when Tnt Unicode Controls are compiled in. See ATStreamSearchOptions.inc file.
  • When non-RegEx search is performed, two different search functions are used: one for 1-byte Text/Binary/Hex modes and another for Unicode mode; they give different search results.
  • In Text/Binary/Hex modes, when TextEncoding <> vencANSI, text is automatically decoded during search.
function FindFirst_(const AText: WideString; AOptions: Integer): Boolean;
Starts text search (the same as FindFirst, it is for ActiveX).
AText: text to search.
AOptions: search options that are sum of flags:
  • vfo_Words = 1: Search for whole words only
  • vfo_Case = 2: Case-sensitive search
  • vfo_Back = 4: Backward search (Note: not supported in RTF mode and for RegEx)
  • vfo_RegEx = 8: RegEx search (Note: supported only in Text/Binary/Hex/Unicode modes)
  • vfo_FromPage = 16: Starts search from the current page, otherwise in entire file (Note: supported in all text modes)
  • vfo_ShowAll = 32: Highlights all occurances of search string (Note: supported in all text modes)
Result is True if text was found and highlighted.
function FindNext(AFindPrevious: Boolean = False): Boolean;
Continues text search.
AFindPrevious: continue search in reverse direction.
Result is the same as for FindFirst method.
Notes:
  • AFindPrevious option can be used only in Text/Binary/Hex/Unicode modes and cannot be used for RegEx search.
  • After you change view mode or reload a file, you cannot continue search immediately, you must first call FindFirst method.
function FindDialog(AFindNext: Boolean): Boolean;
Calls custom search dialog, specific to the current view mode or plugin.
This may be MSIE search dialog in Internet mode, or active plugin's custom dialog.
AFindNext should be set to True for "Find next" command.
Result is True if custom dialog was successfully shown. In this case you don't need to show your own dialog. If Result is False, then you need to show your own dialog and then call FindFirst / FindNext methods.
procedure CopyToClipboard(AsHex: Boolean = False);
Copies data to Clipboard.
This method works differently in various view modes:
  • Text/Binary/Hex: data is the current selection (AnsiString). AsHex parameter may be True, in this case the hex-encoded string (bytes in the hex form separated by spaces) will be copied.
  • Unicode: data is the current selection (WideString).
  • Multimedia: when an image is loaded (IsImage = True): data is the whole image.
  • Internet: data is the current selection (usually HTML text).
  • Plugins: data is the current selection; data type depends on plugin and plugin is responsible for performing the copying operation.
  • RTF: data is the current selection (plain or RTF text).
Note:
  • This method may fail and show an error message if data size selected is too big.
procedure SelectAll;
procedure SelectNone;
  • SelectAll: Selects all text. Works in text, Internet, Plugins modes.
  • SelectNone: Deselects text. Works in text, Internet modes.
procedure PrintDialog;
procedure PrintSetup;
procedure PrintPreview;
  • PrintDialog: Shows "Print" dialog. Works in all modes.
  • PrintSetup: Shows "Page Setup" dialog. Works in all modes.
  • PrintPreview: Shows "Print Preview" dialog. Works in Text/Binary/Hex/Unicode, Multimedia (IsImage = True), Internet modes.
Notes:
  • PrintDialog / PrintPreview methods show preview form in text/Multimedia modes, but only when ATPrintPreview component is used by enabling the "PREVIEW" define in ATBinHexOptions.inc / ATViewerOptions.inc files.
  • PrintSetup / PrintPreview methods show MSIE dialogs in Internet mode.
  • PrintSetup does nothing in Delphi 5-6, because TPageSetupDialog is not available.
procedure FocusActiveControl;
Focuses the active embedded control (TATBinHex, TRichEdit, TWebBrowser etc).
Notes:
  • If you have ATViewer as main form control, you should call FocusActiveControl in your form's WM_ACTIVATE message handler to put focus back to ATViewer after some dialog has been shown.
  • See also IsFocused property.
procedure IncreaseScale(AIncrement: Boolean);
Increases (AIncrement = True) or decreases current font size or image scale.
Works in text, Multimedia (IsImage = True), Internet modes.


Usage: Methods, Text-related

Methods, Text-related

procedure TextPopupMenu(AX, AY: integer);
Shows right-click menu in text modes.
Menu is shown at point (AX, AY).
procedure TextEncodingsMenu(AX, AY: integer);
Shows menu of all available encodings for the current text mode.
Menu is shown at point (AX, AY).
Note:
  • In Unicode mode this method displays the special Unicode menu, which contains only "UTF-16 LE" and "UTF-16 BE" items.
procedure TextScroll(const APos: Int64; AIndentVert, AIndentHorz: integer);
Scrolls text control to a given position.
Control is scrolled to position APos (0-based), with vertical indent AIndentVert characters and average horizontal indent AIndentHorz characters.


Usage: Methods, Media-related

Methods, Media-related

procedure ImageScaleInc;
procedure ImageScaleDec;
Increases or decreases current ImageScale value and sets MediaFit to False (when IsImage = True).
The nearest value to the current ImageScale value is set. The following row of predefined scale values is used: 7, 10, 20, 30... 100, 150... 1600.
function ImageEffect(AEffect: TATViewerImageEffect): Boolean;
Applies an image effect (when IsImage = True).
Possible effects:
  • vieRotate90: rotate image 90 grad clockwise
  • vieRotate270: rotate image 90 grad anti-clockwise
  • vieGrayscale: convert image to grayscale
  • vieNegative: convert image to negative colors
  • vieFlipVertical: flip image vertically
  • vieFlipHorizontal: flip image horizontally
Result is True when effect was successfully applied.
Note:
  • After applying of effect, icons (ICO) and metafiles (WMF, EMF) become "rasterized" and may loose transparency and quality.
procedure MediaDoPlayPause;
Starts or pauses media playback (when IsMedia = True).


Usage: Methods, Web-related

Methods, Web-related

procedure WebGoBack;
procedure WebGoForward;
Navigates page back / forward in Internet mode.


Usage: Methods, Plugins-related

Methods, Plugins-related

procedure RemovePlugins;
Clears internal plugins list.
function AddPlugin(const AFilename: TWlxFilename; const ADetectStr: string): Boolean;
Adds plugin record (file name and detect-string) to internal plugins list.
Result is True if record was added.
Notes:
  • Detect-string is a plugin's "property", which initial value you can get using WlxGetDetectString function (declared in WLXProc.pas). So if you want to add a plugin with its default detect-string, use:
      ATViewer1.AddPlugin(AFileName, WlxGetDetectString(AFileName));
  • Unicode plugins filenames are currently not supported (TWlxFilename is AnsiString).
function GetPlugin(AIndex: word; var AFilename: TWlxFilename; var ADetectStr: string): Boolean;
Returns plugin record (file name and detect-string) from internal list.
Result is True if record with index AIndex exists and was returned.
Note:
  • To get all plugin records, call this function in cycle with AIndex := 1 to WlxPluginsMaxCount, until it returns False.
procedure InitPluginsParams(AParent: TWinControl; const AIniFilename: string);
Initializes plugins' parent control and path to default .ini file.
Must be called before first Open / OpenFolder methods call.
Notes:
  • AParent may be any windowed control, it will be used by plugins as their "parent", they will send some messages to this parent. You may set this parent to ATViewer object or other Panel object, but it's not quite recommended because some (not all) plugins prefer that parent is Form object. For example: xBaseView plugin modifies its parent's main menu, and Imagine/SynPlus plugins modify their parent's caption. Additionally, Form object is preferred because in the case you are going to create fully-functional Viewer that can get current position in percents, you need to handle some messages that plugins are sending to the parent, and redirect them back to plugins (see PluginsSendMessage method).
  • If AParent is Form object, it must have the correct OnResize event handler, which is automatically called after plugin window displaying. In that handler you must call ResizeActivePlugin method to reposition plugin window.
procedure ResizeActivePlugin(const Rect: TRect);
Resizes the active plugin's window to a given rectangle.
Note:
  • It must be called in OnResize event handler of your form or parent control.
procedure PluginsSendMessage(const AMessage: TMessage);
Sends plugin-related message to ATViewer object.
Note:
  • Your form must redirect WM_COMMAND message to Viewer object if you are going to read PosPercent property in Plugins mode. Without this Viewer object cannot know this position and will return 0. Redirection must be done when high word of message's WParam is itm_percent (value declared in WLXPlugin.pas). Sample code of such handler from demo:
      procedure TFormViewUV.WMCommand(var Message: TMessage);
  begin
    inherited;
    if Message.WParamHi = itm_percent then
      ATViewer1.PluginsSendMessage(Message);
  end;


Usage: Events, General

Events, General

OnFileUnload Event fired before view mode has been changed and before a new file has been opened using Open method.
Should be used to perform some file finalization, like saving of current file position.
OnFileLoad Event fired after view mode has been changed and after a new file has been opened using Open method.
Should be used to perform some file post-initialization, like restoring of previously saved file position.
OnModeDetected Event fired after a new value of Mode is set/detected, and before file is loaded in that mode.
OnOptionsChange Event fired after an option has been changed by user.
Examples of such changable options:
  • Text encoding can be changed using right-click menu
  • Text and image scale can be changed using Ctrl + Mouse wheel


Usage: Events, Text-related

Events, Text-related

OnTextFileReload Event fired after file auto-reload has been completed.
See TextAutoReload property.
OnTextSearchProgress Event fired during text search progress. It is of type:
  TATStreamSearchProgress = procedure(
    const ACurrentPos, AMaximalPos: Int64;
    var AContinueSearching: Boolean) of object;
ACurrentPos: current search position,
AMaximalPos: maximal search position (almost equals to file size),
AContinueSearching: if set to False then search will be stopped.


Usage: Events, Media-related

Events, Media-related

OnMediaPlaybackEnd Event fired after media playback has been finished (when IsMedia = True).
OnImageLClick
OnImageRClick 		Events fired on left/right click on image control (when IsImage = True).
OnLoadImageStream Event fired after OpenStream method was called with AMode = vmodeMedia. It is of type:
  type
    TATViewerLoadImageStream = procedure(Sender: TObject;
      AImageBox: TATImageBox; AStream: TStream) of object;
You should load image into AImageBox object from AStream parameter here.
The image can be of any type: TBitmap, TJpegImage, TMetafile etc. See example for this handler in ViewerStream demo.


Usage: Events, Web-related

Events, Web-related

OnWebDocumentComplete Event fired after embedded WebBrowser control completes loading of a document. You may use this event to put focus back to the main application control, this may be needed since the Word/Excel/Acrobat ActiveX steal the focus.
Note:
  • This event corresponds to TWebBrowser.OnDocumentComplete, see Delphi help for details.
OnWebNavigateComplete Event fired after embedded WebBrowser control navigates to a new location.
Note:
  • This event corresponds to TWebBrowser.OnNavigateComplete2, see Delphi help for details.
OnWebStatusTextChange Event fired on webpage status text change.
Note:
  • This event corresponds to TWebBrowser.OnStatusTextChange.
OnWebTitleChange Event fired on webpage title change.
Note:
  • This event corresponds to TWebBrowser.OnTitleChange.
OnLoadWebStream Event fired after OpenStream method was called with AMode = vmodeWeb. It is of type:
  type
    TATViewerLoadWebStream = procedure(Sender: TObject;
      ABrowser: TWebBrowser; AStream: TStream) of object;
You should load data into ABrowser object from AStream parameter.
See example for this handler in ViewerStream demo.


Usage: Events, Plugins-related

Events, Plugins-related

OnPluginsBeforeLoading | Event fired before some plugin attempts to load a file. Name of this plugin is passed as event parameter. Useful for displaying current plugin's name in status bar.
OnPluginsAfterLoading | Event fired after some plugin has finished attempt to load a file.


Usage: Components included

Components included

There are 5 components included in ATViewer package (on "Samples" page of component pallette), plus 2 automatically generated ActiveX controls (on "ActiveX" page of component pallette):
  1. ATViewer: main component that implements all view modes.
  2. ATBinHex: component that implements Text/Binary/Hex/Unicode view modes.
  3. ATImageBox: component that implements image scrolling, scaling and fitting.
  4. ATStreamSearch: component that performs text search.
  5. ATFileNotification: component that creates thread for watching file changes.
  6. WMP: wrapper for Windows Media Player 6.4 ActiveX.
  7. WMP9: wrapper for Windows Media Player 9.0 ActiveX.


Usage: Thread-safety note

Thread-safety note

The current component version is not thread safe. But if you need to use it in a multi-thread application, the following hint should help to use it right. For example, you need to call Open method from several threads. Don't do this, instead do it in message way: all threads should send a message (it may be some Windows message not used in your application, e.g. EM_DISPLAYBAND) to main thread, informing it that a filename should be opened. Pointer to a filename can be passed as message parameter. So the main message handler calls Open.

Note: this may be a risk of receiving messages from several threads at almost the same time, so additional boolean "Busy flag" should be set on message-handler start and reset on exit.


History

3.1.0 (jan 2013)
Changes for ActiveX usage:
  • Added: ParentWnd property
  • Added: FindFirst_ method
  • Added: OnImageLClick/OnImageRClick events
  • Added: methods for localizing ActiveX
3.0.0 (nov 2010)
  • Added: MS Office mode.
  • Added: DirectX media mode.
  • Added: Text modes: asoShowAll search opt to hilight all matches. TextColorHi prop.
  • Added: Text/web modes: TextEnableSel prop.
  • Added: OnModeDetected event.
  • Added: Hex mode: mouse selection on the digits part.
  • Added: Image mode: TIFF multipage print.
  • Added: ATViewerOptions record has new fields (ExtOoo, ExtMso...)
  • Changed: some ATViewerOptions.inc/ATBinHexOptions.inc defines renamed.
  • Fixed: Plugins D2009 issue.
  • Fixed: WMP6 with Vista size issue.
  • Fixed: UTF-8 D2009 issue.
  • Help: added issues with some plugins.
2.8.4 (9 sep 2009)
  • Added: ModeUndetectedCfm prop. Allows to hide dump initially.
  • Fixed: loading of big RTF.
  • Fixed: hang with some wrong MHT.
2.8.2 (3 may 2009)
  • Added: TIFF support using VTiff.dll (see Source\DLL).
  • Added: TIFF multipage support, if DLL present.
  • Fixed: ANI support fixed.
  • Fixed: codepages list rearranged.
2.8.0 (4 apr 2009)
  • Added: OpenStream method.
  • Added: OnLoadImageStream, OnLoadWebStream events.
  • Demo: ViewerStream.
  • Added: TextGutterLinesStep prop.
2.7.0 (16 mar 2009)
  • Added: Text URL/mail highlighting.
  • Added: asoRegExMLine search option.
  • Fixed: UTF-8 search next.
2.6.4 (7 dec 2008)
  • Added: Delphi 2009 compat.
  • Added: OnWebTitleChange event.
  • Added: MediaShowControls, MediaShowTracker prop.
  • Fixed: SearchStarted with auto-reload.
  • Fixed: Image flickering.
2.6.0 (06 sep 2008)
  • Added: Line numbers: TextGutterLines*, TextFontGutter.
  • Added: Delphi 5 compat returned.
  • Fixed: FocusActiveControl.
  • Fixed: Text printing.
  • Fixed: Text reload line up issue.
  • Fixed: RichEdit find text selection.
2.5.0 (25 Jun)
  • Added: "JP2" define, Jpeg2000 library usage.
  • Added: "ANI" define, Amnani library usage.
  • Added: MediaLoop prop.
  • Added: PosLine prop.
  • Added: OnWebStatusTextChange event.
  • Fixed: Text tailing issue.
  • Demo: SearchSimple.
2.4.0 (30 Mar)
  • Added: ImageBPP prop.
  • Added: PngImage usage, "PNG" define.
  • Added: IJL15.dll usage, "IJL" define / IJLIntegration prop.
2.3.0 (01 Mar)
  • Added: Printing:
    • Margin* properties.
    • Margins handling during PrintSetup call.
    • TextFontFooter property.
    • Text page numbers are printed.
  • Added: Text mode: Notepad minor feature: follow tail on control resize.
  • Fixed: Text mode: Vertical scrollbar may disappear on some files.
  • Fixed: Text mode: TextAutoReload could not apply sometimes.
  • Fixed: Some Image* properties not changable in design time.
2.2.0 (27 Jan 2008)
  • Added: FindFirst method has additional asoFromPage option.
  • Added: FindNext method has additional AFindPrevious parameter to find previous match.
  • Added: ImageError, ImageErrorMessage, ImageErrorMessageBox properties.
  • Changed: MediaColor property renamed to ImageColor.
  • Removed: TextVariableScrollbar property.
  • Fixed: FindNext error after changing view mode.
  • Fixed: Some Image* properties were not published.
2.1.0 (30 Dec 2007)
  • Added: OpenFolder method, which allows to use such plugins as VisualDirSize.
  • Added: "Applications -- Lister plugins issues" topic in this help.
  • Changed: CloseActivePlugin method removed: use Open('') instead.
  • Fixed: Plugins mode: "WLX_UNLOAD" define added in ATViewerOptions.inc, comment it to prevent AVs with some plugins.
  • Fixed: Plugins mode: Plugins could not load when ModeDetect = False.
2.0.0 (17 Dec 2007)
  • Added: Open method has additional parameter to reduce image flickering.
  • Added: Text mode: TextGutter, TextGutterWidth, TextColorGutter properties.
  • Added: Text mode: Tabs (#9) have correct dynamic size (currently only for monospaced fonts).
  • Added: ATFileNotificationSimple helper component (not used currently).
  • Fixed: Text mode: TextAutoReload option could not apply sometimes.
  • Fixed: Text mode: Trailing spaces showing on word wrap.
  • Fixed: Internet mode: WebBrowser memory leak.
  • Fixed: Plugins mode: Plugins were not unloaded on file closing.
  • Fixed: MsgBox() could loose form focus.
  • Changed: "Universal Viewer" demo forms renamed.
1.9.2 (28 Oct 2007)
  • Added: TextOemSpecial property.
  • Added: TextNonPrintable property.
  • Changed: Msg* properties changed to single TextPopupCaption[] property.
  • Added: Topic "Misc -- Applications" in this help.
1.9.0 (20 Oct 2007):
  • Added: Text mode: Many codepages added, see complete list in ATxCodepages.pas. See notes for TextEncoding property. Note: RegEx search for custom codepages is not yet implemented.
  • Added: Text mode: TextEncodingName property.
  • Added: Text mode: TextEncodingsMenu method.
  • Added: Text mode: "Encodings menu" popup menu item.
  • Added: Text/Image modes: Mouse shortcut for zoom: left button + wheel.
  • Added: Reload method.
  • Changed: OnScaleChange event removed, OnOptionsChange added instead.
  • Fixed: File was not closed completely if FindFirst method was called.
  • Fixed: Text mode: Number of wheel scroll lines now read correctly.
1.8.1 (01 Oct 2007):
  • Added: Internet mode: WebBusy property - must be checked in form's OnCloseQuery handler.
1.8.0 (28 Sep 2007):
  • Added: View mode "Unicode/Hex", similar to FAR manager's one. To activate it user should call the Unicode mode twice.
  • Added: Text modes: Nice scroll by middle mouse click, like in MSIE / Firefox.
  • Added: Text modes: Support for KOI8-R codepage. More codepages will be added later.
  • Added: Text modes: Properties TextWidthUHex, TextWidthFitUHex.
  • Added: Text modes: Properties TextSelTextShort, TextSelTextShortW.
  • Added: Image mode: ImageEffect method can apply "Flip horizontally" and "Flip vertically" effects.
  • Changed: Internet mode: Reworked WebOffline property: global Offline flag is used. Now when property is True, application should not connect to Internet at all. Default value changed to False. Also see notes for WebOffline property.
  • Changed: Internet mode: Initial status of global Offline flag is saved, and then restored on application exit.
  • Changed: Plugins mode: Additional "WLX_FORM" define in ATViewerOptions.inc instead of "FAKE_TC_FORM" define in WLXProc.pas. It is commended by default.
  • Changed: Image mode: All ImageXXXX properties made public (correct your DFM files).
  • Fixed: Image mode: Transparency setting for animated GIFs.
  • Removed: ATxIniProc unit removed from demos.
1.7.2 (22 Aug 2007):
  • Added: Image mode: ImageResample property (not for Win9x).
  • Added: Image mode: Large images are shown during loading.
  • Changed: Refactored image methods to work not with TImage but with TPicture. This is needed for compatability with TATImage.
  • Changed: MediaPlay property renamed to MediaAutoPlay.
  • Fixed: Internet mode: Acrobat Reader plugin could cause crash on application exit.
1.7.0 (01 Aug 2007):
  • Changes regarding printing:
    • Added: Print method for Text/Binary/Hex/Unicode modes is rewritten, so control prints itself in exactly the same view as it's shown on screen (but grayscaled). The printing in Unicode mode is finally done!
    • Added: ATPrintPreview component (separate download) is used to show print preview form in Text/Binary/Hex/Unicode and Image modes. It can be enabled by uncommenting the "PREVIEW" define in ATViewerOptions.inc / ATBinHexOptions.inc.
    • Changed: The usage of ATPrintPreview component is required for images printing.
  • Added: IrfanView/XnView can be integrated into Image mode with the help of nmzIrfanXnView unit (you need to uncomment the "IVIEW" define in ATViewerOptions.inc). See the IViewIntegration property.
  • Added: Text mode: Only chars missed in the current font are replaced with dots.
  • Fixed: Plugins mode: Exception with FileInfo plugin.
  • Fixed: Internet mode: BMP files sometimes open in a new window.
  • Changed: Text mode: Property TextScrollPageSize renamed to TextVariableScrollbar, it's default value is False now.
1.6.2 (19 Jun 2007):
  • Added: OnFileUnload, OnFileLoad events
  • Added: BinHex public property
  • Added: MediaVolume, MediaMute, MediaPlayCount properties
  • Added: MediaDoPlayPause method
  • Changed: ATStreamSearch updated for DIRegEx 4.1.1 release
  • Changed: OnDocumentLoaded event renamed to OnWebDocumentComplete
  • Added: OnWebNavigateComplete event
  • Added: Text mode: Auto-scroll when mouse is lefter/righter than client area
  • Added: Text mode: Shift + Mouse Wheel scrolls horizontally
  • Added: Text mode: Ctrl + Mouse Wheel changes font size
  • Added: Image mode: Ctrl + Mouse Wheel changes image scale
  • Added: OnScaleChange event
  • Fixed: Text mode: Possible AV on text selection under Multi-Byte locales
1.6.0 (28 Mar 2007):
  • Changed: License updated to MPL 1.1
  • Added: ATImageBox and ATStreamSearch helper components
  • Added: RegEx search option (DIRegEx library must be used)
  • Added: Text modes feature: triple click selects current line
  • Some methods/properties added and some removed:
    • Changed: FindFirst/FindNext methods instead of FindText
    • Added: TextMaxClipboardDataSizeMb property
    • Added: ImageBox property
    • Changed: TextSearchIndent property renamed to TextSearchIndentVert
    • Changed: ImageLabelVisible and ImageLabelCaption properties removed, use ImageBox.ImageLabel.Visible and ImageBox.ImageLabel.Caption instead
    • Changed: OnTextSearchProgress event added instead of SearchCallback property
  • Changed: AT*Def.inc files renamed to AT*Options.inc; several options added to ATViewerOptions.inc
1.5.8 (25 Feb 2007):
  • Changed: Text modes: files are not locked for deletion anymore (Note: not supported under Win9x)
  • Added: RTF/UTF-8 mode: RichEdit control made URL aware (Note: not supported under Win9x)
  • Added: RTF/UTF-8 mode: UTF-8 files can be shown without UTF-8 signatures (Note: not supported under Win9x)
  • Added: Plugins mode: support for TC 7 Lister API; better parsing of plugins detect-strings
  • Added: Image mode: image is scrollable by keyboard and mouse wheel
  • Added: FindDialog method
  • Removed: FindWeb method
  • Added: PrintDialog method can print images now
  • Added: IncreaseScale method
  • Added: PosPercent/PosOffset properties work also in Internet mode
  • Added: TextSelStart, TextSelLength, TextSelText, TextSelTextW properties; TextScroll method
  • Added: FileName, FileSize, FileTime, ModeUndetected, SearchFinished properties
  • Added: MediaPlaylistPause, ImageKeepPosition properties
  • Added: WebAcceptAllFiles, WebWaitForNavigate properties
  • Added: OnTextFileReload event
  • Changed: Declaration of FindText method
  • Changed: Renamed method ShowPopupMenu to TextPopupMenu
  • Fixed: Resizing of transparent images
1.5.6 (16 Dec 2006):
  • Added: FindText/FindNext methods work also in Unicode mode
  • Added: TextSearchIndentHorz property
  • Added: Properties: ImageDrag, ImageCursor, ImageDragCursor, MediaCenter
  • Added: Properties: ImageLabelVisible, ImageLabelCaption, ImageLabelFont
  • Changed: Declaration of ffViewerExt* variables, they are moved into record ATViewerOptions
  • Changed: Declaration of PluginsSendMessage method
  • Changed: Renamed property MediaIconSize to ImageIconSize
  • Changed: Renamed event OnPlaybackEnd to OnMediaPlaybackEnd
  • Changed: Renamed several variables in ATViewerMsg.pas
1.5.5 (24 Nov 2006):
  • Added: Properties: ModesDisabledForDetect, MediaFitOnlyBig, TextPopupCommands, TextMaxLengths, IsImage, IsIcon, IsMetafile, IsMedia
  • Added: IE4X conditional define in ATViewerDef.inc that enables usage of MSIE 4+ OnFileDownload event, it's used to supress "File Download" MSIE dialog
  • Added: ImageScale property; ImageScaleInc, ImageScaleDec, ImageEffect methods
  • Added: FocusActiveControl, ShowPopupMenu methods
  • Added: WebGoBack, WebGoForward methods
  • Added: CopyToClipboard method also works with images
1.5.3 (02 Oct 2006):
  • Added: Properties: TextAutoReload, TextAutoReloadBeep, TextAutoReloadFollowTail
  • Added: Properties: TextAutoCopy, TextTabSize, TextColorHexBack, PosOffset
1.5.2 (09 Sep 2006):
  • Changed: Most of units renamed to AT*.* to avoid name confusions
  • Changed: GIFImage is used instead of RX Lib's GIFCtrl - see ATViewerDef.inc
  • Added: WMP 9.0 mode; all media modes made optional - see ATViewerDef.inc
  • Added: Compatability with xBaseView Lister plugin
  • Added: BorderStyleInner property
  • Added: OnDocumentLoaded event
1.5.0 (22 Jul 2006):
  • Added: Improved Text mode: now it doesn't use MS RichEdit, so files of any size can be opened
  • Added: Improved Unicode mode: now it has variable line length, Select/Copy commands are supported in it
  • Added: RTF mode, which is an "old" Text mode that uses RichEdit. It's used for RTF and UTF-8 files.
    Note: UTF-8 files are supported only under Win 2K/XP and must have special signature.
  • Fixed: Error in Internet mode when IE 7 is installed
  • Added: TextFontOEM, TextDetectOEM, TextScrollPageSize properties
...

1.0.0 (16 Mar 2006):
  • Initial version


License

This package, unless otherwise stated in the particular source code file, is distributed under Mozilla Public License Version 1.1 (the "License"). You may obtain a copy of the License at http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

Copyright © 2006-2007 Alexey Torgashin.


Issues with Lister plugins

Here is the list of known issues with Lister plugins, when they are used under Universal Viewer application.

Plugins:

  • AmpView
  • AnyTag
  • ArcView
  • ArchView
  • DBF-View (CDBFView)
  • FileView
  • FlashView
  • GSA Lister
  • HPG_Ed
  • HTMLView
  • IEView
  • IniEd
  • Media Show
  • MMedia
  • MyViewPad
  • SGHMMF (SGHFS)
  • SGViewer
  • SWFView
  • SWF Lister
  • xBaseView
  • XPIInfo
  • WSZView

Issues:

AmpView

(Version 3.2)

  • Generally, AmpView is not recommended under UV, because it completely hides UV interface, leaving only plugin window on screen.
  • Plugin moves UV window out of screen, so after UV restart window position will be reset.

AnyTag

(Version 0.93)
  • Issue under Windows Vista: if plugin was used once, then on UV exit you'll see Windows error message box (translated from Russian): "Application has been terminated... There was a problem that caused the application to terminate..."

ArcView

(Version 1.2)
  • After plugin closing UV window becomes invisible.

ArchView

(Version 0.9.1.2)
  • Plugin may corrupt UV window size on every plugin activation. The solution for this: write the following options to the ArchView.ini:
    [Window]
WidthWindow=600
HeightWindow=400
SaveWindowSize=0

DBF-View (CDBFView)

(Version 1.1)

This plugin is currently not supported. It requires support of rarely-used Lister API function, which is currently not implemented in ATViewer base component. Suggestion: use BaseView and xBaseView plugins instead, they are both more functional than DBF-View.

FileView

(Version 2.0 alpha)
  • UV window changes to zero height, so that just the caption bar remains.

FlashView

(Version 1.4)
  • On some SWF files UV may crash on exit.

GSA Lister

(Version 1.02)
  • UV crashes on exit.
  • "Lister find" button doesn't work.

HPG_Ed

(Version 0.5.13)
  • Plugin doesn't respect UV window size, and may show file preview above toolbar.

HTMLView

(Version 1.2.4)
  • "Find" toolbar button doesn't work.
  • Plugin shows empty flickering statusbar.

IEView

(Version 1.94.1)
  • Generally, plugin is not recommended, because UV already has embedded MSIE-based viewer.
  • Plugin is not too stable, so sometimes it shows exceptions, for example after plugin reloading.
  • Plugin doesn't respect UV window size, and may show file preview out of window.
  • Plugin may show unrequested MSIE's search dialog during invoke of UV's built-in search dialog.

IniEd

(Version 1.2)
  • Plugin text search doesn't work.

Media Show

(Version 0.9.5)
  • Generally, Media Show is not recommended under UV because it completely hides UV interface creating its own dialog window, and leaving "ghost" taskbar button of UV on screen.
  • If you'll add unsupported media file types to the MediaShow.ini file (for example .RM type), you will see exceptions on plugin loading, and after that UV will crash on exit. So don't use Media Show with new file types, use UV's embedded WMP-based viewer instead.

MMedia

(Version 2.4.4.0)
  • It conflicts with UV's embedded WMP-based viewer: after plugin using embedded viewer opens Windows Media Player in the new window.
  • It's not stable, it sometimes shows exceptions on opening.
  • WMV files may block Viewer.

MyViewPad

(Version 3.5.0)
  • Generally, MyViewPad is not recommended under UV because it completely hides UV interface creating its own dialog window. Also the plugin has some visual glitches when called from UV, it seems it expects only Total Commander as an application.

SGHMMF (SGHFS)

(Version: SGHMMF 1.2, SGHFS 1.41)
  • After plugin usage Viewer may crash (show multiple error messages) on exit. The reason of this is currently unknown.

SGViewer

(Version 1.8.8)

Note: these issues are fixed in SGViewer 1.9.

  • Full Screen menu item is grayed. Plugin can start fullscreen if you set so in options but you can't return from it.
  • Fit to Screen option doesn't work.

SWFView

(Version 1.3.3)
  • If flash file is opened at 100%, plugin changes the window size, and then doesn't restore it on closing. So after plugin closing window size changes. Workaround for this: uncheck UV option "Misc -- Save window position".

SWF Lister

(Version 2.0.0.1)
  • On some SWF files: after playing file, plugin disables closing of UV window, so that only Ctrl-Alt-Del can close window.

xBaseView

(Version 7.2)
  • Note that xBaseView doesn't work under UV versions older than 1.5.2.
  • Issue that is fixed in xBaseView 7.3+: plugin modifies the UV main menu, but doesn't restore it correctly on close, so that some menu items become renamed.

XPIInfo

(Version 1.1d)
  • Plugin has strange drawing issues under UV.

WSZView

(Version 2.95)
  • Plugin can activate on non-supported file types and then it just shows an empty black screen. As a solution for this, to disable unrequested plugin activation, delete "FORCE" word from WSZView's detect-string in plugins configuration dialog.


Copyrights & Links

  • ATViewer, ATPrintPreview © 2006-2009 Alexey Torgashin
    http://www.uvviewsoft.com

  • Graphic libraries:
    • GraphicEx © Mike Lischke
      http://www.soft-gems.net

    • GIFImage © Anders Melander, Finn Tolderlund
      http://www.tolderlund.eu/delphi/

    • PNGImage © Gustavo Huffenbacher Daud
      http://pngdelphi.sourceforge.net

    • LibTiffDelphi © AWare Systems
      http://www.awaresystems.be

    • Jasper library binding for Delphi © Gabriel Corneanu
      http://codecentral.borland.com

    • IJL (IJL15.dll, IJL.pas) © Intel Corp.
      http://intel.com
                       INTeL CORPORATION PROPRIETARY INFORMATION
    This software is supplied under the terms of a license agreement or
    nondisclosure agreement with Intel Corporation and may not be copied
    or disclosed except in accordance with the terms of that agreement.
          Copyright (c) 1998 Intel Corporation. All Rights Reserved.

    • IJL add. interface (JPEG_IO.pas) © David J Taylor, Edinburgh
      http://www.satsignal.eu/
      (Note: mail me (Alex) about modified version of David's unit)

    • AmnAni library © Alexey Novosselov
      http://www.torry.net

    • IView interface (nmzIrfanXnView.pas) © Nikolay M. Zhukov
      http://www.nmzlabs.com
      (included in this package)

  • Tnt Unicode Controls © 2002-2007 Troy Wolbrink
    http://www.yunqa.de

  • DIRegEx © 2000-2007 Ralf Junker, The Delphi Inspiration
    http://www.yunqa.de

  • Compilers defines (Compilers.inc) © Mike Lischke, Jim Kueneman
    http://www.mustangpeak.net

  • WebBrowser functions (originally WBFuncs.pas) © Thomas Stutz
    http://www.swissdelphicenter.ch
    http://www.torry.net/authorsmore.php?id=5786

  • Bitmap effect functions (originally GraphFlip.pas) © 2005 Colin Wilson
    http://www.wilsonc.demon.co.uk

  • TRichEditURL - hyperlink aware RichEdit © Zarko Gajic
    http://delphi.about.com
    http://delphi.about.com/od/vclwriteenhance/l/aa051804a.htm


Contacts

If you encounter problems with this component, or you have comments or suggestions, contact the author:

Alexey Torgashin
http://www.uvviewsoft.com


Applications

Here is the list of rather cool applications currently utilized the component. If you also have used it, please send the link to your application's homepage to add to this list.
  • Universal Viewer - Multi-format file viewer.
  • UltraExplorer - Explorer-like file manager, with advanced features and look.
  • TwoDirs - Commander-style (dual panel) file manager.
  • Duplicate File Detector - Tool to search for file duplicates on your computer.
  • Index Your Files - Tool to search files with indexing and advanced features.
  • Filedoyen - Integrated file and zip manager, text and hex editor, file compare and search.
  • Stylet File Manager - File manager with Multiple Document Interface approach.
  • 10-Strike Network File Search - Tool allows to search files on network shared resources.
  • FreeCommander - Commander-style file manager.
  • Unreal Commander - Commander-style file manager.
  • GFA - Corporate application, which is documenting company's technical structure.
  • mgm Software - Company ERP solution.