mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 02:19:09 +02:00
LCL: Use the new TextHint in FilterEdit. Issue #28070, patch from Alexey Torgashin.
git-svn-id: trunk@49008 -
This commit is contained in:
parent
801a25a549
commit
81f5c05782
@ -1934,6 +1934,7 @@ begin
|
|||||||
Button.Enabled:=False;
|
Button.Enabled:=False;
|
||||||
fIsFirstUpdate:=True;
|
fIsFirstUpdate:=True;
|
||||||
fIsFirstSetFormActivate:=True;
|
fIsFirstSetFormActivate:=True;
|
||||||
|
TextHint:=rsFilter;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomControlFilterEdit.Destroy;
|
destructor TCustomControlFilterEdit.Destroy;
|
||||||
@ -1999,7 +2000,7 @@ procedure TCustomControlFilterEdit.SetFilter(const AValue: string);
|
|||||||
var
|
var
|
||||||
NewValue: String;
|
NewValue: String;
|
||||||
begin
|
begin
|
||||||
if AValue=rsFilter then
|
if (TextHint<>'') and (AValue=TextHint) then
|
||||||
NewValue:=''
|
NewValue:=''
|
||||||
else
|
else
|
||||||
NewValue:=AValue;
|
NewValue:=AValue;
|
||||||
@ -2007,11 +2008,6 @@ begin
|
|||||||
if (NewValue<>'') or Focused or fJustActivated or (csDesigning in ComponentState) then
|
if (NewValue<>'') or Focused or fJustActivated or (csDesigning in ComponentState) then
|
||||||
begin
|
begin
|
||||||
Text:=NewValue;
|
Text:=NewValue;
|
||||||
Font.Color:=clDefault;
|
|
||||||
end
|
|
||||||
else begin
|
|
||||||
Text:=rsFilter;
|
|
||||||
Font.Color:=clBtnShadow;
|
|
||||||
end;
|
end;
|
||||||
if fFilter=NewValue then exit;
|
if fFilter=NewValue then exit;
|
||||||
fFilter:=NewValue;
|
fFilter:=NewValue;
|
||||||
@ -2055,8 +2051,6 @@ procedure TCustomControlFilterEdit.EditEnter;
|
|||||||
begin
|
begin
|
||||||
// inherited;
|
// inherited;
|
||||||
fJustActivated:=False;
|
fJustActivated:=False;
|
||||||
if Text=rsFilter then
|
|
||||||
Text:='';
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomControlFilterEdit.EditExit;
|
procedure TCustomControlFilterEdit.EditExit;
|
||||||
@ -2069,6 +2063,7 @@ end;
|
|||||||
procedure TCustomControlFilterEdit.ButtonClick;
|
procedure TCustomControlFilterEdit.ButtonClick;
|
||||||
begin
|
begin
|
||||||
fJustActivated:=False;
|
fJustActivated:=False;
|
||||||
|
Text:='';
|
||||||
Filter:='';
|
Filter:='';
|
||||||
if FocusOnButtonClick then FEdit.SetFocus; //don't SelectAll here
|
if FocusOnButtonClick then FEdit.SetFocus; //don't SelectAll here
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user