Greetings,
The PlateButton is a custom owner drawn button control that in many ways emulates the buttons found on Safari's bookmark bar. It also offers a near complete implementation of the wxBitmapButton api and can as such be used as a drop in replacement for wxButton/wxBitmapButton under most circumstances.
Some Features:
- Four main style options
- PB_STYLE_DEFAULT: Rounded shaped button with highlight color from current system theme
- PB_STYLE_GRADIENT: Use a gradient highlight for focus and press states
- PB_STYLE_SQUARE: Use a square shaped button
- PB_STYLE_NOBG: Useful to get transparent appearance on Windows when parent window has a custom painted background.
- Fully customizable colors/fonts/ect..
- Use a Bitmap as a button, or just text, or both
- Optional drop down menu
- Change/Add bitmap, label, color, font at anytime and button updates instantly
- Transparent background lets it fit in on windows with non standard backgrounds (not completely working on gtk yet)
Known issues:
- Windows: Popup menu for some reason causes button to revert back to normal state when it should be in a pressed state till menu is dismissed.
- Windows: PopupMenu doesn't seem to fire an EVT_MENU_CLOSE as it does on Mac/Gtk which will under some circumstances leave the button in the wrong state after dismissing the menu.
- Gtk: Transparency (or the faking of it) doesn't work for non solid backgrounds (see Gradient Panel in demo)
For a more complete picture download the source and run the included demo (PlateButtonDemo.py):
Requirements:
python 2.4+, wxPython 2.8
Download Link:
http://editra.org/uploads/code/PlateButton.tar.gz
Bug reports and ideas for enhancement are of course very welcomed so let me know
Enjoy,
Cody Precord
http://editra.org