More demo conversion and cleanup from Jeff

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-01-13 03:17:17 +00:00
parent 2b5dcd17c1
commit 95bfd958bd
142 changed files with 282 additions and 1155 deletions

View File

@@ -1,24 +1,15 @@
# 11/12/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o Updated for wx namespace
# o Controls now use dynamic IDs instead of hardcoded IDs.
#
import wx
import wx.lib.layoutf as layoutf
#---------------------------------------------------------------------------
ID_Button = wx.NewId()
#---------------------------------------------------------------------------
class TestLayoutf(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
self.SetAutoLayout(True)
self.Bind(wx.EVT_BUTTON, self.OnButton, id=ID_Button)
self.Bind(wx.EVT_BUTTON, self.OnButton)
self.panelA = wx.Window(self, -1, style=wx.SIMPLE_BORDER)
self.panelA.SetBackgroundColour(wx.BLUE)
@@ -38,10 +29,10 @@ class TestLayoutf(wx.Panel):
layoutf.Layoutf('t_10#3;r=r10#1;b=b10#1;l>10#2', (self,self.panelA,self.panelB))
)
b = wx.Button(self.panelA, ID_Button, ' Panel A ')
b = wx.Button(self.panelA, -1, ' Panel A ')
b.SetConstraints(layoutf.Layoutf('X=X#1;Y=Y#1;h*;w%w50#1', (self.panelA,)))
b = wx.Button(self.panelB, ID_Button, ' Panel B ')
b = wx.Button(self.panelB, -1, ' Panel B ')
b.SetConstraints(layoutf.Layoutf('t=t2#1;r=r4#1;h*;w*', (self.panelB,)))
self.panelD = wx.Window(self.panelC, -1, style=wx.SIMPLE_BORDER)
@@ -50,7 +41,7 @@ class TestLayoutf(wx.Panel):
layoutf.Layoutf('b%h50#1;r%w50#1;h=h#2;w=w#2', (self.panelC, b))
)
b = wx.Button(self.panelC, ID_Button, ' Panel C ')
b = wx.Button(self.panelC, -1, ' Panel C ')
b.SetConstraints(layoutf.Layoutf('t_#1;l>#1;h*;w*', (self.panelD,)))
wx.StaticText(self.panelD, -1, "Panel D", (4, 4)).SetBackgroundColour(wx.GREEN)