Recent

Author Topic: Hide Properties (UnlistPublishedProperty)  (Read 5210 times)

gonz0

  • New Member
  • *
  • Posts: 15
Hide Properties (UnlistPublishedProperty)
« on: November 26, 2015, 06:37:58 am »
I read here (http://lists.lazarus.freepascal.org/pipermail/lazarus/2012-June/074445.html) that the alternative for Delphi's UnlistPublishedProperty would be:

Code: Pascal  [Select][+][-]
  1. RegisterPropertyEditor(TypeInfo(TAnchorSide), TControl, 'AnchorSideLeft', THiddenPropertyEditor);

However i cannot find THiddenPropertyEditor.

Could someone point me in the right direction please?

Thanks!


balazsszekely

  • Guest
Re: Hide Properties (UnlistPublishedProperty)
« Reply #1 on: November 26, 2015, 06:53:27 am »
Hi gonz0,

It's declared in: $(LazarusDir)/components/ideintf/PropEdits.pp line 396.

gonz0

  • New Member
  • *
  • Posts: 15
Re: Hide Properties (UnlistPublishedProperty)
« Reply #2 on: November 26, 2015, 01:29:35 pm »
Thanks GetMem! Works like a charm :)

Doodume

  • Newbie
  • Posts: 2
Re: Hide Properties (UnlistPublishedProperty)
« Reply #3 on: December 03, 2015, 09:29:21 am »
This is a very good topic.

Paulo França Lacerda

  • New Member
  • *
  • Posts: 44
    • BlaisePoint Informática
procedure UnlistPublishedProperty() for Lazarus:
« Reply #4 on: October 09, 2016, 10:56:14 am »
I came across this topic after facing the same problem.
Eventually, I ended up creating a Delphi-like procedure for Lazarus:


Code: Pascal  [Select][+][-]
  1. {$ifdef fpc}
  2.  procedure UnlistPublishedProperty (ComponentClass:TPersistentClass; const PropertyName:String);
  3.  var
  4.    pi :PPropInfo;
  5.  begin
  6.    pi := TypInfo.GetPropInfo (ComponentClass, PropertyName);
  7.    if (pi <> nil) then
  8.      RegisterPropertyEditor (pi^.PropType, ComponentClass, PropertyName, PropEdits.THiddenPropertyEditor);
  9.  end;
  10. {$endif}

NOTE:
The component's design-time package calling UnlistPublishedProperty() under Lazarus should add the
IDEIntf package to its Dependency list.
« Last Edit: October 09, 2016, 10:59:05 am by Paulo França Lacerda (patulinu) »
Lazarus 1.6.0.4 on FreePascal 3.0
Windows 7 32-bit

totya

  • Hero Member
  • *****
  • Posts: 720
Re: procedure UnlistPublishedProperty() for Lazarus:
« Reply #5 on: May 15, 2018, 07:05:42 pm »
I came across this topic after facing the same problem.
Eventually, I ended up creating a Delphi-like procedure for Lazarus:

Thank you for this code! It's working.

 

TinyPortal © 2005-2018