Home RAP

How to register sets?

edited February 2008 in RAP
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

Comments

  • edited February 2008
    Hi Deck,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2008
    ok thanks ! I think know now what to do.
    cheers !


This discussion has been closed.