Browse Source

Update TInputQueryMemoForm. This should finish Compil32.

Martijn Laan 1 month ago
parent
commit
c6712b2b25

+ 9 - 8
Projects/Src/IDE.InputQueryMemoForm.dfm

@@ -27,15 +27,16 @@ object InputQueryMemoForm: TInputQueryMemoForm
     Caption = '...'
     FocusControl = ValueControl
   end
-  object DocImage: TImage
-    Left = 8
-    Top = 115
-    Width = 16
-    Height = 16
+  object DocBitBtn: TBitmapButton
+    Left = 6
+    Top = 113
+    Width = 20
+    Height = 20
     Cursor = crHandPoint
     Anchors = [akLeft, akBottom]
     AutoSize = True
-    Transparent = True
+    Caption = 'Help'
+    TabOrder = 1
   end
   object OKButton: TButton
     Left = 421
@@ -46,7 +47,7 @@ object InputQueryMemoForm: TInputQueryMemoForm
     Caption = 'OK'
     Default = True
     ModalResult = 1
-    TabOrder = 1
+    TabOrder = 2
   end
   object CancelButton: TButton
     Left = 501
@@ -57,7 +58,7 @@ object InputQueryMemoForm: TInputQueryMemoForm
     Cancel = True
     Caption = 'Cancel'
     ModalResult = 2
-    TabOrder = 2
+    TabOrder = 3
   end
   object ValueControl: TMemo
     Left = 279

+ 12 - 12
Projects/Src/IDE.InputQueryMemoForm.pas

@@ -2,7 +2,7 @@ unit IDE.InputQueryMemoForm;
 
 {
   Inno Setup
-  Copyright (C) 1997-2020 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
@@ -14,7 +14,7 @@ unit IDE.InputQueryMemoForm;
 interface
 
 uses
-  Classes, Controls, StdCtrls, UIStateForm, Vcl.ExtCtrls;
+  Classes, Controls, StdCtrls, UIStateForm, ExtCtrls, BitmapButton;
 
 type
   TInputQueryMemoForm = class(TUIStateForm)
@@ -22,7 +22,7 @@ type
     CancelButton: TButton;
     PromptLabel: TLabel;
     ValueControl: TMemo;
-    DocImage: TImage;
+    DocBitBtn: TBitmapButton;
     procedure FormCreate(Sender: TObject);
     procedure ValueControlKeyPress(Sender: TObject; var Key: Char);
     procedure ValueControlChange(Sender: TObject);
@@ -36,16 +36,16 @@ type
     procedure SetPrompt(const APrompt: String);
     procedure SetValue(const AValue: String);
     procedure UpdateImages;
-    procedure SetDocImageClick(const Value: TNotifyEvent);
+    procedure SetDocBitBtnClick(const Value: TNotifyEvent);
   public
-    property DocImageClick: TNotifyEvent write SetDocImageClick;
+    property DocBitBtnClick: TNotifyEvent write SetDocBitBtnClick;
     property Prompt: String write SetPrompt;
     property SingleLine: Boolean write FSingleLine;
     property Value: String read GetValue write SetValue;
   end;
 
 function InputQueryMemo(const ACaption, APrompt: String; var AValue: String;
-  const ASingleLine: Boolean = False; const ADocImageClick: TNotifyEvent = nil): Boolean;
+  const ASingleLine: Boolean = False; const ADocBitBtnClick: TNotifyEvent = nil): Boolean;
 
 implementation
 
@@ -56,14 +56,14 @@ uses
 {$R *.DFM}
 
 function InputQueryMemo(const ACaption, APrompt: String; var AValue: String;
-  const ASingleLine: Boolean; const ADocImageClick: TNotifyEvent): Boolean;
+  const ASingleLine: Boolean; const ADocBitBtnClick: TNotifyEvent): Boolean;
 begin
   with TInputQueryMemoForm.Create(Application) do try
     Caption := ACaption;
     Prompt := APrompt;
     Value := AValue;
     SingleLine := ASingleLine;
-    DocImageClick := ADocImageClick;
+    DocBitBtnClick := ADocBitBtnClick;
     if ShowModal = mrOk then begin
       AValue := Value;
       Result := True;
@@ -92,10 +92,10 @@ begin
   Result := ValueControl.Text;
 end;
 
-procedure TInputQueryMemoForm.SetDocImageClick(const Value: TNotifyEvent);
+procedure TInputQueryMemoForm.SetDocBitBtnClick(const Value: TNotifyEvent);
 begin
-  DocImage.OnClick := Value;
-  DocImage.Visible := Assigned(DocImage.OnClick);
+  DocBitBtn.OnClick := Value;
+  DocBitBtn.Visible := Assigned(DocBitBtn.OnClick);
 end;
 
 procedure TInputQueryMemoForm.SetPrompt(const APrompt: String);
@@ -149,7 +149,7 @@ procedure TInputQueryMemoForm.UpdateImages;
 begin
  { After a DPI change the button's Width and Height isn't yet updated, so calculate it ourselves }
   var WH := MulDiv(16, CurrentPPI, 96);
-  DocImage.Picture.Graphic:= GetImage(MainForm.HelpButton, WH);
+  DocBitBtn.Bitmap:= GetImage(MainForm.HelpButton, WH).Bitmap;
 end;
 
 end.

+ 3 - 3
Projects/Src/IDE.SignToolsForm.pas

@@ -32,7 +32,7 @@ type
     procedure SignToolsListBoxDblClick(Sender: TObject);
   private
     FSignTools: TStringList;
-    procedure CommandDocImageClick(Sender: TObject);
+    procedure CommandDocBitBtnClick(Sender: TObject);
     procedure UpdateSignTools;
     procedure UpdateSignToolsButtons;
     procedure SetSignTools(SignTools: TStringList);
@@ -91,7 +91,7 @@ begin
   SendMessage(Handle, WM_SETICON, ICON_BIG, 0);
 end;
 
-procedure TSignToolsForm.CommandDocImageClick(Sender: TObject);
+procedure TSignToolsForm.CommandDocBitBtnClick(Sender: TObject);
 begin
   if Assigned(HtmlHelp) then
     HtmlHelp(GetDesktopWindow, PChar(GetHelpFile), HH_DISPLAY_TOPIC, Cardinal(PChar('topic_setup_signtool.htm')));
@@ -128,7 +128,7 @@ begin
       end;
     end;
 
-    if InputQueryMemo(Caption, 'Command of the Sign Tool:', SignToolCommand, True, CommandDocImageClick) then begin
+    if InputQueryMemo(Caption, 'Command of the Sign Tool:', SignToolCommand, True, CommandDocBitBtnClick) then begin
       if SignToolCommand = '' then begin
         AppMessageBox(PChar('Invalid command.'), PChar(Caption), MB_OK or MB_ICONSTOP);
         Exit;