From abc306261e14ebe07707f2063c827aa4ffcb2e04 Mon Sep 17 00:00:00 2001 From: jesus Date: Thu, 29 Sep 2005 18:20:55 +0000 Subject: [PATCH] unpublished dbedit.text property, dbedit show text at runtime only when it needs to (bug #1243) git-svn-id: trunk@7853 - --- lcl/dbctrls.pp | 2 +- lcl/include/dbedit.inc | 9 +++++++++ lcl/maskedit.pp | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lcl/dbctrls.pp b/lcl/dbctrls.pp index 503ffa4f49..4b9897dfae 100644 --- a/lcl/dbctrls.pp +++ b/lcl/dbctrls.pp @@ -142,6 +142,7 @@ Type Operation: TOperation); override; function EditCanModify: Boolean; override; + function GetEditText: string; override; procedure Change; override; procedure Reset; override; @@ -180,7 +181,6 @@ Type property ShowHint; property TabOrder; property TabStop; - property Text; property Visible; property OnChange; property OnClick; diff --git a/lcl/include/dbedit.inc b/lcl/include/dbedit.inc index ce1b9a602a..98ccd2b943 100644 --- a/lcl/include/dbedit.inc +++ b/lcl/include/dbedit.inc @@ -182,6 +182,15 @@ begin Result := FDataLink.Edit; end; +function TDBEdit.GetEditText: string; +begin + if not (csDesigning in ComponentState) and not FDatalink.Active then begin + Result := ''; + exit; + end; + Result:=inherited GetEditText; +end; + procedure TDBEdit.Change; begin //need to override this to make sure the datalink gets notified diff --git a/lcl/maskedit.pp b/lcl/maskedit.pp index 1d12d9a57b..d243d86b80 100644 --- a/lcl/maskedit.pp +++ b/lcl/maskedit.pp @@ -91,7 +91,6 @@ type function AddEditFormat(const Value: string; Active: Boolean): string; function RemoveEditFormat(const Value: string): string; function FindLiteralChar (MaskOffset: Integer; InChar: Char): Integer; - function GetEditText: string; function GetMasked: Boolean; function GetMaskText: string; function GetMaxLength: Integer; @@ -118,6 +117,7 @@ type procedure DoEnter; override; procedure DoExit; override; procedure Reset; virtual; + function GetEditText: string; virtual; function GetFirstEditChar: Integer; function GetLastEditChar: Integer; function GetNextEditChar(Offset: Integer): Integer;