本文整理汇总了Python中wx.EXPAND属性的典型用法代码示例。如果您正苦于以下问题:Python wx.EXPAND属性的具体用法?Python wx.EXPAND怎么用?Python wx.EXPAND使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.EXPAND属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def __init__(self, parent, text, title):
wx.Dialog.__init__(self, parent, -1, title,
style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
vsizer = wx.BoxSizer(wx.VERTICAL)
tc = wx.TextCtrl(self, -1, size = wx.Size(400, 200),
style = wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_LINEWRAP)
tc.SetValue(text)
vsizer.Add(tc, 1, wx.EXPAND);
vsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
okBtn = gutil.createStockButton(self, "OK")
vsizer.Add(okBtn, 0, wx.ALIGN_CENTER)
util.finishWindow(self, vsizer)
wx.EVT_BUTTON(self, okBtn.GetId(), self.OnOK)
okBtn.SetFocus()
示例2: _do_layout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def _do_layout(self):
self.SetDoubleBuffered(True)
self.SetBackgroundColour('#f2f2f2')
self.SetSize((180, 0))
self.SetMinSize((180, 0))
STD_LAYOUT = (0, wx.LEFT | wx.RIGHT | wx.EXPAND, 10)
container = wx.BoxSizer(wx.VERTICAL)
container.AddSpacer(15)
container.Add(wx_util.h1(self, 'Actions'), *STD_LAYOUT)
container.AddSpacer(5)
self.listbox = wx.ListBox(self, -1)
container.Add(self.listbox, 1, wx.LEFT | wx.RIGHT | wx.EXPAND, 10)
container.AddSpacer(20)
self.SetSizer(container)
self.Bind(wx.EVT_LISTBOX, self.selection_change, self.listbox)
示例3: _do_layout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def _do_layout(self):
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.head_panel, 0, wx.EXPAND)
sizer.Add(wx_util.horizontal_rule(self), 0, wx.EXPAND)
if self.layout_type == layouts.COLUMN:
self.config_panel = layouts.ColumnLayout(self)
else:
self.config_panel = layouts.FlatLayout(self)
sizer.Add(self.config_panel, 1, wx.EXPAND)
sizer.Add(self.runtime_display, 1, wx.EXPAND)
self.runtime_display.Hide()
sizer.Add(wx_util.horizontal_rule(self), 0, wx.EXPAND)
sizer.Add(self.foot_panel, 0, wx.EXPAND)
self.SetSizer(sizer)
self.sizer = sizer
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def __init__(self, parent):
wx.Dialog.__init__(self, parent)
self.SetBackgroundColour('#ffffff')
self.ok_button = wx.Button(self, wx.ID_OK, label='Ok')
self.datepicker = wx.DatePickerCtrl(self, style=wx.DP_DROPDOWN)
vertical_container = wx.BoxSizer(wx.VERTICAL)
vertical_container.AddSpacer(10)
vertical_container.Add(wx_util.h1(self, label='Select a Date'), 0, wx.LEFT | wx.RIGHT, 15)
vertical_container.AddSpacer(10)
vertical_container.Add(self.datepicker, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 15)
vertical_container.AddSpacer(10)
button_sizer = wx.BoxSizer(wx.HORIZONTAL)
button_sizer.AddStretchSpacer(1)
button_sizer.Add(self.ok_button, 0)
vertical_container.Add(button_sizer, 0, wx.LEFT | wx.RIGHT, 15)
vertical_container.AddSpacer(20)
self.SetSizerAndFit(vertical_container)
self.Bind(wx.EVT_BUTTON, self.OnOkButton, self.ok_button)
示例5: do_layout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def do_layout(self, parent, title, msg):
self.panel = wx.Panel(parent)
self.widget_pack = self.widget_class()
self.title = self.format_title(self.panel, title)
self.help_msg = self.format_help_msg(self.panel, msg)
self.help_msg.SetMinSize((0, -1))
core_widget_set = self.widget_pack.build(self.panel, {}, self.choices)
vertical_container = wx.BoxSizer(wx.VERTICAL)
vertical_container.Add(self.title)
vertical_container.AddSpacer(2)
if self.help_msg.GetLabelText():
vertical_container.Add(self.help_msg, 1, wx.EXPAND)
vertical_container.AddSpacer(2)
else:
vertical_container.AddStretchSpacer(1)
vertical_container.Add(core_widget_set, 0, wx.EXPAND)
self.panel.SetSizer(vertical_container)
return self.panel
示例6: addTextStyles
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def addTextStyles(self, name, prefix, parent):
hsizer = wx.StaticBoxSizer(wx.StaticBox(parent, -1, name),
wx.HORIZONTAL)
gsizer = wx.FlexGridSizer(2, 2, 0, 10)
# wxGTK adds way more space by default than wxMSW between the
# items, have to adjust for that
pad = 0
if misc.isWindows:
pad = 5
self.addCheckBox("Caps", prefix, parent, gsizer, pad)
self.addCheckBox("Italic", prefix, parent, gsizer, pad)
self.addCheckBox("Bold", prefix, parent, gsizer, pad)
self.addCheckBox("Underlined", prefix, parent, gsizer, pad)
hsizer.Add(gsizer, 0, wx.EXPAND)
return hsizer
示例7: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def __init__(self, parent, id):
wx.Panel.__init__(
self, parent, id,
# wxMSW/Windows does not seem to support
# wx.NO_BORDER, which sucks
style = wx.WANTS_CHARS | wx.NO_BORDER)
hsizer = wx.BoxSizer(wx.HORIZONTAL)
self.scrollBar = wx.ScrollBar(self, -1, style = wx.SB_VERTICAL)
self.ctrl = MyCtrl(self, -1)
hsizer.Add(self.ctrl, 1, wx.EXPAND)
hsizer.Add(self.scrollBar, 0, wx.EXPAND)
wx.EVT_COMMAND_SCROLL(self, self.scrollBar.GetId(),
self.ctrl.OnScroll)
wx.EVT_SET_FOCUS(self.scrollBar, self.OnScrollbarFocus)
self.SetSizer(hsizer)
# we never want the scrollbar to get the keyboard focus, pass it on to
# the main widget
示例8: InsertNode
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def InsertNode(self, after, name, value, data=None, parent=None, bold=False):
index = after+1
if parent == None:
parent = self.n[after]
item = self.tree.InsertItem(parent, self.n[after], name)
self.n.insert(index, item)
ctrl = self._yCtrl()
if bold:
self._fatCtrl(ctrl)
self.stack_sizer.Insert(index, ctrl, flag=wx.LEFT|wx.RIGHT|wx.EXPAND)
ctrl.SetValue(value)
self.t.insert(index, ctrl)
self.d.insert(index, data)
self.r.insert(index, True)
#self._title_update(contents_changed=True)
return item
示例9: on_option_tab_create
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def on_option_tab_create(self, notebook):
self.panel = wx.Panel(notebook, wx.ID_ANY)
self.panel_name = _('WebSocket Server')
self.layout = wx.BoxSizer(wx.VERTICAL)
self.check_enable = wx.CheckBox(
self.panel, wx.ID_ANY, _('Enable WebSocket Server'))
self.edit_port = wx.TextCtrl(self.panel, wx.ID_ANY, 'port')
layout = wx.GridSizer(2)
layout.Add(wx.StaticText(self.panel, wx.ID_ANY, _('Listen port')))
layout.Add(self.edit_port)
self.layout.Add(self.check_enable)
self.layout.Add(wx.StaticText(
self.panel, wx.ID_ANY,
_('WARNING: The server is accessible by anyone.'),
))
self.layout.Add(layout, flag=wx.EXPAND)
self.panel.SetSizer(self.layout)
示例10: on_option_tab_create
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def on_option_tab_create(self, notebook):
self.panel = wx.Panel(notebook, wx.ID_ANY)
self.panel_name = _('CSV')
self.layout = wx.BoxSizer(wx.VERTICAL)
self.panel.SetSizer(self.layout)
self.checkEnable = wx.CheckBox(
self.panel, wx.ID_ANY, _('Enable CSV Log'))
self.editCsvFilename = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')
self.layout.Add(wx.StaticText(self.panel, wx.ID_ANY, _('Log Filename')))
self.layout.Add(self.editCsvFilename, flag=wx.EXPAND)
self.layout.Add(self.checkEnable)
##
# Write a line to text file.
# @param self The Object Pointer.
# @param record Record (text)
#
示例11: on_option_tab_create
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def on_option_tab_create(self, notebook):
self.panel = wx.Panel(notebook, wx.ID_ANY)
self.panel_name = _('Screenshot')
self.layout = wx.BoxSizer(wx.VERTICAL)
self.panel.SetSizer(self.layout)
self.checkResultDetailEnable = wx.CheckBox(
self.panel, wx.ID_ANY, _('Save screenshots of game results'))
self.editDir = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')
self.layout.Add(wx.StaticText(
self.panel, wx.ID_ANY, _('Folder to save screenshots')))
self.layout.Add(self.editDir, flag=wx.EXPAND)
self.layout.Add(self.checkResultDetailEnable)
self.panel.SetSizer(self.layout)
##
# on_result_detail_still Hook
# @param self The Object Pointer
# @param context IkaLog context
#
示例12: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def __init__(self, engine, outputs):
self.engine = engine
self.capture = engine.capture
self.outputs = outputs
self.frame = wx.Frame(None, wx.ID_ANY, "IkaLog GUI", size=(700, 500))
self.options_gui = OptionsGUI(self)
self.last_result = ResultsGUI(self)
self.layout = wx.BoxSizer(wx.VERTICAL)
self.create_buttons_ui()
self.layout.Add(self.buttons_layout)
self.preview = PreviewPanel(self.frame, size=(640, 420))
self.preview.Bind(EVT_INPUT_FILE_ADDED, self.on_input_file_added)
self.preview.Bind(EVT_IKALOG_PAUSE, self.on_ikalog_pause)
self.layout.Add(self.preview, flag=wx.EXPAND)
self.frame.SetSizer(self.layout)
# Frame events
self.frame.Bind(wx.EVT_CLOSE, self.on_close)
# Video files processed and to be processed.
self._file_list = []
示例13: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def __init__(self):
wx.Frame.__init__(self, None, -1,
'CanvasFrame', size=(550, 350))
self.figure = Figure()
self.axes = self.figure.add_subplot(111)
t = np.arange(0.0, 3.0, 0.01)
s = np.sin(2 * np.pi * t)
self.axes.plot(t, s)
self.canvas = FigureCanvas(self, -1, self.figure)
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.EXPAND)
self.SetSizer(self.sizer)
self.Fit()
self.add_toolbar() # comment this out for no toolbar
示例14: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def __init__(self, *args, **kwargs):
wx.Frame.__init__(self, *args, **kwargs)
panel = wx.Panel(self)
# create the GUI elements
self.createCanvas(panel)
self.createSliders(panel)
# place them in a sizer for the Layout
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.canvas, 1, wx.EXPAND)
sizer.Add(self.frequencySliderGroup.sizer, 0,
wx.EXPAND | wx.ALIGN_CENTER | wx.ALL, border=5)
sizer.Add(self.amplitudeSliderGroup.sizer, 0,
wx.EXPAND | wx.ALIGN_CENTER | wx.ALL, border=5)
panel.SetSizer(sizer)
示例15: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EXPAND [as 别名]
def __init__(self, parent, n_max_lines):
wx.Panel.__init__(self, parent, -1)
self.parent = parent
self.n_max_lines = n_max_lines
vbox = wx.BoxSizer(wx.VERTICAL)
style = wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL
self.text = wx.TextCtrl(self, -1, "", style=style)
vbox.Add(self.text, 1, wx.EXPAND)
self.SetSizer(vbox)
self.handler = logging.StreamHandler(self)
formatter = logging.Formatter("%(asctime)s: %(message)s",
"%Y-%m-%d %H:%M:%S")
self.handler.setFormatter(formatter)
logger.addHandler(self.handler)