当前位置: 首页>>代码示例>>Python>>正文


Python wx.Slider方法代码示例

本文整理汇总了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) 
开发者ID:holzschu,项目名称:python3_ios,代码行数:25,代码来源:fourier_demo_wx_sgskip.py

示例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 
开发者ID:fogleman,项目名称:GraphLayout,代码行数:22,代码来源:viewer.py

示例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) 
开发者ID:DeepLabCut,项目名称:DeepLabCut,代码行数:24,代码来源:refinement.py

示例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
#============================================================================== 
开发者ID:pymupdf,项目名称:PyMuPDF-Utilities,代码行数:26,代码来源:PDFoutline.py

示例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) 
开发者ID:Wyliodrin,项目名称:pybass,代码行数:10,代码来源:wx_bass_control.py

示例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) 
开发者ID:Wyliodrin,项目名称:pybass,代码行数:10,代码来源:wx_ctrl_phoenix.py

示例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) 
开发者ID:geomagpy,项目名称:magpy,代码行数:33,代码来源:monitorpage.py

示例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() 
开发者ID:geomagpy,项目名称:magpy,代码行数:13,代码来源:developpage.py

示例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) 
开发者ID:sailoog,项目名称:openplotter,代码行数:16,代码来源:SK-simulator.py

示例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) 
开发者ID:sailoog,项目名称:openplotter,代码行数:15,代码来源:SK-simulator.py

示例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 
开发者ID:sailoog,项目名称:openplotter,代码行数:6,代码来源:SK-simulator.py

示例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 
开发者ID:sailoog,项目名称:openplotter,代码行数:7,代码来源:SK-simulator.py

示例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() 
开发者ID:DeepLabCut,项目名称:DeepLabCut,代码行数:13,代码来源:outlier_frame_extraction_toolbox.py

示例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) 
开发者ID:DeepLabCut,项目名称:DeepLabCut,代码行数:34,代码来源:multiple_individuals_refinement_toolbox.py

示例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) 
开发者ID:DeepLabCut,项目名称:DeepLabCut,代码行数:31,代码来源:labeling_toolbox.py


注:本文中的wx.Slider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。