Переглянути джерело

The "Compiler Output" and "Debug Output" views now support multi selection, an extra Select All popup menu item and Ctrl+C and Ctrl+A keyboard shortcuts. The Copy action now only copies the selected lines instead of all lines.

Martijn Laan 6 роки тому
батько
коміт
3407f32aa5
3 змінених файлів з 49 додано та 2 видалено
  1. 8 0
      Projects/CompForm.dfm
  2. 40 2
      Projects/CompForm.pas
  3. 1 0
      whatsnew.htm

+ 8 - 0
Projects/CompForm.dfm

@@ -69,6 +69,7 @@ object CompileForm: TCompileForm
         Align = alClient
         BorderStyle = bsNone
         ItemHeight = 13
+        MultiSelect = True
         PopupMenu = ListPopupMenu
         TabOrder = 1
         Visible = False
@@ -83,6 +84,7 @@ object CompileForm: TCompileForm
         Align = alClient
         BorderStyle = bsNone
         ItemHeight = 13
+        MultiSelect = True
         PopupMenu = ListPopupMenu
         TabOrder = 0
         OnDrawItem = CompilerOutputListDrawItem
@@ -643,8 +645,14 @@ object CompileForm: TCompileForm
     Top = 168
     object PListCopy: TMenuItem
       Caption = '&Copy'
+      ShortCut = 16451
       OnClick = PListCopyClick
     end
+    object PListSelectAll: TMenuItem
+      Caption = 'Select &All'
+      ShortCut = 16449
+      OnClick = PListSelectAllClick
+    end
   end
   object BuildImageList: TImageList
     ColorDepth = cd32Bit

+ 40 - 2
Projects/CompForm.pas

@@ -173,6 +173,7 @@ type
     TerminateButton: TToolButton;
     ToolBarImageCollection: TImageCollection;
     ToolBarVirtualImageList: TVirtualImageList;
+    PListSelectAll: TMenuItem;
     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     procedure FExitClick(Sender: TObject);
     procedure FOpenClick(Sender: TObject);
@@ -253,6 +254,7 @@ type
       Rect: TRect; State: TOwnerDrawState);
     procedure FormAfterMonitorDpiChanged(Sender: TObject; OldDPI,
       NewDPI: Integer);
+    procedure PListSelectAllClick(Sender: TObject);
   private
     { Private declarations }
     FCompilerVersion: PCompilerVersionInfo;
@@ -896,7 +898,7 @@ begin
   SetFakeShortCutText(VZoomOut, SmkcCtrl + 'Num -');
   SetFakeShortCutText(VZoomReset, SmkcCtrl + 'Num /');
   { Use fake Esc shortcut for Stop Compile so it doesn't conflict with the
-    editor's autocompletion list } 
+    editor's autocompletion list }
   SetFakeShortCut(BStopCompile, VK_ESCAPE, []);
 
 {$IFNDEF IS_D103RIO}
@@ -3874,8 +3876,44 @@ begin
 end;
 
 procedure TCompileForm.PListCopyClick(Sender: TObject);
+var
+  ListBox: TListBox;
+  Text: String;
+  I: Integer;
 begin
-  Clipboard.AsText := (ListPopupMenu.PopupComponent as TListBox).Items.Text;
+  if CompilerOutputList.Visible then
+    ListBox := CompilerOutputList
+  else
+    ListBox := DebugOutputList;
+  Text := '';
+  if ListBox.SelCount > 0 then begin
+    for I := 0 to ListBox.Items.Count-1 do begin
+      if ListBox.Selected[I] then begin
+        if Text <> '' then
+          Text := Text + SNewLine;
+        Text := Text + ListBox.Items[I];
+      end;
+    end;
+  end;
+  Clipboard.AsText := Text;
+end;
+
+procedure TCompileForm.PListSelectAllClick(Sender: TObject);
+var
+  ListBox: TListBox;
+  I: Integer;
+begin
+  if CompilerOutputList.Visible then
+    ListBox := CompilerOutputList
+  else
+    ListBox := DebugOutputList;
+  ListBox.Items.BeginUpdate;
+  try
+    for I := 0 to ListBox.Items.Count-1 do
+      ListBox.Selected[I] := True;
+  finally
+    ListBox.Items.EndUpdate;
+  end;
 end;
 
 procedure TCompileForm.AppOnIdle(Sender: TObject; var Done: Boolean);

+ 1 - 0
whatsnew.htm

@@ -28,6 +28,7 @@ For conditions of distribution and use, see <a href="http://www.jrsoftware.org/f
 
 <p><a name="6.0.3"></a><span class="ver">6.0.3-dev </span><span class="date">?</span></p>
 <ul>
+  <li>Compiler IDE change: The "Compiler Output" and "Debug Output" views now support multi selection, an extra <i>Select All</i> popup menu item and <i>Ctrl+C</i> and </i>Ctrl+A</i> keyboard shortcuts. The <i>Copy</i> action now only copies the selected lines instead of all lines.</li>
   <li>Added official Slovak translation.</li>
   <li>Minor tweaks.</li>
 </ul>