lcl: change TCustomMaskEdit.EditMask to protected. Issue #20790

git-svn-id: trunk@33899 -
This commit is contained in:
blikblum 2011-12-01 21:36:28 +00:00
parent 4a0c93d51e
commit dbccbd3689
2 changed files with 8 additions and 6 deletions

View File

@ -76,13 +76,15 @@ type
end; end;
{ TMaskEditEditor } { TMaskEditEditor }
TCustomMaskEditAccess = class(TCustomMaskEdit)
end; //Hack to get access to EditMask
TMaskEditEditor = class(TDefaultComponentEditor) TMaskEditEditor = class(TDefaultComponentEditor)
public public
procedure ExecuteVerb(Index: Integer); override; procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): string; override; function GetVerb(Index: Integer): string; override;
function GetVerbCount: Integer; override; function GetVerbCount: Integer; override;
function MaskEdit: TCustomMaskEdit; virtual; function MaskEdit: TCustomMaskEditAccess; virtual;
end; end;
implementation implementation
@ -376,9 +378,9 @@ begin
Result := 1; Result := 1;
end; end;
function TMaskEditEditor.MaskEdit: TCustomMaskEdit; function TMaskEditEditor.MaskEdit: TCustomMaskEditAccess;
begin begin
Result := TCustomMaskEdit(GetComponent) Result := TCustomMaskEditAccess(GetComponent)
end; end;
initialization initialization

View File

@ -201,7 +201,7 @@ type
Function MaskToChar(Value : tMaskedType) : Char; Function MaskToChar(Value : tMaskedType) : Char;
Function IsMaskChar(Ch : Char) : Boolean; Function IsMaskChar(Ch : Char) : Boolean;
Function IsLiteral(Ch: Char): Boolean; Function IsLiteral(Ch: Char): Boolean;
function TextIsValid(Value: String): Boolean; function TextIsValid(const Value: String): Boolean;
function CharMatchesMask(const Ch: Char; const Position: Integer): Boolean; function CharMatchesMask(const Ch: Char; const Position: Integer): Boolean;
function ClearChar(Position : Integer) : Char; function ClearChar(Position : Integer) : Char;
@ -244,6 +244,7 @@ type
property SpaceChar: Char read FSpaceChar write SetSpaceChar; property SpaceChar: Char read FSpaceChar write SetSpaceChar;
property MaxLength: Integer read GetMaxLength write SetMaxLength; property MaxLength: Integer read GetMaxLength write SetMaxLength;
property CharCase: TEditCharCase read GetCharCase write SetCharCase; property CharCase: TEditCharCase read GetCharCase write SetCharCase;
property EditMask: string read FRealMask write SetMask;
public public
procedure CutToClipBoard; override; procedure CutToClipBoard; override;
procedure PasteFromClipBoard; override; procedure PasteFromClipBoard; override;
@ -251,7 +252,6 @@ type
constructor Create(Aowner : TComponent); override; constructor Create(Aowner : TComponent); override;
procedure Clear; procedure Clear;
procedure ValidateEdit; virtual; procedure ValidateEdit; virtual;
property EditMask: string read FRealMask write SetMask;
property Text: TCaption read GetText write SetText; property Text: TCaption read GetText write SetText;
end; end;
@ -848,7 +848,7 @@ end;
//Return if Value matches the EditMask //Return if Value matches the EditMask
function TCustomMaskEdit.TextIsValid(Value: String): Boolean; function TCustomMaskEdit.TextIsValid(const Value: String): Boolean;
var var
i: Integer; i: Integer;
begin begin