mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Issue #144: Let grid editors call TExtForm.FixControls on their MainControl, to support Ctrl+Backspace there.
This commit is contained in:
@ -20,7 +20,7 @@ type
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
procedure InheritFont(AFont: TFont);
|
||||
property HasSizeGrip: Boolean read GetHasSizeGrip write SetHasSizeGrip default False;
|
||||
class procedure FixControls(FormOrFrame: TScrollingWincontrol);
|
||||
class procedure FixControls(ParentComp: TComponent);
|
||||
end;
|
||||
// Memo replacement which accepts any line break format
|
||||
TLineNormalizingMemo = class(TMemo)
|
||||
@ -72,13 +72,12 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
class procedure TExtForm.FixControls(FormOrFrame: TScrollingWincontrol);
|
||||
class procedure TExtForm.FixControls(ParentComp: TComponent);
|
||||
var
|
||||
i: Integer;
|
||||
Cmp: TComponent;
|
||||
begin
|
||||
for i:=0 to FormOrFrame.ComponentCount-1 do begin
|
||||
Cmp := FormOrFrame.Components[i];
|
||||
|
||||
procedure ProcessSingleComponent(Cmp: TComponent);
|
||||
begin
|
||||
if (Cmp is TButton) and (TButton(Cmp).Style = bsSplitButton) then begin
|
||||
// Work around broken dropdown (tool)button on Wine after translation:
|
||||
// https://sourceforge.net/p/dxgettext/bugs/80/
|
||||
@ -99,6 +98,13 @@ begin
|
||||
SHAutoComplete(TCustomEdit(Cmp).Handle, SHACF_AUTOAPPEND_FORCE_ON or SHACF_AUTOSUGGEST_FORCE_ON);
|
||||
end;
|
||||
end;
|
||||
begin
|
||||
// Passed component itself may also be some control to be fixed
|
||||
// e.g. TInplaceEditorLink.MainControl
|
||||
ProcessSingleComponent(ParentComp);
|
||||
for i:=0 to ParentComp.ComponentCount-1 do begin
|
||||
ProcessSingleComponent(ParentComp.Components[i]);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -8,7 +8,7 @@ uses
|
||||
Windows, Forms, Graphics, Messages, VirtualTrees, ComCtrls, SysUtils, Classes,
|
||||
StdCtrls, ExtCtrls, CheckLst, Controls, Types, Dialogs, Menus, Mask, DateUtils, Math,
|
||||
dbconnection, dbstructures, apphelpers, texteditor, bineditor, gnugettext,
|
||||
StrUtils, System.UITypes, SynRegExpr, Vcl.Themes;
|
||||
StrUtils, System.UITypes, SynRegExpr, Vcl.Themes, extra_controls;
|
||||
|
||||
type
|
||||
// Radio buttons and checkboxes which do not pass <Enter> key to their parent control
|
||||
@ -304,6 +304,7 @@ begin
|
||||
if Assigned(FMainControl) then begin
|
||||
FOldWindowProc := FMainControl.WindowProc;
|
||||
FMainControl.WindowProc := TempWindowProc;
|
||||
TExtForm.FixControls(FMainControl);
|
||||
end;
|
||||
// Adjust editor position and allow repainting mainform
|
||||
SetBounds(FCellTextBounds);
|
||||
|
Reference in New Issue
Block a user