本文整理汇总了Python中wx.FIXED_MINSIZE属性的典型用法代码示例。如果您正苦于以下问题:Python wx.FIXED_MINSIZE属性的具体用法?Python wx.FIXED_MINSIZE怎么用?Python wx.FIXED_MINSIZE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.FIXED_MINSIZE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_value
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FIXED_MINSIZE [as 别名]
def add_value(self, value, dotify=False):
t = ElectroStaticText(self.parent_widget, id=wx.ID_ANY, label="",
dotify=dotify)
self.Add(t, flag=wx.FIXED_MINSIZE|wx.GROW)
t.SetLabel(value)
return t
示例2: __do_layout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FIXED_MINSIZE [as 别名]
def __do_layout(self):
self.grid_sizer = wx.GridSizer(5, 5, 4, 4)
self.grid_sizer.Add(self.label, 0, wx.FIXED_MINSIZE, 0)
self.grid_sizer.Add(self.switch_panel, 0, wx.FIXED_MINSIZE, 0)
self.SetAutoLayout(True)
self.SetSizer(self.grid_sizer)
self.grid_sizer.Fit(self)
self.grid_sizer.SetSizeHints(self)
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FIXED_MINSIZE [as 别名]
def __init__(self, db, parent=None):
wx.Dialog.__init__(self, parent=parent, id=-1)
self.db = db # db handler. connect() method is required
self.SetTitle("Connect Mongo")
# widgets
labelHost, self.inputHost = LabelText('Host: ', 'localhost', self)
labelPort, self.inputPort = LabelText('Port: ', '27017', self)
btnConn = wx.Button(self, label='Connect')
btnCancel = wx.Button(self, id=wx.ID_CANCEL, label="Cancel")
# event handler
self.Bind(wx.EVT_BUTTON, self.OnConnect, btnConn)
# connet if user press enter
self.Bind(wx.EVT_TEXT_ENTER, self.OnConnect, self.inputHost)
self.Bind(wx.EVT_TEXT_ENTER, self.OnConnect, self.inputPort)
# default settings
self.inputHost.SetFocus()
# Layout-inputs
gridInputs = wx.FlexGridSizer(2, 2, 10, 10)
gridInputs.SetFlexibleDirection = wx.HORIZONTAL
gridInputs.AddMany([(labelHost), (self.inputHost, 0, wx.EXPAND),
(labelPort), (self.inputPort, 0, wx.EXPAND),
])
# Layout-action button
sizer_act = wx.BoxSizer(wx.HORIZONTAL)
sizer_act.Add(btnConn, 1, wx.ALIGN_CENTER | wx.FIXED_MINSIZE, 10)
sizer_act.Add(btnCancel, 1, wx.ALIGN_CENTER | wx.FIXED_MINSIZE, 10)
# main sizer
sizer_main = wx.BoxSizer(wx.VERTICAL)
sizer_main.Add(gridInputs, 2, flag=wx.ALL | wx.EXPAND, border=10)
sizer_main.Add(sizer_act, 1, wx.ALIGN_CENTER | wx.FIXED_MINSIZE, 10)
self.SetSizer(sizer_main)
self.SetAutoLayout(1)
sizer_main.Fit(self)