1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2018 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. module:: wx.lib.agw.gradientbutton
.. currentmodule:: wx.lib.agw.gradientbutton
.. highlight:: python
.. _wx.lib.agw.gradientbutton:
==========================================================================================================================================
|phoenix_title| **wx.lib.agw.gradientbutton**
==========================================================================================================================================
:class:`~wx.lib.agw.gradientbutton.GradientButton` is another custom-drawn button class which mimics Windows CE mobile
gradient buttons.
Description
===========
:class:`GradientButton` is another custom-drawn button class which mimics Windows CE mobile
gradient buttons, using a tri-vertex blended gradient plus some ClearType bold
font (best effect with Tahoma Bold). :class:`GradientButton` supports:
* Triple blended gradient background, with customizable colours;
* Custom colours for the "pressed" state;
* Rounded-corners buttons;
* Text-only or image+text buttons.
And a lot more. Check the demo for an almost complete review of the functionalities.
Usage
=====
Usage example::
import wx
import wx.lib.agw.gradientbutton as GB
class MyFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, -1, "GradientButton Demo")
panel = wx.Panel(self, -1)
# One button without bitmap
button_1 = GB.GradientButton(panel, -1, None, "Hello World", (100, 50))
# One button with bitmap
my_bitmap = wx.Bitmap("my_bitmap.png", wx.BITMAP_TYPE_PNG)
button_2 = GB.GradientButton(panel, -1, my_bitmap, "GradientButton", (100, 150))
# our normal wxApp-derived class, as usual
app = wx.App(0)
frame = MyFrame(None)
app.SetTopWindow(frame)
frame.Show()
app.MainLoop()
Supported Platforms
===================
:class:`GradientButton` has been tested on the following platforms:
* Windows (Windows XP).
Window Styles
=============
`No particular window styles are available for this class.`
Events Processing
=================
This class processes the following events:
================= ==================================================
Event Name Description
================= ==================================================
``wx.EVT_BUTTON`` Process a `wxEVT_COMMAND_BUTTON_CLICKED` event, when the button is clicked.
================= ==================================================
License And Version
===================
:class:`GradientButton` is distributed under the wxPython license.
Latest Revision: Andrea Gavana @ 27 Dec 2012, 21.00 GMT
Version 0.3
|class_summary| Classes Summary
===============================
================================================================================ ================================================================================
:ref:`~wx.lib.agw.gradientbutton.GradientButton` This is the main class implementation of :class:`GradientButton`.
:ref:`~wx.lib.agw.gradientbutton.GradientButtonEvent` Event sent from :class:`GradientButton` when the button is activated.
================================================================================ ================================================================================
|
.. toctree::
:maxdepth: 1
:hidden:
wx.lib.agw.gradientbutton.GradientButton
wx.lib.agw.gradientbutton.GradientButtonEvent
|