Menu

#10 Generalization in Get/Set

closed
None
5
2007-11-23
2007-11-22
Anonymous
No

There should be a generic {get,set}value scheme that applies to every kind of type a wxPGProperty holds. Primitite types are supported via the wxVariant and an extension mechanism handles the rest in different ways (some properties have methods to get/set specific values, others connect their values with pointers to dynamic classes etc.). It is somewhat cumbersome to use custom if-then-else stmts or visiting mechanisms to handle every different case of property.

Discussion

  • Jaakko Salli

    Jaakko Salli - 2007-11-23
    • assigned_to: nobody --> jmsalli
    • status: open --> closed
     
  • Jaakko Salli

    Jaakko Salli - 2007-11-23

    Logged In: YES
    user_id=1193883
    Originator: NO

    For the stable branch (1.2.x), I won't change this, and in the development branch (1.3.x), properties already use wxVariant as their internal "generic" value. That is, wxPGProperty::GetValue() returns wxVariant, and that is all you need. There are macros to automatically generate necessary wxVariantData class for arbitrary values, see the docs main page for samples.

    Or maybe I did not fully understand what you had in mind?

     

Log in to post a comment.