Re: [Lazarus] How to hide class names in a property grid?
2015.11.18. 16:10 keltezéssel, Mattias Gaertner írta: New patch attached. I hope better than the previous. Yes. Applied. I see it. :-) Thank you! Gabor -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to hide class names in a property grid?
On Sat, 14 Nov 2015 18:53:16 +0100 Gabor Boros wrote: > 2015.11.14. 16:57 keltezéssel, Mattias Gaertner írta: > >> I created a property and attached the patch. Please review. > > > > Only TClassPropertyEditor shows the classname. Descends like > > TPersistentPropertyEditor shows the name for Components. > > > > Maybe better make the option a class option of TClassPropertyEditor. > > New patch attached. I hope better than the previous. Yes. Applied. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to hide class names in a property grid?
2015.11.14. 18:53 keltezéssel, Gabor Boros írta: 2015.11.14. 16:57 keltezéssel, Mattias Gaertner írta: I created a property and attached the patch. Please review. Only TClassPropertyEditor shows the classname. Descends like TPersistentPropertyEditor shows the name for Components. Maybe better make the option a class option of TClassPropertyEditor. New patch attached. I hope better than the previous. Mattias? Gabor -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to hide class names in a property grid?
2015.11.14. 16:57 keltezéssel, Mattias Gaertner írta: I created a property and attached the patch. Please review. Only TClassPropertyEditor shows the classname. Descends like TPersistentPropertyEditor shows the name for Components. Maybe better make the option a class option of TClassPropertyEditor. New patch attached. I hope better than the previous. Gabor Index: components/ideintf/objectinspector.pp === --- components/ideintf/objectinspector.pp (revision 50331) +++ components/ideintf/objectinspector.pp (working copy) @@ -295,6 +295,7 @@ FActiveRowBmp: TCustomBitmap; FFirstClickTime: DWORD; FKeySearchText: string; +FHideClassNames: Boolean; // hint stuff FHintTimer: TTimer; @@ -507,6 +508,7 @@ property TopY: integer read FTopY write SetTopY default 0; property Favorites: TOIFavoriteProperties read FFavorites write SetFavorites; property Filter : TTypeKinds read FFilter write SetFilter; +property HideClassNames: Boolean read FHideClassNames write FHideClassNames; end; @@ -1859,6 +1861,8 @@ end; if PropEditor is TClassPropertyEditor then (PropEditor as TClassPropertyEditor).SubPropsTypeFilter := FFilter; + if PropEditor is TClassPropertyEditor then +(PropEditor as TClassPropertyEditor).HideClassName:=FHideClassNames; NewRow := TOIPropertyGridRow.Create(Self, PropEditor, nil, WidgetSets); FRows.Add(NewRow); if FRows.Count>1 then begin @@ -1983,6 +1987,8 @@ begin if PropEditor is TClassPropertyEditor then (PropEditor as TClassPropertyEditor).SubPropsTypeFilter := FFilter; + if PropEditor is TClassPropertyEditor then +(PropEditor as TClassPropertyEditor).HideClassName:=FHideClassNames; NewRow:=TOIPropertyGridRow.Create(Self,PropEditor,FExpandingRow, []); NewIndex:=FExpandingRow.Index+1+FExpandingRow.ChildCount; NewRow.FIndex:=NewIndex; Index: components/ideintf/propedits.pp === --- components/ideintf/propedits.pp (revision 50331) +++ components/ideintf/propedits.pp (working copy) @@ -571,6 +571,7 @@ TClassPropertyEditor = class(TPropertyEditor) private FSubPropsTypeFilter: TTypeKinds; +FHideClassName: Boolean; procedure SetSubPropsTypeFilter(const AValue: TTypeKinds); function EditorFilter(const AEditor: TPropertyEditor): Boolean; protected @@ -584,6 +585,7 @@ property SubPropsTypeFilter: TTypeKinds read FSubPropsTypeFilter write SetSubPropsTypeFilter default tkAny; +property HideClassName: Boolean read FHideClassName write FHideClassName; end; { TMethodPropertyEditor @@ -4222,7 +4224,7 @@ function TClassPropertyEditor.GetValue: ansistring; begin - Result:='(' + GetPropType^.Name + ')'; + if not FHideClassName then Result:='(' + GetPropType^.Name + ')'; end; procedure TClassPropertyEditor.SetSubPropsTypeFilter(const AValue: TTypeKinds); -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to hide class names in a property grid?
On Thu, 12 Nov 2015 16:13:48 +0100 Gabor Boros wrote: > 2015.11.12. 11:33 keltezéssel, Mattias Gaertner írta: > > There is no option yet. > > > > It is done by TClassPropertyEditor.GetValue in unit propedits.pp. > > > > Feel free to implement an option. > > I created a property and attached the patch. Please review. Only TClassPropertyEditor shows the classname. Descends like TPersistentPropertyEditor shows the name for Components. Maybe better make the option a class option of TClassPropertyEditor. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to hide class names in a property grid?
2015.11.12. 11:33 keltezéssel, Mattias Gaertner írta: There is no option yet. It is done by TClassPropertyEditor.GetValue in unit propedits.pp. Feel free to implement an option. I created a property and attached the patch. Please review. Gabor Index: components/ideintf/objectinspector.pp === --- components/ideintf/objectinspector.pp (revision 50318) +++ components/ideintf/objectinspector.pp (working copy) @@ -295,6 +295,7 @@ FActiveRowBmp: TCustomBitmap; FFirstClickTime: DWORD; FKeySearchText: string; +FHideClassNames: Boolean; // hint stuff FHintTimer: TTimer; @@ -507,6 +508,7 @@ property TopY: integer read FTopY write SetTopY default 0; property Favorites: TOIFavoriteProperties read FFavorites write SetFavorites; property Filter : TTypeKinds read FFilter write SetFilter; +property HideClassNames: Boolean read FHideClassNames write FHideClassNames; end; @@ -1744,7 +1746,7 @@ ValueEdit.ReadOnly:=NewRow.IsReadOnly; ValueEdit.Enabled:=true; ValueEdit.MaxLength:=NewRow.Editor.GetEditLimit; - ValueEdit.Text:=NewValue; + if (FHideClassNames and (Rows[FItemIndex].Editor is TClassPropertyEditor)) then ValueEdit.Text:='' else ValueEdit.Text:=NewValue; end; AlignEditComponents; if FCurrentEdit<>nil then @@ -2797,7 +2799,7 @@ Font:=OldFont; // draw value -if ARow<>ItemIndex +if (ARow<>ItemIndex) and not (FHideClassNames and (CurRow.Editor is TClassProperty)) then begin OldFont:=Font; if CurRow.Editor.IsNotDefaultValue then -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to hide class names in a property grid?
On Wed, 11 Nov 2015 18:45:52 +0100 Gabor Boros wrote: > Hi All, > > I use a property grid in my application and don't want to advertise my > class names to the users. For example (TSizeConstraints) displayed next > to Contraints. Any idea how to hide class names or override at > object(TPersistent) level? There is no option yet. It is done by TClassPropertyEditor.GetValue in unit propedits.pp. Feel free to implement an option. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to hide class names in a property grid?
2015.11.11. 21:22 keltezéssel, Mattias Gaertner írta: You cannot decrease visibility in Free Pascal. You can hide properties in the Object inspector. For example RegisterPropertyEditor(TypeInfo(TAnchorSide), TControl, 'AnchorSideLeft', THiddenPropertyEditor); I don't want to hide the property just the class name. Now I see MyProperty (TMySubClass) in the property grid. I want to show property name MyProperty only to the user without class name. Gabor -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to hide class names in a property grid?
On Wed, 11 Nov 2015 18:45:52 +0100 Gabor Boros wrote: > Hi All, > > I use a property grid in my application and don't want to advertise my > class names to the users. For example (TSizeConstraints) displayed next > to Contraints. Any idea how to hide class names or override at > object(TPersistent) level? You cannot decrease visibility in Free Pascal. You can hide properties in the Object inspector. For example RegisterPropertyEditor(TypeInfo(TAnchorSide), TControl, 'AnchorSideLeft', THiddenPropertyEditor); Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] How to hide class names in a property grid?
Hi All, I use a property grid in my application and don't want to advertise my class names to the users. For example (TSizeConstraints) displayed next to Contraints. Any idea how to hide class names or override at object(TPersistent) level? Gabor -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus