mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-09-05 17:30:26 +02:00
- Phoenix-port of `wx.lib.buttons.py`, with unittest and documentation updated to Phoenix standards; - Phoenix-port of part of the AGW library, including `AdvancedSplash`, `BalloonTip`, `ButtonPanel`, `CubeColourDialog`, `CustomTreeCtrl`, `FloatSpin`, `FoldPanelBar`, `FourWaySplitter`, `GenericMessageDialog`, `HyperLinkCtrl` and `HyperTreeList`. Unittests and documentation updated to Phoenix standards; - Added the `wx2to3.py` module to `wx.lib`, to facilitate the port to Python 3 (AGW depends on it). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
58 lines
1.9 KiB
Python
58 lines
1.9 KiB
Python
import imp_unittest, unittest
|
|
import wtc
|
|
import wx
|
|
import os
|
|
|
|
import wx.lib.buttons as buttons
|
|
pngFile = os.path.join(os.path.dirname(__file__), 'toucan.png')
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
class lib_buttons_Tests(wtc.WidgetTestCase):
|
|
|
|
def test_lib_buttons1(self):
|
|
|
|
btn = buttons.GenButton(self.frame, label='label')
|
|
btn = buttons.GenButton(self.frame, -1, 'label', (10,10), (100,-1), wx.BU_LEFT)
|
|
|
|
bmp = wx.Bitmap(pngFile)
|
|
btn = buttons.GenBitmapButton(self.frame, bitmap=bmp)
|
|
btn = buttons.GenBitmapTextButton(self.frame, label='label', bitmap=bmp)
|
|
|
|
btn.SetBitmapFocus(bmp)
|
|
btn.SetBitmapDisabled(bmp)
|
|
btn.SetBitmapSelected(bmp)
|
|
|
|
btn = buttons.GenBitmapToggleButton(self.frame, bitmap=bmp)
|
|
btn.SetToggle(True)
|
|
|
|
self.assertTrue(btn.GetValue())
|
|
self.assertEqual(btn.GetBitmapLabel(), bmp)
|
|
|
|
|
|
def test_lib_buttons2(self):
|
|
|
|
btn = buttons.ThemedGenButton(self.frame, label='label')
|
|
btn = buttons.ThemedGenButton(self.frame, -1, 'label', (10,10), (100,-1), wx.BU_LEFT)
|
|
|
|
bmp = wx.Bitmap(pngFile)
|
|
btn = buttons.ThemedGenBitmapButton(self.frame, bitmap=bmp)
|
|
btn = buttons.ThemedGenBitmapTextButton(self.frame, label='label', bitmap=bmp)
|
|
|
|
btn.SetBitmapFocus(bmp)
|
|
btn.SetBitmapDisabled(bmp)
|
|
btn.SetBitmapSelected(bmp)
|
|
|
|
btn = buttons.ThemedGenBitmapToggleButton(self.frame, bitmap=bmp)
|
|
btn.SetToggle(True)
|
|
|
|
self.assertTrue(btn.GetValue())
|
|
self.assertEqual(btn.GetBitmapLabel(), bmp)
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main() |