Hopefully the last version ( for a while )
OnOffButton Version 1.17.2 (thanks to ZigZag/Ecco for testing on Windows)
Change Log:
1.17.2 Add highlighting colour to Border, principally for darkgrounds
Add internal_style OOB_SOFTRECTANGLE (Value 4) A rectangle with slightly rounded corners
Suggestions from ZigZag/Ecco
1.17.1 Fix bug calculating inner and outer radius which resulted in a float instead of an integer
this could affect round radio buttons with a size parameter containing different width and height values
Attempt to shift focus to next or previous widget, if focused widget is disabled
Fix for wxpython < 4.1 Colour has no option GetLuminance()
Micro adjustments to positioning
Include style wx.TRANSPARENT
1.17.0 Track focus by way of underlining Label Text if the control has Focus
return to normal Label Text if focus is lost
Font style flashing between Slant for Off and Normal for On - Removed
as too fussy, especially as I’m now tracking focus with Underlined text
Why Underline and not a dotted box?
Under Gtk StaticText doesn't appear to receive Paint events but wx.lib.stattext, which does,
doesn't allow mnemonics and I want the mnemonics.
So stuck between the devil and the deep blue sea, I've run with Underline
1.16.3 Allow spacebar key to toggle the onoffbutton.
All colours in the demonstration to hex codes
Changed demonstration to use a FlexGridSizer to accomodate smaller screens.
1.16.2 Minor adjustment to set minimum size for alignment
also prevents fractional cropping of image aligned to the right
onoffbutton.py (38.5 KB)
Also
OnOffButtonBox Version 1.2.3 (again thanks to ZigZag/Ecco for testing on Windows)
Change Log:
1.2.3 OnOffButton’s from version 1.17.2 include a new option OOB_SOFTRECTANGLE
This is included in the demonstration.
1.2.2 Spacebar Key is now a legitimate onoffbutton selector
To accomodate tabbing between widgets, the helpcontext button has focus disabled from the keyboard
add the last legitimate onoffbutton with focus is logged for reinstatement of focus
OnOffButton’s from version 1.17.0 now track focus with Underlined text
1.2.2 GridSizer replaced with FlexGridSizer, as the GridSizer compressed its contents
when the window was resized.
Amended for Windows OS layout differences
extended gap between widgets
added extra space around box
Added sizer flag wx.RESERVE_SPACE_EVEN_IF_HIDDEN
onoffbuttonbox.py (29.8 KB)