wxFlagProperty; issue with combined flags
|Reported by:||jens||Owned by:|
I found a somewhat irritating behaviour with wxFlagProperty.
Sometimes flags get combined with a bitwise or to a flag with another name for convenience:
e.g. three of the possible SetSze-flags in defs.h
/* Use internally-calculated width if -1 */ #define wxSIZE_AUTO_WIDTH 0x0001 /* Use internally-calculated height if -1 */ #define wxSIZE_AUTO_HEIGHT 0x0002 /* Use internally-calculated width and height if each is -1 */ #define wxSIZE_AUTO (wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT)
Expected behaviour (if they are used in wxFlagProperty) is that if wxSIZE_AUTO is set, both other flags get set automatically, or if wxSIZE_AUTO_WIDTH and wxSIZE_AUTO_HEIGHT are both set, wxSIZE_AUTO is set automatically.
In current implementatio wxSIZE_AUTO gets set, if any of the other two is set.
I attach a patch to the propgrid-sample that shows this behaviour.
I added the three flags to the end of the "Window Styles" property.
I also attach a patch that makes wxFlagProperty work as I expect it.