View Issue Details

IDProjectCategoryView StatusLast Update
0020790LazarusPatchpublic2011-12-17 16:37
ReporterBart BroersmaAssigned ToBart Broersma 
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Platformi386OSWinMeOS VersionMS
Product Version0.9.31 (SVN)Product Buildr33459 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0020790: TCustomMaskEdit: reduce visibility of EditMaskProperty from public to protected
DescriptionI have reduced visibility of EditMask in TCustomMaskEdit to protected.
Reasons:
- Delphi compatibility
- In some derived components like TDateEdit this property should not be exposed to the user

As a result, I also had to make little changes to maskpropedit.pas.

Target 0.99 for review of patch.
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files
  • maskedit.editmask.diff (1,786 bytes)
    Index: ideintf/maskpropedit.pas
    ===================================================================
    --- ideintf/maskpropedit.pas	(revision 32978)
    +++ ideintf/maskpropedit.pas	(working copy)
    @@ -76,13 +76,15 @@
       end;
     
       { TMaskEditEditor }
    +  THackCustomMaskEdit = class(TCustomMaskEdit)
    +  end; //Hack to get access to EditMask
     
       TMaskEditEditor = class(TDefaultComponentEditor)
       public
         procedure ExecuteVerb(Index: Integer); override;
         function GetVerb(Index: Integer): string; override;
         function GetVerbCount: Integer; override;
    -    function MaskEdit: TCustomMaskEdit; virtual;
    +    function MaskEdit: THackCustomMaskEdit; virtual;
       end;
     
     implementation
    @@ -376,9 +378,9 @@
       Result := 1;
     end;
     
    -function TMaskEditEditor.MaskEdit: TCustomMaskEdit;
    +function TMaskEditEditor.MaskEdit: THackCustomMaskEdit;
     begin
    -  Result := TCustomMaskEdit(GetComponent)
    +  Result := THackCustomMaskEdit(GetComponent)
     end;
     
     initialization
    Index: lcl/maskedit.pp
    ===================================================================
    --- lcl/maskedit.pp	(revision 32978)
    +++ lcl/maskedit.pp	(working copy)
    @@ -248,6 +248,7 @@
         property SpaceChar: Char read FSpaceChar write SetSpaceChar;
         property MaxLength: Integer read GetMaxLength write SetMaxLength;
         property CharCase: TEditCharCase read GetCharCase write SetCharCase;
    +    property EditMask: string read FRealMask write SetMask;
       public
         procedure CutToClipBoard; override;
         procedure PasteFromClipBoard; override;
    @@ -255,7 +256,6 @@
         constructor Create(Aowner : TComponent); override;
         procedure Clear;
         procedure ValidateEdit; virtual;
    -    property EditMask: string read FRealMask write SetMask;
         property Text: TCaption read GetText write SetText;
       end;
     
    
    maskedit.editmask.diff (1,786 bytes)

Activities

2011-12-01 20:16

 

maskedit.editmask.diff (1,786 bytes)
Index: ideintf/maskpropedit.pas
===================================================================
--- ideintf/maskpropedit.pas	(revision 32978)
+++ ideintf/maskpropedit.pas	(working copy)
@@ -76,13 +76,15 @@
   end;
 
   { TMaskEditEditor }
+  THackCustomMaskEdit = class(TCustomMaskEdit)
+  end; //Hack to get access to EditMask
 
   TMaskEditEditor = class(TDefaultComponentEditor)
   public
     procedure ExecuteVerb(Index: Integer); override;
     function GetVerb(Index: Integer): string; override;
     function GetVerbCount: Integer; override;
-    function MaskEdit: TCustomMaskEdit; virtual;
+    function MaskEdit: THackCustomMaskEdit; virtual;
   end;
 
 implementation
@@ -376,9 +378,9 @@
   Result := 1;
 end;
 
-function TMaskEditEditor.MaskEdit: TCustomMaskEdit;
+function TMaskEditEditor.MaskEdit: THackCustomMaskEdit;
 begin
-  Result := TCustomMaskEdit(GetComponent)
+  Result := THackCustomMaskEdit(GetComponent)
 end;
 
 initialization
Index: lcl/maskedit.pp
===================================================================
--- lcl/maskedit.pp	(revision 32978)
+++ lcl/maskedit.pp	(working copy)
@@ -248,6 +248,7 @@
     property SpaceChar: Char read FSpaceChar write SetSpaceChar;
     property MaxLength: Integer read GetMaxLength write SetMaxLength;
     property CharCase: TEditCharCase read GetCharCase write SetCharCase;
+    property EditMask: string read FRealMask write SetMask;
   public
     procedure CutToClipBoard; override;
     procedure PasteFromClipBoard; override;
@@ -255,7 +256,6 @@
     constructor Create(Aowner : TComponent); override;
     procedure Clear;
     procedure ValidateEdit; virtual;
-    property EditMask: string read FRealMask write SetMask;
     property Text: TCaption read GetText write SetText;
   end;
 
maskedit.editmask.diff (1,786 bytes)

Luiz Americo

2011-12-01 22:37

developer   ~0054641

Thanks. Applied with minor change (renamed a type)

Bart Broersma

2011-12-02 11:49

developer   ~0054648

Reminder sent to: Luiz Americo

@Luiz: in the future, when you commit changes/fix issues, will you please fill in the revision when you resolve the issue in the bugtracker.
It is very difficult to find the exact revision otherwise.

Bart Broersma

2011-12-02 11:57

developer   ~0054650

Fixed in r33898

Issue History

Date Modified Username Field Change
2011-12-01 20:16 Bart Broersma New Issue
2011-12-01 20:16 Bart Broersma File Added: maskedit.editmask.diff
2011-12-01 20:16 Bart Broersma LazTarget => -
2011-12-01 22:37 Luiz Americo Status new => resolved
2011-12-01 22:37 Luiz Americo Resolution open => fixed
2011-12-01 22:37 Luiz Americo Assigned To => Luiz Americo
2011-12-01 22:37 Luiz Americo Note Added: 0054641
2011-12-02 11:49 Bart Broersma Note Added: 0054648
2011-12-02 11:57 Bart Broersma Note Added: 0054650
2011-12-02 11:57 Bart Broersma Assigned To Luiz Americo => Bart Broersma
2011-12-02 11:57 Bart Broersma Fixed in Version => 0.9.31 (SVN)
2011-12-17 16:37 Bart Broersma Status resolved => closed