More minor demo tweaks

This commit is contained in:
Robin Dunn
2016-08-03 13:39:09 -07:00
parent ef87041ac3
commit a4ecd56a7d
4 changed files with 23 additions and 13 deletions

View File

@@ -12,11 +12,11 @@ class TestPanel(wx.Panel):
wx.StaticText(self, -1, "This example shows the wx.Gauge control.", (45, 15))
self.g1 = wx.Gauge(self, -1, 50, (110, 50), (250, 25))
self.g2 = wx.Gauge(self, -1, 75, (110, 95), (250, 25))
self.g3 = wx.Gauge(self, -1, 100, (110, 135), (25, 100), wx.GA_VERTICAL)
# self.g3.SetBezelFace(12)
# self.g3.SetShadowWidth(8)
self.g1 = wx.Gauge(self, -1, 50, (110, 50), (250, -1))
self.g2 = wx.Gauge(self, -1, 75, (110, 95), (250, -1))
if 'wxMac' not in wx.PlaformInfo:
self.g3 = wx.Gauge(self, -1, 100, (110, 135), (-1, 100), wx.GA_VERTICAL)
self.Bind(wx.EVT_TIMER, self.TimerHandler)
self.timer = wx.Timer(self)
@@ -33,7 +33,8 @@ class TestPanel(wx.Panel):
self.g1.SetValue(self.count)
self.g2.Pulse()
self.g3.Pulse()
if 'wxMac' not in wx.PlaformInfo:
self.g3.Pulse()
#----------------------------------------------------------------------

View File

@@ -53,21 +53,30 @@ class ItemsPickerDialog(wx.Dialog):
'Stuff:', 'Selected stuff:',ipStyle = style)
self.ip.Bind(EVT_IP_SELECTION_CHANGED, self.OnSelectionChange)
self.ip._source.SetMinSize((-1,150))
self.ip.bAdd.SetBitmap(_bp_btn2.GetBitmap(), dir=wx.RIGHT)
self.ip.bAdd.SetLabel('Add')
self.ip.bRemove.SetBitmap(_bp_btn1.GetBitmap(), dir=wx.LEFT)
self.ip.bRemove.SetLabel('Remove')
# Customize the buttons for this example.
if 'wxMac' not in wx.PlatformInfo:
# NOTE: wx.Button on OSX does not modify the button size when adding a
# bitmap after the fact like this, and these bitmaps are a little too
# large and look funny in OSX, so we won't do this customization there.
self.ip.bAdd.SetBitmap(_bp_btn2.GetBitmap(), dir=wx.RIGHT)
self.ip.bAdd.SetLabel('Add')
self.ip.bRemove.SetBitmap(_bp_btn1.GetBitmap(), dir=wx.LEFT)
self.ip.bRemove.SetLabel('Remove')
sizer.Add(self.ip, 0, wx.ALL, 10)
self.SetSizer(sizer)
self.itemCount = 3
self.Fit()
def OnAdd(self,e):
items = self.ip.GetItems()
self.itemCount += 1
newItem = "item%d" % self.itemCount
self.ip.SetItems(items + [newItem])
def OnSelectionChange(self, e):
self.log.write("EVT_IP_SELECTION_CHANGED %s\n" % \
",".join(e.GetItems()))

View File

@@ -12,7 +12,7 @@
<h2>Mixing wxPython and wxHTML</h2>
The widgets on this page were created dynamically on the fly by a
custom wxTagHandler found in wxPython.lib.wxpTag. You can look at the
custom wxTagHandler found in wx.lib.wxpTag. You can look at the
sources and doc-string in the wxPython library at wx/lib/wxpTag.py.
<p>
@@ -45,10 +45,10 @@ parameter value. Source code is <a href="../widgetTest.py">here</a>.
<p>
<wxp module="widgetTest" class="TestPanel" width=180 height=100>
<param name="bgcolor" value="#CC00FF">
</wxp>
<wxp module="widgetTest" class="TestPanel" width=180 height=100>
<param name="bgcolor" value="#00CCFF">
</wxp>
<wxp module="widgetTest" class="TestPanel" width=180 height=100>

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
# This file is used for the wx.HtmlWindow demo.
# This file is used for the HtmlWindow demo.
import sys