wxPropGrid API change

BlitzMax Forums/Brucey's Modules/wxPropGrid API change

Brucey(Posted 2009) [#1]
In some earlier wisdom, I implemented property Set/Get methods in two forms. One with a wxPGProperty parameter, the other taking a String parameter - also suffixed with "ByName".
Example

GetPropertyValueAsDouble:Double(prop:wxPGProperty)

GetPropertyValueAsDoubleByName:Double(name:String)


It seemed a good idea at the time :-p

However, I am considering changinge these to use a SINGLE call, where the parameter changes to Object, and you can pass in either :

GetPropertyValueAsDouble:Double(prop:Object)


I think this is a much tidier API.
Of course, it would mean dropping the ByName methods, which is likely to break your code - but all you would have to do is remove these 6 characters from the method calls and rebuild.


I generally try not to change APIs, as it is a pain for everyone. But I think in this case it is a big improvement.

Does anyone disagree? :-)


Wiebo(Posted 2009) [#2]
Why do you not consider it a good idea anymore? I think the byName method is very convinient...

I wonder which object to pass to the GetPropertyValueAs method in this case. How do I get the property object to pass? I don't understand the events of the propertygrid good enough yet. =\


Brucey(Posted 2009) [#3]
Why do you not consider it a good idea anymore?

Rather than have 2x methods for each property grid interaction, the API would only require 1. This makes the API much smaller, and easier to maintain.


How do I get the property object to pass?

Well, it wouldn't matter :-)

You can get wxPGProperty references from many methods, including Append(), GetFirst(), GetPropertiesWithFlag(), GetPropertyByName(), GetPropertyParent().... etc


Wiebo(Posted 2009) [#4]
Well, if it makes life easier for you then you have my blessing.. I'm just along for the ride :) And the change is not that major, imho.