?? usage methods.html
字號:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Usage: Methods, General</title>
<link href="Main.css" rel="stylesheet" type="text/css">
</head>
<body>
<h2>Methods, General</h2>
<hr>
<table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td><font color="DarkBlue">function Open(const AFileName: WideString; APicture: TPicture = nil): Boolean;</font><br>
Opens a file.<br>
Result is True if file was successfully opened or False if file
was not found or other open error occured.<br>
Pass the empty AFileName string to close the currently open file.<br>
APicture optional parameter can specify the preloaded image object.<br>
Notes:<br>
<ul>
<li>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.
<li>APicture parameter is used only when the Image mode is activated
(see description of ModeDetect property for details).
</ul>
</td>
</tr>
<tr>
<td><font color="DarkBlue">function OpenFolder(const AFolderName: WideString): Boolean;</font><br>
Opens a folder using Lister plugin.<br>
Result is True if folder was opened using some plugin.<br>
Pass the empty AFolderName string to close the currently open plugin
(you can also call Open('') for this).<br>
Notes:<br>
<ul>
<li>Examples of Lister plugins which can show folders are VisualDirSize and IEView.
<li>You cannot change Mode property while folder is opened: internal viewers cannot be used for folders.
</ul>
</td>
</tr>
<tr>
<td><font color="DarkBlue">procedure Reload;</font><br>
Reloads the currently opened file or folder.<br>
Note:
<ul>
<li>This method just reassigns the old value of Mode property. As the result:
<ul>
<li>when performed in Unicode mode, it switches between pure Unicode and Unicode/Hex modes;
<li>when performed in Plugins mode, it loads the next matched plugin.
</ul>
</ul>
</td>
</tr>
<tr>
<td><font color="darkblue">function FindFirst(const AText: WideString; AOptions: TATStreamSearchOptions): Boolean;</font><br>
Starts text search.<br>
AText: text to search (Note: Unicode string must be in the Little-Endian format),<br>
AOptions: search options that are set of flags:<br>
<ul>
<li> <b>asoWholeWords</b>: search for whole words only </li>
<li> <b>asoCaseSens</b>: case-sensitive search </li>
<li> <b>asoBackward</b>: backward search (Note: not supported in RTF mode and for RegEx) </li>
<li> <b>asoRegEx</b>: RegEx search (Note: supported only in Text/Binary/Hex/Unicode modes) </li>
<li> <b>asoFromPage</b>: starts search from current page, otherwise in entire file
(Note: supported in all text modes, but not for RegEx) </li>
</ul>
Result is True if text was found and highlighted.<br>
Notes:<br>
<ul>
<li> RegEx search (asoRegEx option) is available only when RegEx library is compiled in.
See ATStreamSearchOptions.inc file.</li>
<li> Unicode-named files can be handled during search only when Tnt Unicode Controls
are compiled in. See ATStreamSearchOptions.inc file.</li>
<li> 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.</li>
<li> In Text/Binary/Hex modes, when TextEncoding <> vencANSI, text is automatically decoded during search.</li>
</ul>
</td>
</tr>
<tr>
<td><font color="DarkBlue">function FindNext(AFindPrevious: Boolean = False): Boolean;</font><br>
Continues text search.<br>
AFindPrevious: continue search in reverse direction.<br>
Result is the same as for FindFirst method.<br>
Notes:<br>
<ul>
<li> AFindPrevious option can be used only in Text/Binary/Hex/Unicode modes
and cannot be used for RegEx search.
<li> After you change view mode or reload a file, you cannot continue search
immediately, you must first call FindFirst method.</li>
</ul>
</td>
</tr>
<tr>
<td><font color="DarkBlue">function FindDialog(AFindNext: Boolean): Boolean;</font><br>
Calls custom search dialog, specific to the current view mode or plugin.<br>
This may be MSIE search dialog in Internet mode, or active plugin's
custom dialog.<br>
AFindNext should be set to True for "Find next" command.<br>
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.</td>
</tr>
<tr>
<td><font color="DarkBlue">procedure CopyToClipboard(AsHex: Boolean = False);</font><br>
Copies data to Clipboard.<br>
This method works differently in various view modes:
<ul>
<li> 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. </li>
<li> Unicode: data is the current selection (WideString). </li>
<li> Multimedia: when an image is loaded (IsImage = True): data is the whole image. </li>
<li> Internet: data is the current selection (usually HTML text). </li>
<li> Plugins: data is the current selection; data type depends on plugin and
plugin is responsible for performing the copying operation. </li>
<li> RTF: data is the current selection (plain or RTF text). </li>
</ul>
Note:
<ul>
<li>This method may fail and show an error message if data size selected is too big.</li>
</ul>
</td>
</tr>
<tr>
<td>
<font color="DarkBlue">
procedure SelectAll; <br>
procedure SelectNone;
</font>
<br>
<ul>
<li> <b>SelectAll</b>: Selects all text. Works in text, Internet, Plugins modes.
<li> <b>SelectNone</b>: Deselects text. Works in text, Internet modes.
</ul>
</td>
</tr>
<tr>
<td>
<font color="DarkBlue">
procedure PrintDialog; <br>
procedure PrintSetup; <br>
procedure PrintPreview;
</font>
<br>
<ul>
<li> <b>PrintDialog</b>: Shows "Print" dialog. Works in all modes.
<li> <b>PrintSetup</b>: Shows "Print Setup" dialog. Works in all modes.
<li> <b>PrintPreview</b>: Shows "Print Preview" dialog. Works in Text/Binary/Hex/Unicode, Multimedia (IsImage = True), Internet modes.
</ul>
Notes:<br>
<ul>
<li> 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.
<li> PrintPreview method always shows MSIE preview dialog in Internet mode.
</ul>
</td>
</tr>
<tr>
<td><font color="DarkBlue">procedure FocusActiveControl;</font><br>
Focuses the active embedded control (TATBinHex, TRichEdit, TWebBrowser etc).<br>
Notes:
<ul>
<li>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.
<li>See also IsFocused property.
</ul>
</td>
</tr>
<tr>
<td><font color="DarkBlue">procedure IncreaseScale(AIncrement: Boolean);</font><br>
Increases (AIncrement = True) or decreases current font size or
image scale.<br>
Works in text, Multimedia (IsImage = True), Internet modes.
</td>
</tr>
</tbody>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -