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;