Various layout tweaks, wx.FIXED_SIZE added, etc.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -51,14 +51,14 @@ TICKS_DECIMAL = 16
|
||||
TICKS_ROMAN = 32
|
||||
|
||||
|
||||
class AnalogClockWindow(wx.Window):
|
||||
class AnalogClockWindow(wx.PyWindow):
|
||||
"""An analog clock window"""
|
||||
|
||||
def __init__(self, parent, ID=-1, pos=wx.DefaultPosition, size=wx.DefaultSize,
|
||||
style=0, name="clock"):
|
||||
|
||||
# Initialize the wxWindow...
|
||||
wx.Window.__init__(self, parent, ID, pos, size, style, name)
|
||||
wx.PyWindow.__init__(self, parent, ID, pos, size, style, name)
|
||||
|
||||
# Initialize some variables and defaults...
|
||||
self.clockStep = 1
|
||||
@@ -124,6 +124,8 @@ class AnalogClockWindow(wx.Window):
|
||||
self.timer = wx.Timer(self)
|
||||
self.timer.Start(500)
|
||||
|
||||
def DoGetBestSize(self):
|
||||
return wx.Size(25,25)
|
||||
|
||||
def OnPaint(self, event):
|
||||
self._doDrawHands(wx.BufferedPaintDC(self), True)
|
||||
|
@@ -33,12 +33,12 @@ class PyColourBox(wx.Panel):
|
||||
def __init__(self, parent, id, colour=(0, 0, 0), size=(25, 20)):
|
||||
"""Creates a new colour box instance and initializes the colour
|
||||
content."""
|
||||
wx.Panel.__init__(self, parent, id, size=size)
|
||||
wx.Panel.__init__(self, parent, id, size=size, style=wx.NO_BORDER)
|
||||
|
||||
self.colour_box = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)
|
||||
self.colour_box = wx.Window(self, -1, style=wx.SIMPLE_BORDER)
|
||||
|
||||
sizer = wx.GridSizer(1, 1)
|
||||
sizer.Add(self.colour_box, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL)
|
||||
sizer.Add(self.colour_box, 0, wx.FIXED_SIZE | wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL)
|
||||
sizer.SetItemMinSize(self.colour_box, size[0] - 5, size[1] - 5)
|
||||
self.SetAutoLayout(True)
|
||||
self.SetSizer(sizer)
|
||||
|
@@ -202,9 +202,9 @@ class PyColourChooser(wx.Panel):
|
||||
self.ventry.SetSize((40, -1))
|
||||
hsvgrid = wx.FlexGridSizer(1, 6, 2, 2)
|
||||
hsvgrid.AddMany ([
|
||||
(hlabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.hentry, 0, 0),
|
||||
(slabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.sentry, 0, 0),
|
||||
(vlabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.ventry, 0, 0),
|
||||
(hlabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.hentry, 0, wx.FIXED_SIZE),
|
||||
(slabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.sentry, 0, wx.FIXED_SIZE),
|
||||
(vlabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.ventry, 0, wx.FIXED_SIZE),
|
||||
])
|
||||
|
||||
rlabel = wx.StaticText(self, -1, _("R:"))
|
||||
@@ -218,9 +218,9 @@ class PyColourChooser(wx.Panel):
|
||||
self.bentry.SetSize((40, -1))
|
||||
lgrid = wx.FlexGridSizer(1, 6, 2, 2)
|
||||
lgrid.AddMany([
|
||||
(rlabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.rentry, 0, 0),
|
||||
(glabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.gentry, 0, 0),
|
||||
(blabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.bentry, 0, 0),
|
||||
(rlabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.rentry, 0, wx.FIXED_SIZE),
|
||||
(glabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.gentry, 0, wx.FIXED_SIZE),
|
||||
(blabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.bentry, 0, wx.FIXED_SIZE),
|
||||
])
|
||||
|
||||
gsizer = wx.GridSizer(2, 1)
|
||||
|
@@ -37,7 +37,7 @@ class UpdateThrobberEvent(wx.PyEvent):
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
class Throbber(wx.Panel):
|
||||
class Throbber(wx.PyPanel):
|
||||
"""
|
||||
The first argument is either the name of a file that will be split into frames
|
||||
(a composite image) or a list of strings of image names that will be treated
|
||||
@@ -60,7 +60,7 @@ class Throbber(wx.Panel):
|
||||
reverse = 0, # reverse direction at end of animation
|
||||
style = 0, # window style
|
||||
name = "throbber"):
|
||||
wx.Panel.__init__(self, parent, id, pos, size, style, name)
|
||||
wx.PyPanel.__init__(self, parent, id, pos, size, style, name)
|
||||
self.name = name
|
||||
self.label = label
|
||||
self.running = (1 != 1)
|
||||
@@ -127,7 +127,11 @@ class Throbber(wx.Panel):
|
||||
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||
self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer)
|
||||
self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroyWindow)
|
||||
|
||||
|
||||
|
||||
def DoGetBestSize(self):
|
||||
return (self.width, self.height)
|
||||
|
||||
|
||||
def OnTimer(self, event):
|
||||
wx.PostEvent(self, UpdateThrobberEvent())
|
||||
|
Reference in New Issue
Block a user