def create_postorder(self):
prev_x = prev_y = prev_xspan = prev_yspan = 0
for c in self.zchildren:
x,y = c.x,c.y
if x is None and y is None:
x,y = prev_x,prev_y
if self.orient == wx.HORIZONTAL:
x += prev_xspan
elif self.orient == wx.VERTICAL:
y += prev_yspan
else:
raise TypeError('%s position unspecified' % (c,))
elif x is None:
x = prev_x
if y < prev_y + prev_yspan:
x += 1
elif y is None:
y = prev_y
if x < prev_x + prev_xspan:
y += 1
if c.border > 0 and (c.flag & wx.ALL)==0:
c.flag |= wx.ALL
c.sizer_item = self.w.Add(c.sized, (y,x), (c.yspan,c.xspan), c.flag, c.border)
prev_x, prev_y, prev_xspan, prev_yspan = x,y,c.xspan,c.yspan
评论列表
文章目录