Yes ! I've published a Record property
Yes ! I've published a Record property
it could be nice to have this feature in Delphi, but we need RTTI for record properties to simplify the code (and TReader should handle tkRecord aswell)
https://github.com/tothpaul/DelphiTips/tree/master/RecordProperty
https://github.com/tothpaul/DelphiTips/tree/master/RecordProperty
it could be nice to have this feature in Delphi, but we need RTTI for record properties to simplify the code (and TReader should handle tkRecord aswell)
https://github.com/tothpaul/DelphiTips/tree/master/RecordProperty
https://github.com/tothpaul/DelphiTips/tree/master/RecordProperty
and with the same code, I turn an internal static array of colors into a well formated published Record :)
ReplyDeletehttps://plus.google.com/photos/...
Nice, would be cool if you include the colors example in the github as well. Right now I can't really picture the benefits of this approach because I don't really see any records in unit1/unit2.
ReplyDeleteIs this resolved by now then?
ReplyDeleteweb.archive.org - QualityCentral
Johan Bontes the Record is just there
ReplyDeletehttps://github.com/tothpaul/DelphiTips/blob/master/RecordProperty/Execute.RecordProperty.pas#L21
for the color record, it's not a record in fact, it's an array of color, but the published record use the same technic to map the record members to the internal array like I did with TRecoderPropertyHelper
https://github.com/tothpaul/DelphiTips/blob/master/RecordProperty/Execute.RecordProperty.pas#L31
but to edit this record you need also a Persistent class to map to the published record
https://github.com/tothpaul/DelphiTips/blob/master/RecordProperty/Execute.RecordProperty.Register.pas#L14
it's a bit or work, but to have the same editor without this code you have to create a subcomponent for each new level in the object inspector...it's also some work to do :)
Jeroen Wiert Pluimers No, that's why you can not use "Values.Str" for the defined property
ReplyDeletehttps://github.com/tothpaul/DelphiTips/blob/master/RecordProperty/Execute.RecordProperty.pas#L111
Paul TOTH thanks for confirming this.
ReplyDelete