本文整理汇总了Python中wx.Slider方法的典型用法代码示例。如果您正苦于以下问题:Python wx.Slider方法的具体用法?Python wx.Slider怎么用?Python wx.Slider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.Slider方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def __init__(self, parent, label, param):
self.sliderLabel = wx.StaticText(parent, label=label)
self.sliderText = wx.TextCtrl(parent, -1, style=wx.TE_PROCESS_ENTER)
self.slider = wx.Slider(parent, -1)
# self.slider.SetMax(param.maximum*1000)
self.slider.SetRange(0, param.maximum * 1000)
self.setKnob(param.value)
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(self.sliderLabel, 0,
wx.EXPAND | wx.ALIGN_CENTER | wx.ALL,
border=2)
sizer.Add(self.sliderText, 0,
wx.EXPAND | wx.ALIGN_CENTER | wx.ALL,
border=2)
sizer.Add(self.slider, 1, wx.EXPAND)
self.sizer = sizer
self.slider.Bind(wx.EVT_SLIDER, self.sliderHandler)
self.sliderText.Bind(wx.EVT_TEXT_ENTER, self.sliderTextHandler)
self.param = param
self.param.attach(self)
示例2: create_sidebar
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def create_sidebar(self, parent):
names = [
'edge_edge',
'rank',
'length',
'area',
]
sizer = wx.BoxSizer(wx.VERTICAL)
self.sliders = []
for name in names:
value = int(layout.WEIGHTS[name] * 10)
text = wx.StaticText(parent, -1, name)
slider = wx.Slider(parent, -1, value, 0, 100)
slider.name = name
slider.Bind(wx.EVT_SCROLL_THUMBRELEASE, self.on_slider)
self.sliders.append(slider)
sizer.Add(text)
sizer.Add(slider, 0, wx.EXPAND)
sizer.AddSpacer(10)
return sizer
示例3: addCheckBoxSlider
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def addCheckBoxSlider(self, bodyparts, fileIndex, markersize):
"""
Adds checkbox and a slider
"""
self.choiceBox = wx.BoxSizer(wx.VERTICAL)
self.slider = wx.Slider(
self,
-1,
markersize,
1,
markersize * 3,
size=(250, -1),
style=wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS,
)
self.slider.Enable(False)
self.checkBox = wx.CheckBox(self, id=wx.ID_ANY, label="Adjust marker size.")
self.choiceBox.Add(self.slider, 0, wx.ALL, 5)
self.choiceBox.Add(self.checkBox, 0, wx.ALL, 5)
self.SetSizerAndFit(self.choiceBox)
self.Layout()
return (self.choiceBox, self.slider, self.checkBox)
示例4: OnCellDClick
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def OnCellDClick(self, evt):
row = evt.GetRow() # row
col = evt.GetCol() # col
dlg = self.GetParent()
seite = self.GetTable().GetValue(row, 2) # make sure page is displayed
PicRefresh(dlg, seite)
if col != 3: # further handling only for height col
evt.Skip()
return
self.bookmark_page = self.GetTable().GetValue(row, 2) # store page no
self.bookmark_row = row # store grid row
self.MakeCellVisible(row, col)
h = self.GetTable().GetValue(row, 3) # get current height value
h = max(int(h), 1) # should be > 0
maxh = spad.height # maxh is page height
d = Slider(self, h, maxh) # create slider dialog
d.ShowModal() # show it
self.bookmark = d.slider.GetValue() # extract & store value
evt.Skip()
return
#==============================================================================
# Event Method: move row
#==============================================================================
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def __init__(self, *args, **kwargs):
wx.Slider.__init__(self, *args, **kwargs)
self.player_ctrl = args[0]
self.Bind(wx.EVT_LEFT_DOWN, self.event_left_down)
self.Bind(wx.EVT_LEFT_UP, self.event_left_up)
self.timer_interval = 500
self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.event_timer)
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def __init__(self, *args, **kwargs):
self.timer_interval = 500
self.player_ctrl = args[0]
wx.Slider.__init__(self, *args, **kwargs)
self.timer = wx.Timer(self)
self.Bind(wx.EVT_LEFT_DOWN, self.event_left_down)
self.Bind(wx.EVT_LEFT_UP, self.event_left_up)
self.Bind(wx.EVT_TIMER, self.event_timer)
示例7: createControls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def createControls(self):
# all buttons open dlg to add parameters (e.g. IP,
self.getMARTASButton = wx.Button(self,-1,"Connect to MARTAS", size=(160,30))
self.getMARCOSButton = wx.Button(self,-1,"Connect to MARCOS", size=(160,30))
#self.getMQTTButton = wx.Button(self,-1,"Connect to MQTT", size=(160,30))
self.martasLabel = wx.TextCtrl(self, value="not connected", size=(160,30), style=wx.TE_RICH) # red bg
self.marcosLabel = wx.TextCtrl(self, value="not connected", size=(160,30), style=wx.TE_RICH) # red bg
#self.mqttLabel = wx.TextCtrl(self, value="not connected", size=(160,30), style=wx.TE_RICH) # red bg
self.marcosLabel.SetEditable(False)
self.martasLabel.SetEditable(False)
#self.mqttLabel.SetEditable(False)
# Parameters if connection is established
#
self.coverageLabel = wx.StaticText(self, label="Plot coverage (sec):", size=(160,30))
self.coverageTextCtrl = wx.TextCtrl(self, value="600", size=(160,30))
self.sliderLabel = wx.StaticText(self, label="Update period (sec):", size=(160,30))
self.frequSlider = wx.Slider(self, -1, 10, 1, 60, (-1, -1), (100, -1),
wx.SL_AUTOTICKS | wx.SL_HORIZONTAL | wx.SL_LABELS)
self.startMonitorButton = wx.Button(self,-1,"Start Monitor", size=(160,30)) # if started then everything else will be disabled ..... except save monitor
self.stopMonitorButton = wx.Button(self,-1,"Stop Monitor", size=(160,30))
self.saveMonitorButton = wx.Button(self,-1,"Log data*", size=(160,30)) # produces a bin file
#self.startMonitorButton.Disable()
self.saveMonitorButton.Disable()
# Connection Log
#
self.connectionLogLabel = wx.StaticText(self, label="Connection Log:")
self.connectionLogTextCtrl = wx.TextCtrl(self, wx.ID_ANY, size=(330,300),
style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL)
示例8: createControls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def createControls(self):
self.selectPortButton = wx.Button(self,-1,"Select MARTAS")
self.portnameTextCtrl = wx.TextCtrl(self, value="coming soon")
self.portnameTextCtrl.Disable()
self.sliderLabel = wx.StaticText(self, label="Update frequency:")
self.frequSlider = wx.Slider(self, -1, 10, 1, 20, (-1, -1), (100, -1),
wx.SL_AUTOTICKS | wx.SL_HORIZONTAL | wx.SL_LABELS)
self.startMonitorButton = wx.Button(self,-1,"Start Monitor")
self.stopMonitorButton = wx.Button(self,-1,"Stop Monitor")
self.startMonitorButton.Disable()
self.stopMonitorButton.Disable()
示例9: SK_Slider
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def SK_Slider(self,index,get_label,get_start,get_min,get_max,get_factor,get_offset):
self.Slider.append([])
self.Slider_v.append([])
self.HSlider.append([])
self.Slider_list.append([index,get_label,get_start,get_min,get_max,get_factor,get_offset,False])
self.Slider[index]= wx.CheckBox(self.panel, label=get_label)
self.Slider_v[index] = wx.Slider(self.panel, -1, get_start, get_min, get_max, (-1,-1), (250, -1), wx.SL_AUTOTICKS | wx.SL_HORIZONTAL | wx.SL_VALUE_LABEL)
self.HSlider[index] = wx.BoxSizer(wx.HORIZONTAL)
self.HSlider[index].Add(self.Slider[index], 0, wx.ALL|wx.EXPAND, 5)
self.HSlider[index].Add((0,0), 1, wx.ALL|wx.EXPAND, 0)
self.HSlider[index].Add(self.Slider_v[index], 0, wx.ALL|wx.EXPAND, 5)
self.vbox.Add(self.HSlider[index], 0, wx.ALL|wx.EXPAND, 5)
示例10: SK_Slider_conf
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def SK_Slider_conf(self,index,get_label,get_start,get_min,get_max,get_factor,get_offset):
self.Slider.append([])
self.Slider_v.append([])
self.HSlider.append([])
self.Slider[index]= wx.CheckBox(self.panel, label=get_label)
self.Slider_v[index] = wx.Slider(self.panel, -1, get_start, get_min, get_max, (-1,-1), (250, -1), wx.SL_AUTOTICKS | wx.SL_HORIZONTAL | wx.SL_VALUE_LABEL)
self.HSlider[index] = wx.BoxSizer(wx.HORIZONTAL)
self.HSlider[index].Add(self.Slider[index], 0, wx.ALL|wx.EXPAND, 5)
self.HSlider[index].Add((0,0), 1, wx.ALL|wx.EXPAND, 0)
self.HSlider[index].Add(self.Slider_v[index], 0, wx.ALL|wx.EXPAND, 5)
self.vbox.Add(self.HSlider[index], 0, wx.ALL|wx.EXPAND, 5)
示例11: setCheckbox
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def setCheckbox(self, value):
for i in self.Slider_list:
self.Slider[i[0]].SetValue(value)
i[7]=value
示例12: on_change_checkbox
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def on_change_checkbox(self,e):
for i in self.Slider_list:
i[7]=self.Slider[i[0]].GetValue()
# thread
示例13: OnSliderScroll
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def OnSliderScroll(self, event):
"""
Slider to scroll through the video
"""
self.axes.clear()
self.figure.delaxes(self.figure.axes[1])
self.grab.Bind(wx.EVT_BUTTON, self.grabFrame)
self.currFrame = self.slider.GetValue()
self.startFrame.SetValue(self.currFrame)
self.update()
self.plot_labels()
示例14: addCheckBoxSlider
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def addCheckBoxSlider(self, bodyparts, fileIndex, markersize):
"""
Adds checkbox and a slider
"""
self.choiceBox = wx.BoxSizer(wx.VERTICAL)
self.slider = wx.Slider(
self,
-1,
markersize,
1,
markersize * 3,
size=(250, -1),
style=wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS,
)
self.slider.Enable(False)
self.checkBox = wx.CheckBox(self, id=wx.ID_ANY, label="Adjust marker size.")
self.choiceBox.Add(self.slider, 0, wx.ALL, 5)
self.choiceBox.Add(self.checkBox, 0, wx.ALL, 5)
names = ["Color individuals", "Color bodyparts"]
self.visualization_radiobox = wx.RadioBox(
self,
label="Select the visualization scheme",
majorDimension=1,
style=wx.RA_SPECIFY_COLS,
choices=names,
)
self.choiceBox.Add(self.visualization_radiobox, 0, wx.EXPAND | wx.ALL, 10)
self.SetSizerAndFit(self.choiceBox)
self.Layout()
return (self.choiceBox, self.slider, self.checkBox, self.visualization_radiobox)
示例15: addRadioButtons
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Slider [as 别名]
def addRadioButtons(self, bodyparts, fileIndex, markersize):
"""
Adds radio buttons for each bodypart on the right panel
"""
self.choiceBox = wx.BoxSizer(wx.VERTICAL)
choices = [l for l in bodyparts]
self.fieldradiobox = wx.RadioBox(
self,
label="Select a bodypart to label",
style=wx.RA_SPECIFY_ROWS,
choices=choices,
)
self.slider = wx.Slider(
self,
-1,
markersize,
1,
markersize * 3,
size=(250, -1),
style=wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS,
)
self.slider.Enable(False)
self.checkBox = wx.CheckBox(self, id=wx.ID_ANY, label="Adjust marker size.")
self.choiceBox.Add(self.slider, 0, wx.ALL, 5)
self.choiceBox.Add(self.checkBox, 0, wx.ALL, 5)
self.choiceBox.Add(self.fieldradiobox, 0, wx.EXPAND | wx.ALL, 10)
self.SetSizerAndFit(self.choiceBox)
self.Layout()
return (self.choiceBox, self.fieldradiobox, self.slider, self.checkBox)