Browse Source

FIX: Return focus to plugin window when plugin use internal search dialog

Alexander Koblov 11 years ago
parent
commit
d0f5716466
1 changed files with 9 additions and 1 deletions
  1. 9 1
      src/fviewer.pas

+ 9 - 1
src/fviewer.pas

@@ -37,7 +37,7 @@ unit fViewer;
 interface
 
 uses
-  SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, ComCtrls,
+  SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, ComCtrls, LMessages,
   LCLProc, Menus, Dialogs, ExtDlgs, StdCtrls, Buttons, ColorBox, Spin,
   Grids, ActnList, viewercontrol, GifAnim, fFindView, WLXPlugin, uWLXModule,
   uFileSource, fModView, Types, uThumbnails, uFormCommands, uOSForms;
@@ -275,6 +275,9 @@ type
 
     property Commands: TFormCommands read FCommands implements IFormCommands;
 
+  protected
+    procedure WMSetFocus(var Message: TLMSetFocus); message LM_SETFOCUS;
+
   public
     constructor Create(TheOwner: TComponent; aFileSource: IFileSource; aQuickView: Boolean = False); overload;
     constructor Create(TheOwner: TComponent); override;
@@ -779,6 +782,11 @@ begin
     end;
 end;
 
+procedure TfrmViewer.WMSetFocus(var Message: TLMSetFocus);
+begin
+  if bPlugin then WlxPlugins.GetWlxModule(ActivePlugin).SetFocus;
+end;
+
 procedure TfrmViewer.miPreviewClick(Sender: TObject);
 var
   i: integer;