Commit b1582463 authored by ondrej's avatar ondrej
Browse files

qt: edit: force show texthint in ShowHide. issue #32053

git-svn-id: trunk@55718 -
parent 2fef454a
......@@ -29,7 +29,7 @@ uses
// RTL
math,
// LCL
Classes, Types, StdCtrls, Controls, Forms, SysUtils, InterfaceBase, LCLType,
Classes, Types, Graphics, StdCtrls, Controls, Forms, SysUtils, InterfaceBase, LCLType,
// Widgetset
WSProc, WSStdCtrls, WSLCLClasses;
......@@ -154,6 +154,7 @@ type
class function GetSelLength(const ACustomEdit: TCustomEdit): integer; override;
class procedure SetSelStart(const ACustomEdit: TCustomEdit; NewStart: integer); override;
class procedure SetSelLength(const ACustomEdit: TCustomEdit; NewLength: integer); override;
class procedure ShowHide(const AWinControl: TWinControl); override;
//class procedure SetPasswordChar(const ACustomEdit: TCustomEdit; NewChar: char); override;
class procedure Cut(const ACustomEdit: TCustomEdit); override;
......@@ -265,6 +266,14 @@ type
published
end;
{ TEditHelper }
TEditHelper = class helper for TCustomEdit
public
function EmulatedTextHintStatus: TCustomEdit.TEmulatedTextHintStatus;
function CreateEmulatedTextHintFont: TFont;
end;
implementation
uses qtint;
......@@ -291,6 +300,18 @@ const
QFrameSunken
);
{ TEditHelper }
function TEditHelper.EmulatedTextHintStatus: TCustomEdit.TEmulatedTextHintStatus;
begin
Result := FEmulatedTextHintStatus;
end;
function TEditHelper.CreateEmulatedTextHintFont: TFont;
begin
Result := inherited CreateEmulatedTextHintFont;
end;
{ TQtWSScrollBar }
......@@ -1030,6 +1051,31 @@ begin
QtEdit.setSelection(AStart, NewLength);
end;
class procedure TQtWSCustomEdit.ShowHide(const AWinControl: TWinControl);
var
Widget: TQtWidget;
EditFont: TFont;
begin
if not WSCheckHandleAllocated(AWincontrol, 'ShowHide') then
Exit;
Widget := TQtWidget(AWinControl.Handle);
Widget.BeginUpdate;
TQtWSWinControl.ShowHide(AWinControl);
if AWinControl.HandleObjectShouldBeVisible
and (TCustomEdit(AWinControl).EmulatedTextHintStatus=thsShowing) then
begin
EditFont := TCustomEdit(AWinControl).CreateEmulatedTextHintFont;
try
SetFont(AWinControl, EditFont);
finally
EditFont.Free;
end;
end;
Widget.EndUpdate;
end;
class procedure TQtWSCustomEdit.Cut(const ACustomEdit: TCustomEdit);
var
Widget: TQtWidget;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment