How to register sets?
Hello,
I'm trying to register TShiftState for my passthru function
by calling this way:
raRegisterEnum('TShiftState', TypeInfo(TShiftState))
but since TShiftState is a set and not an enumeration, I'm getting
Access Vioalation. Is there anyway to register sets ?
cheers
Deck
I'm trying to register TShiftState for my passthru function
by calling this way:
raRegisterEnum('TShiftState', TypeInfo(TShiftState))
but since TShiftState is a set and not an enumeration, I'm getting
Access Vioalation. Is there anyway to register sets ?
cheers
Deck
This discussion has been closed.
Comments
Sets are not supported in RAP. As a workaround, you can send your passthru
function a value representing what should be done to the set, or you can
create a separate boolean RTTI property for each value in the set similar to
what we did with the TFont.Style property.
In the SetPropValue routine...
lFontStyles := TFont(aObject).Style;
if ppEqual(aPropName, 'Bold') then
begin
if (Boolean(aValue)) then
include(lFontStyles, fsBold)
else
exclude(lFontStyles, fsBold);
TFont(aObject).Style := lFontStyles;
end
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
cheers !