Prechádzať zdrojové kódy

ADD:experimental Ctrl+Wheel zoom of search results,improved selection and PopUp of search results

meteu 9 rokov pred
rodič
commit
b77f4df8e9
5 zmenil súbory, kde vykonal 153 pridanie a 34 odobranie
  1. 1 1
      src/dcrevision.inc
  2. 7 4
      src/fFindDlg.lfm
  3. 88 1
      src/fFindDlg.pas
  4. 53 27
      src/frames/foptionstools.lfm
  5. 4 1
      src/uglobs.pas

+ 1 - 1
src/dcrevision.inc

@@ -1,2 +1,2 @@
 // Created by Svn2RevisionInc
-const dcRevision = '6509:6510M';
+const dcRevision = '6510:6511M';

+ 7 - 4
src/fFindDlg.lfm

@@ -18,7 +18,7 @@ object frmFindDlg: TfrmFindDlg
   Position = poScreenCenter
   SessionProperties = 'Height;Left;Top;Width;WindowState'
   ShowInTaskBar = stAlways
-  LCLVersion = '1.4.3.0'
+  LCLVersion = '1.4.4.0'
   object pnlFindFile: TPanel
     Left = 3
     Height = 391
@@ -35,9 +35,9 @@ object frmFindDlg: TfrmFindDlg
       Height = 391
       Top = 0
       Width = 724
-      ActivePage = tsStandard
+      ActivePage = tsResults
       Align = alClient
-      TabIndex = 0
+      TabIndex = 4
       TabOrder = 0
       OnChange = pgcSearchChange
       object tsStandard: TTabSheet
@@ -1157,7 +1157,10 @@ object frmFindDlg: TfrmFindDlg
             MultiSelect = True
             OnDblClick = lsFoundedFilesDblClick
             OnKeyDown = lsFoundedFilesKeyDown
-            PopupMenu = PopupMenuFind
+            OnMouseDown = lsFoundedFilesMouseDown
+            OnMouseUp = lsFoundedFilesMouseUp
+            OnMouseWheelDown = lsFoundedFilesMouseWheelDown
+            OnMouseWheelUp = lsFoundedFilesMouseWheelUp
             ScrollWidth = 707
             TabOrder = 1
           end

+ 88 - 1
src/fFindDlg.pas

@@ -33,7 +33,7 @@ uses
   Graphics, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ComCtrls,
   ExtCtrls, Menus, EditBtn, Spin, Buttons, ZVDateTimePicker, KASComboBox,
   fAttributesEdit, uDsxModule, DsxPlugin, uFindThread, uFindFiles,
-  uSearchTemplate, fSearchPlugin, uFileView;
+  uSearchTemplate, fSearchPlugin, uFileView, types;
 
 type
 
@@ -180,6 +180,14 @@ type
     procedure lsFoundedFilesDblClick(Sender: TObject);
     procedure lsFoundedFilesKeyDown(Sender: TObject;
       var Key: Word; Shift: TShiftState);
+    procedure lsFoundedFilesMouseDown(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
+    procedure lsFoundedFilesMouseUp(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
+    procedure lsFoundedFilesMouseWheelDown(Sender: TObject; Shift: TShiftState;
+      MousePos: TPoint; var Handled: Boolean);
+    procedure lsFoundedFilesMouseWheelUp(Sender: TObject; Shift: TShiftState;
+      MousePos: TPoint; var Handled: Boolean);
     procedure miRemoveFromLlistClick(Sender: TObject);
     procedure miShowAllFoundClick(Sender: TObject);
     procedure miShowInViewerClick(Sender: TObject);
@@ -1445,6 +1453,85 @@ begin
   end;
 end;
 
+procedure TfrmFindDlg.lsFoundedFilesMouseDown(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+var
+  i:integer;
+  AFile: TFile;
+  AFiles: TFiles;
+  APoint: TPoint;
+begin
+  i:=lsFoundedFiles.ItemAtPos(Point(X,Y),False);
+
+  if Button=mbRight then
+  begin
+    if Shift=[ssCtrl] then lsFoundedFiles.ClearSelection;
+    if i>=0 then lsFoundedFiles.Selected[i]:=True;
+  end;
+end;
+
+procedure TfrmFindDlg.lsFoundedFilesMouseUp(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+  if Button=mbRight then
+  begin
+
+    if Shift=[ssCtrl] then
+    begin
+      {$IF DEFINED(MSWINDOWS)}
+      {
+      try
+        AFile:= TFileSystemFileSource.CreateFileFromFile(ShellTreeView.Path);
+        try
+          AFiles:= TFiles.Create(AFile.Path);
+          AFiles.Add(AFile);
+          APoint := ShellTreeView.ClientToScreen(Classes.Point(X, Y));
+          ShowContextMenu(ShellTreeView, AFiles, APoint.X, APoint.Y, False, nil);
+        finally
+          FreeAndNil(AFiles);
+        end;
+      except
+        on E: EContextMenuException do
+          ShowException(E)
+        else;
+      end;
+      }
+      {$ENDIF}
+
+    end else
+    begin
+      PopupMenuFind.PopUp;
+    end;
+
+  end;
+end;
+
+procedure TfrmFindDlg.lsFoundedFilesMouseWheelDown(Sender: TObject;
+  Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
+begin
+  if (Shift=[ssCtrl])and(gFonts[dcfEditor].Size<MAX_FONT_SIZE_EDITOR) then
+  begin
+    //gFonts[dcfEditor].Size:=gFonts[dcfEditor].Size+1;
+    //FontOptionsToFont(gFonts[dcfEditor], Editor.Font);
+
+    lsFoundedFiles.Font.Size:=lsFoundedFiles.Font.Size-1;
+    Handled:=True;
+  end;
+end;
+
+procedure TfrmFindDlg.lsFoundedFilesMouseWheelUp(Sender: TObject;
+  Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
+begin
+  if (Shift=[ssCtrl])and(gFonts[dcfEditor].Size<MAX_FONT_SIZE_EDITOR) then
+  begin
+    //gFonts[dcfEditor].Size:=gFonts[dcfEditor].Size+1;
+    //FontOptionsToFont(gFonts[dcfEditor], Editor.Font);
+
+    lsFoundedFiles.Font.Size:=lsFoundedFiles.Font.Size+1;
+    Handled:=True;
+  end;
+end;
+
 procedure TfrmFindDlg.miRemoveFromLlistClick(Sender: TObject);
 var
   i:Integer;

+ 53 - 27
src/frames/foptionstools.lfm

@@ -3,33 +3,59 @@ inherited frmOptionsViewer: TfrmOptionsViewer
   Width = 586
   ClientHeight = 513
   ClientWidth = 586
-  object gbViewerBookMode: TGroupBox[7]
+  DesignLeft = 384
+  DesignTop = 288
+  inherited edtToolsParameters: TEdit
+    Top = 113
+  end
+  inherited fneToolsPath: TFileNameEdit
+    Top = 61
+  end
+  inherited lblToolsPath: TLabel
+    Height = 15
+    Width = 144
+  end
+  inherited lblToolsParameters: TLabel
+    Height = 15
+    Top = 94
+    Width = 117
+  end
+  inherited cbToolsKeepTerminalOpen: TCheckBox
+    Top = 169
+  end
+  inherited cbToolsRunInTerminal: TCheckBox
+    Top = 148
+  end
+  inherited btnRelativeToolPath: TSpeedButton
+    Top = 61
+  end
+  object gbViewerBookMode: TGroupBox[8]
     AnchorSideLeft.Control = fneToolsPath
     AnchorSideTop.Control = cbToolsKeepTerminalOpen
     AnchorSideTop.Side = asrBottom
     AnchorSideRight.Control = fneToolsPath
     AnchorSideRight.Side = asrBottom
     Left = 8
-    Height = 244
-    Top = 186
-    Width = 554
+    Height = 250
+    Top = 200
+    Width = 525
     Anchors = [akTop, akLeft, akRight]
     AutoSize = True
     BorderSpacing.Top = 12
     BorderSpacing.Bottom = 10
     Caption = 'Viewer Book Mode'
     ChildSizing.TopBottomSpacing = 6
-    ClientHeight = 226
-    ClientWidth = 550
+    ClientHeight = 230
+    ClientWidth = 521
     TabOrder = 5
     object lblBackgroundColorViewerBook: TLabel
       AnchorSideTop.Control = cbBackgroundColorViewerBook
       AnchorSideTop.Side = asrCenter
       AnchorSideRight.Control = cbBackgroundColorViewerBook
       Left = 8
-      Height = 13
-      Top = 13
-      Width = 154
+      Height = 15
+      Top = 12
+      Width = 174
       Caption = '&Background color in book viewer'
       FocusControl = cbBackgroundColorViewerBook
       ParentColor = False
@@ -38,8 +64,8 @@ inherited frmOptionsViewer: TfrmOptionsViewer
       AnchorSideLeft.Control = cbFontColorViewerBook
       AnchorSideTop.Control = cbFontColorViewerBook
       AnchorSideTop.Side = asrBottom
-      Left = 182
-      Height = 21
+      Left = 202
+      Height = 23
       Top = 62
       Width = 36
       BorderSpacing.Top = 5
@@ -54,9 +80,9 @@ inherited frmOptionsViewer: TfrmOptionsViewer
       AnchorSideTop.Control = seNumberColumnsViewer
       AnchorSideTop.Side = asrCenter
       Left = 8
-      Height = 13
+      Height = 15
       Top = 66
-      Width = 163
+      Width = 187
       Caption = '&Number of columns in book viewer'
       FocusControl = seNumberColumnsViewer
       ParentColor = False
@@ -70,21 +96,21 @@ inherited frmOptionsViewer: TfrmOptionsViewer
       AnchorSideBottom.Control = seNumberColumnsViewer
       AnchorSideBottom.Side = asrBottom
       Left = 8
-      Height = 133
-      Top = 87
-      Width = 534
+      Height = 135
+      Top = 89
+      Width = 505
       Anchors = [akTop, akLeft, akRight]
       AutoSize = True
       BorderSpacing.Around = 8
       Caption = 'Example'
       ClientHeight = 115
-      ClientWidth = 530
+      ClientWidth = 501
       TabOrder = 4
       object pbViewerBook: TPaintBox
         Left = 5
         Height = 105
         Top = 5
-        Width = 520
+        Width = 491
         Align = alClient
         BorderSpacing.Around = 5
         OnPaint = pbViewerBookPaint
@@ -98,7 +124,7 @@ inherited frmOptionsViewer: TfrmOptionsViewer
       AnchorSideRight.Side = asrBottom
       AnchorSideBottom.Control = cbFontColorViewerBook
       AnchorSideBottom.Side = asrBottom
-      Left = 510
+      Left = 481
       Height = 22
       Top = 35
       Width = 24
@@ -113,7 +139,7 @@ inherited frmOptionsViewer: TfrmOptionsViewer
       AnchorSideTop.Control = cbBackgroundColorViewerBook
       AnchorSideBottom.Control = cbBackgroundColorViewerBook
       AnchorSideBottom.Side = asrBottom
-      Left = 510
+      Left = 481
       Height = 22
       Top = 8
       Width = 24
@@ -130,10 +156,10 @@ inherited frmOptionsViewer: TfrmOptionsViewer
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Control = cbBackgroundColorViewerBook
       AnchorSideRight.Side = asrBottom
-      Left = 182
+      Left = 202
       Height = 22
       Top = 35
-      Width = 324
+      Width = 275
       Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbPrettyNames]
       Anchors = [akTop, akLeft, akRight]
       BorderSpacing.Top = 5
@@ -146,9 +172,9 @@ inherited frmOptionsViewer: TfrmOptionsViewer
       AnchorSideTop.Control = cbFontColorViewerBook
       AnchorSideTop.Side = asrCenter
       Left = 8
-      Height = 13
-      Top = 40
-      Width = 120
+      Height = 15
+      Top = 39
+      Width = 134
       BorderSpacing.Top = 10
       Caption = '&Font color in book viewer'
       FocusControl = cbFontColorViewerBook
@@ -158,10 +184,10 @@ inherited frmOptionsViewer: TfrmOptionsViewer
       AnchorSideLeft.Control = lblBackgroundColorViewerBook
       AnchorSideLeft.Side = asrBottom
       AnchorSideRight.Control = btnBackViewerColor
-      Left = 182
+      Left = 202
       Height = 22
       Top = 8
-      Width = 324
+      Width = 275
       Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbPrettyNames]
       Anchors = [akTop, akLeft, akRight]
       BorderSpacing.Left = 20

+ 4 - 1
src/uglobs.pas

@@ -79,7 +79,7 @@ type
   TExternalToolsOptions = array[TExternalTool] of TExternalToolOptions;
   TResultingFramePositionAfterCompare = (rfpacActiveOnLeft, rfpacLeftOnLeft);
 
-  TDCFont = (dcfMain, dcfViewer, dcfEditor, dcfLog, dcfViewerBook, dcfConsole);
+  TDCFont = (dcfMain, dcfViewer, dcfEditor, dcfLog, dcfViewerBook, dcfConsole, dcfFileSearchResults);
   TDCFontOptions = record
     Name: String;
     Size: Integer;
@@ -148,6 +148,9 @@ const
   MAX_FONT_SIZE_VIEWER=70;
   MIN_FONT_SIZE_VIEWER=6;
 
+  MAX_FONT_SIZE_FILE_SEARCH_RESULTS=70;
+  MIN_FONT_SIZE_FILE_SEARCH_RESULTS=6;
+
 
 var
   { For localization }