wxpython布局的问题
#######################RadioButtons####################################printTypePanel...
####################### RadioButtons ####################################
printTypePanel = wx.Panel(self)
self.printTypeHigh = wx.RadioButton(printTypePanel, -1, "High quality print", style=wx.RB_GROUP)
self.printTypeNormal = wx.RadioButton(printTypePanel, -1, "Normal quality print")
self.printTypeLow = wx.RadioButton(printTypePanel, -1, "Fast low quality print")
self.printTypeNormal.SetValue( True )
########################################################################
sb_default=wx.StaticBox(printTypePanel, -1, u"系统预设参数" ) #创建static box
sb_default_sizer = wx.StaticBoxSizer(sb_default, wx.VERTICAL )#创建 static box sizer
sb_default_sizer.Add(self.printTypeHigh) #添加按钮到sizer
sb_default_sizer.Add(self.printTypeNormal)
sb_default_sizer.Add(self.printTypeLow, border=5)
printTypePanel.SetSizer(wx.BoxSizer(wx.VERTICAL))#关联sizer到容器panel
printTypePanel.GetSizer().Add(sb_default_sizer, flag=wx.EXPAND)
gbSizer.Add(printTypePanel, (0,0), flag=wx.EXPAND,border=5)#添加到一级sizer
请高人解释一下这一段,不太明白这其中的逻辑。
尤其不明白为什么要把这三个按钮放在panel中,还有下面这里SetSizer和GetSizer 展开
printTypePanel = wx.Panel(self)
self.printTypeHigh = wx.RadioButton(printTypePanel, -1, "High quality print", style=wx.RB_GROUP)
self.printTypeNormal = wx.RadioButton(printTypePanel, -1, "Normal quality print")
self.printTypeLow = wx.RadioButton(printTypePanel, -1, "Fast low quality print")
self.printTypeNormal.SetValue( True )
########################################################################
sb_default=wx.StaticBox(printTypePanel, -1, u"系统预设参数" ) #创建static box
sb_default_sizer = wx.StaticBoxSizer(sb_default, wx.VERTICAL )#创建 static box sizer
sb_default_sizer.Add(self.printTypeHigh) #添加按钮到sizer
sb_default_sizer.Add(self.printTypeNormal)
sb_default_sizer.Add(self.printTypeLow, border=5)
printTypePanel.SetSizer(wx.BoxSizer(wx.VERTICAL))#关联sizer到容器panel
printTypePanel.GetSizer().Add(sb_default_sizer, flag=wx.EXPAND)
gbSizer.Add(printTypePanel, (0,0), flag=wx.EXPAND,border=5)#添加到一级sizer
请高人解释一下这一段,不太明白这其中的逻辑。
尤其不明白为什么要把这三个按钮放在panel中,还有下面这里SetSizer和GetSizer 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询