Recent

Author Topic: [SOLVED] I cannot compile my LPK in Lazarus 1.6 when using an empty property  (Read 7312 times)

balazsszekely

  • Guest
Re: I cannot compile my LPK in Lazarus 1.6 when using an empty property
« Reply #15 on: April 08, 2016, 10:37:19 am »
Yup, you're right! I did not bother to check the parent class. Nevertheless I find odd that you can publish a public property, this way make it visible in the object inspector, but not the other way around. I'm pretty sure in delphi you could "unpublish" a property just by moving it to the public section. But then again this is Lazarus, things work differently.

wp

  • Hero Member
  • *****
  • Posts: 12908
Re: I cannot compile my LPK in Lazarus 1.6 when using an empty property
« Reply #16 on: April 08, 2016, 10:40:41 am »
No, you cannot in Delphi either: https://stackoverflow.com/questions/4749867/delphi-how-to-hide-ancestor-methods ("Hiding methods is not possible, because it goes against the fundamentals of object oriented programming.")

balazsszekely

  • Guest
Re: I cannot compile my LPK in Lazarus 1.6 when using an empty property
« Reply #17 on: April 08, 2016, 10:53:58 am »
I'm pretty sure I managed to hide somehow a previously published(remove from object inspector) property in delphi. I will search it and report back.
PS: Something like this: http://stackoverflow.com/questions/15961579/how-do-you-remove-a-property-from-a-descendent-component
« Last Edit: April 08, 2016, 02:16:58 pm by GetMem »

CM630

  • Hero Member
  • *****
  • Posts: 1435
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: I cannot compile my LPK in Lazarus 1.6 when using an empty property
« Reply #18 on: April 09, 2016, 09:34:37 pm »

Ah, thanks, Mike  - this works.


@CM630: Add these lines to the Register procedure:
Code: Pascal  [Select][+][-]
  1.   RegisterPropertyEditor(TypeInfo(integer), TArrowStar, 'Width', THiddenPropertyEditor);
  2.   RegisterPropertyEditor(TypeInfo(integer), TArrowStar, 'Height', THiddenPropertyEditor);
This requires propedits in the uses clause of the unit and package ideintf in the package requirements.


But note that these properties still can be accessed at runtime.
That is it! It works just fine (with uses PropEdits) ! It is not too good that these properties can be accessed at runtime, but on the other and I need them during design time for enlarging with mouse drag.


Quote from: wp
@CM630: What is the problem to have these properties in the Object Inspector?
My control is quadrangular, so instead of two redundant parameters [i
width [/i]and height I prefer to have one- size.
« Last Edit: April 09, 2016, 09:37:39 pm by CM630 »
Лазар 4,0 32 bit (sometimes 64 bit); FPC3,2,2

 

TinyPortal © 2005-2018