本文整理汇总了Python中wx.GROW属性的典型用法代码示例。如果您正苦于以下问题:Python wx.GROW属性的具体用法?Python wx.GROW怎么用?Python wx.GROW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.GROW属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def __init__(self, targetfig):
wx.Frame.__init__(self, None, -1, "Configure subplots")
toolfig = Figure((6,3))
canvas = FigureCanvasWx(self, -1, toolfig)
# Create a figure manager to manage things
figmgr = FigureManager(canvas, 1, self)
# Now put all into a sizer
sizer = wx.BoxSizer(wx.VERTICAL)
# This way of adding to sizer allows resizing
sizer.Add(canvas, 1, wx.LEFT|wx.TOP|wx.GROW)
self.SetSizer(sizer)
self.Fit()
tool = SubplotTool(targetfig, toolfig)
示例2: configure_subplots
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def configure_subplots(self, evt):
frame = wx.Frame(None, -1, "Configure subplots")
toolfig = Figure((6,3))
canvas = self.get_canvas(frame, toolfig)
# Create a figure manager to manage things
figmgr = FigureManager(canvas, 1, frame)
# Now put all into a sizer
sizer = wx.BoxSizer(wx.VERTICAL)
# This way of adding to sizer allows resizing
sizer.Add(canvas, 1, wx.LEFT|wx.TOP|wx.GROW)
frame.SetSizer(sizer)
frame.Fit()
tool = SubplotTool(self.canvas.figure, toolfig)
frame.Show()
示例3: configure_subplots
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def configure_subplots(self, evt):
global FigureManager # placates pyflakes: created by @_Backend.export
frame = wx.Frame(None, -1, "Configure subplots")
_set_frame_icon(frame)
toolfig = Figure((6, 3))
canvas = self.get_canvas(frame, toolfig)
# Create a figure manager to manage things
FigureManager(canvas, 1, frame)
# Now put all into a sizer
sizer = wx.BoxSizer(wx.VERTICAL)
# This way of adding to sizer allows resizing
sizer.Add(canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
frame.SetSizer(sizer)
frame.Fit()
SubplotTool(self.canvas.figure, toolfig)
frame.Show()
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def __init__(self, targetfig):
global FigureManager # placates pyflakes: created by @_Backend.export
wx.Frame.__init__(self, None, -1, "Configure subplots")
toolfig = Figure((6, 3))
canvas = FigureCanvasWx(self, -1, toolfig)
# Create a figure manager to manage things
figmgr = FigureManager(canvas, 1, self)
# Now put all into a sizer
sizer = wx.BoxSizer(wx.VERTICAL)
# This way of adding to sizer allows resizing
sizer.Add(canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
self.SetSizer(sizer)
self.Fit()
tool = SubplotTool(targetfig, toolfig)
示例5: configure_subplots
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def configure_subplots(self, evt):
global FigureManager # placates pyflakes: created by @_Backend.export
frame = wx.Frame(None, -1, "Configure subplots")
_set_frame_icon(frame)
toolfig = Figure((6, 3))
canvas = self.get_canvas(frame, toolfig)
# Create a figure manager to manage things
figmgr = FigureManager(canvas, 1, frame)
# Now put all into a sizer
sizer = wx.BoxSizer(wx.VERTICAL)
# This way of adding to sizer allows resizing
sizer.Add(canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
frame.SetSizer(sizer)
frame.Fit()
tool = SubplotTool(self.canvas.figure, toolfig)
frame.Show()
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
self.fig = Figure((5, 4), 75)
self.canvas = FigureCanvas(self, -1, self.fig)
self.toolbar = NavigationToolbar(self.canvas) # matplotlib toolbar
self.toolbar.Realize()
# self.toolbar.set_active([0,1])
# Now put all into a sizer
sizer = wx.BoxSizer(wx.VERTICAL)
# This way of adding to sizer allows resizing
sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
# Best to allow the toolbar to resize!
sizer.Add(self.toolbar, 0, wx.GROW)
self.SetSizer(sizer)
self.Fit()
示例7: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def __init__(self, parent):
wx.Frame.__init__(self, parent)
self.figure = Figure()
self.axes = self.figure.add_subplot(111)
self.canvas = FigureCanvas(self, -1, self.figure)
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
self.SetSizer(self.sizer)
self.Fit()
self.distances = []
self.elevations = []
self.point_distances = []
self.point_elevations = []
self.limx = [0, 1]
self.limy = [0, 1]
self.ticks = 1
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def __init__(self):
wx.Frame.__init__(self, None, -1, 'CanvasFrame', size=(550, 350))
if sys.version_info[0] == 3:
color = wx.Colour("WHITE")
else:
color = wx.NamedColour("WHITE")
self.SetBackgroundColour(color)
self.figure = Figure()
self.axes = self.figure.add_subplot(111)
t = arange(0.0, 3.0, 0.01)
s = sin(2 * 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.GROW)
self.SetSizerAndFit(self.sizer)
self.add_toolbar()
示例9: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def __init__(self, parent, torrent, *a, **k):
BTPanel.__init__(self, parent, *a, **k)
self.log = wx.TextCtrl(self, style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_RICH2)
self.log.Bind(wx.EVT_TEXT, self.OnText)
self.Add(self.log, flag=wx.GROW, proportion=1)
class MyTorrentLogger(logging.Handler):
def set_log_func(self, func):
self.log_func = func
def emit(self, record):
gui_wrap(self.log_func, self.format(record) + '\n')
l = MyTorrentLogger()
l.setFormatter(bt_log_fmt)
l.set_log_func(self.log.AppendText)
torrent.handler.setTarget(l)
torrent.handler.flush()
示例10: toggle_details
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def toggle_details(self, event=None):
if self.details_shown:
self.sizer.AddGrowableRow(0)
self.notebook.Hide()
self.sizer.Detach(self.notebook)
if sys.platform == 'darwin':
self.parent.sizer.SetItemMinSize(self, (-1, -1))
self.sizer.Layout()
self.details_button.SetLabel(_("Show &Details"))
self.parent.Fit()
self.details_shown = False
else:
self.sizer.RemoveGrowableRow(0)
self.notebook.Show()
self.sizer.Add(self.notebook, flag=wx.GROW, proportion=1)
if sys.platform == 'darwin':
self.parent.sizer.SetItemMinSize(self, (100, 420))
self.sizer.Layout()
self.details_button.SetLabel(_("Hide &Details"))
self.parent.Fit()
self.details_shown = True
示例11: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def __init__(self, parent, history, *a, **k):
BTPanel.__init__(self, parent, *a, **k)
#self.SetMinSize((200, 200))
self.notebook = wx.Notebook(self, style=wx.CLIP_CHILDREN)
self.statistics = StatisticsPanel(self.notebook, style=wx.CLIP_CHILDREN)
self.notebook.AddPage(self.statistics, _("Statistics"))
self.bling = BandwidthGraphPanel(self.notebook, history)
self.speed_tab_index = self.notebook.GetPageCount()
self.notebook.AddPage(self.bling, _("Speed"))
self.notebook.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
self.sizer.Add(self.notebook, flag=wx.GROW, proportion=1)
self.Hide()
self.sizer.Layout()
示例12: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def __init__(self, parent, label, xxx):
ParamPage.__init__(self, parent, xxx)
box = wx.StaticBox(self, -1, label)
box.SetFont(g.labelFont())
topSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
sizer = wx.FlexGridSizer(len(xxx.styles), 2, 0, 1)
sizer.AddGrowableCol(1)
for param in xxx.styles:
present = xxx.params.has_key(param)
check = wx.CheckBox(self, paramIDs[param],
param + ':', size = (LABEL_WIDTH,-1), name = param)
check.SetValue(present)
control = paramDict[param](self, name = param)
control.Enable(present)
sizer.AddMany([ (check, 0, wx.ALIGN_CENTER_VERTICAL),
(control, 0, wx.ALIGN_CENTER_VERTICAL | wx.GROW) ])
self.checks[param] = check
self.controls[param] = control
topSizer.Add(sizer, 1, wx.ALL | wx.EXPAND, 3)
self.SetAutoLayout(True)
self.SetSizer(topSizer)
topSizer.Fit(self)
# Set data for a cahced page
示例13: row_box
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def row_box(self, row):
label = wx.TextCtrl(self.panel, -1, value=self.var_names[row])
model_input_types = ["Scalar", "Time series", "Grid", "Grid sequence"]
dlist = wx.Choice(self.panel, -1, choices=model_input_types)
# Set to current input type here
text = wx.TextCtrl(self.panel, -1, self.var_setting[row])
ustr = wx.StaticText(self.panel, -1, self.var_units[row])
# self.Bind(wx.EVT_CHOICE, self.onChoice, self.var_type)
box = wx.BoxSizer(wx.HORIZONTAL)
box.Add(label, 0, wx.GROW, border=self.pad)
box.Add(dlist, 0, wx.GROW, border=self.pad)
box.Add(text, 0, wx.GROW, border=self.pad)
box.Add(ustr, 0, wx.GROW, border=self.pad)
# box.AddMany([label, dlist, text, ustr]) #, 1, wx.EXPAND)
# self.SetSizer(box)
return box
#---------------------------------------------
# Create sizer box for the process timestep
#---------------------------------------------
示例14: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [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.axes.set_xlabel('t')
self.axes.set_ylabel('sin(t)')
self.figure_canvas = FigureCanvas(self, -1, self.figure)
# Note that event is a MplEvent
self.figure_canvas.mpl_connect(
'motion_notify_event', self.UpdateStatusBar)
self.figure_canvas.Bind(wx.EVT_ENTER_WINDOW, self.ChangeCursor)
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.figure_canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
self.SetSizer(self.sizer)
self.Fit()
self.statusBar = wx.StatusBar(self, -1)
self.SetStatusBar(self.statusBar)
self.toolbar = NavigationToolbar2Wx(self.figure_canvas)
self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
self.toolbar.Show()
示例15: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import GROW [as 别名]
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, -1, title, size=(550, 350))
self.figure = Figure()
self.axes = self.figure.add_subplot(111)
self.canvas = FigureCanvas(self, -1, self.figure)
self.change_plot(0)
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.add_buttonbar()
self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
self.add_toolbar() # comment this out for no toolbar
menuBar = wx.MenuBar()
# File Menu
menu = wx.Menu()
m_exit = menu.Append(wx.ID_EXIT, "E&xit\tAlt-X", "Exit this simple sample")
menuBar.Append(menu, "&File")
self.Bind(wx.EVT_MENU, self.OnClose, m_exit)
if IS_GTK or IS_WIN:
# Equation Menu
menu = wx.Menu()
for i, (mt, func) in enumerate(functions):
bm = mathtext_to_wxbitmap(mt)
item = wx.MenuItem(menu, 1000 + i, " ")
item.SetBitmap(bm)
menu.Append(item)
self.Bind(wx.EVT_MENU, self.OnChangePlot, item)
menuBar.Append(menu, "&Functions")
self.SetMenuBar(menuBar)
self.SetSizer(self.sizer)
self.Fit()