本文整理汇总了Python中wx.SL_AUTOTICKS属性的典型用法代码示例。如果您正苦于以下问题:Python wx.SL_AUTOTICKS属性的具体用法?Python wx.SL_AUTOTICKS怎么用?Python wx.SL_AUTOTICKS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.SL_AUTOTICKS属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addCheckBoxSlider
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [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)
示例2: createControls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [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)
示例3: createControls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [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()
示例4: SK_Slider
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [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)
示例5: SK_Slider_conf
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [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)
示例6: addCheckBoxSlider
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [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)
示例7: addRadioButtons
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [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)
示例8: init_ui
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [as 别名]
def init_ui(self):
"""Initialize the UI elements"""
pnl = wx.Panel(self)
sizer = wx.BoxSizer(orient=wx.HORIZONTAL)
self.slider = wx.Slider(parent=pnl, id=wx.ID_ANY, value=self._current_value,
minValue=self.min_value, maxValue=self.max_value,
name="Choose a number", size=self.GetSize(),
style=wx.SL_VALUE_LABEL | wx.SL_AUTOTICKS)
sizer.Add(self.slider)
pnl.SetSizer(sizer)
sizer.Fit(self)
示例9: Configure
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [as 别名]
def Configure(self, address=None, level=1):
if address is None:
address = self.defaultAddress
panel = eg.ConfigPanel()
maskedCtrl = masked.TextCtrl(
parent=panel,
mask="#### #### - ####",
defaultValue="1111 1111 - 1111",
excludeChars="056789",
formatcodes="F",
validRequired=False,
)
maskedCtrl.SetValue(self.GetStringFromAddress(address))
def LevelCallback(value):
return "%.02f %%" % (value * 100.00 / 16)
levelCtrl = eg.Slider(
panel,
value=level,
min=1,
max=16,
minLabel="6.25 %",
maxLabel="100.00 %",
style = wx.SL_AUTOTICKS|wx.SL_TOP,
size=(300,-1),
levelCallback=LevelCallback
)
levelCtrl.SetMinSize((300, -1))
panel.AddLine("Address:", maskedCtrl)
panel.AddLine("Level:", levelCtrl)
while panel.Affirmed():
address = self.GetAddressFromString(maskedCtrl.GetPlainValue())
ActionBase.defaultAddress = address
panel.SetResult(
address,
levelCtrl.GetValue(),
)
示例10: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: EngraveProperty.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
wx.Frame.__init__(self, *args, **kwds)
Module.__init__(self)
self.SetSize((305, 216))
self.spin_speed_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "20.0", min=0.0, max=240.0)
self.spin_power_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "1000.0", min=0.0, max=1000.0)
self.checkbox_custom_d_ratio = wx.CheckBox(self, wx.ID_ANY, _("Custom D-Ratio"))
self.spin_speed_dratio = wx.SpinCtrlDouble(self, wx.ID_ANY, "0.261", min=0.0, max=1.0)
self.checkbox_custom_accel = wx.CheckBox(self, wx.ID_ANY, _("Acceleration Override"))
self.slider_accel = wx.Slider(self, wx.ID_ANY, 1, 1, 4, style=wx.SL_AUTOTICKS | wx.SL_LABELS)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_TEXT, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_TEXT, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_CHECKBOX, self.on_check_custom_d_ratio, self.checkbox_custom_d_ratio)
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_speed_dratio, self.spin_speed_dratio)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_speed_dratio, self.spin_speed_dratio)
self.Bind(wx.EVT_TEXT, self.on_spin_speed_dratio, self.spin_speed_dratio)
self.Bind(wx.EVT_CHECKBOX, self.on_check_custom_accel, self.checkbox_custom_accel)
self.Bind(wx.EVT_COMMAND_SCROLL, self.on_slider_accel, self.slider_accel)
self.operation = None
self.Bind(wx.EVT_CLOSE, self.on_close, self)
示例11: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: CutProperty.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
wx.Frame.__init__(self, *args, **kwds)
Module.__init__(self)
self.SetSize((305, 216))
self.spin_speed_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "10.0", min=0.0, max=240.0)
self.spin_power_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "1000.0", min=0.0, max=1000.0)
self.checkbox_custom_d_ratio = wx.CheckBox(self, wx.ID_ANY, _("Custom D-Ratio"))
self.spin_speed_dratio = wx.SpinCtrlDouble(self, wx.ID_ANY, "0.261", min=0.0, max=1.0)
self.checkbox_custom_accel = wx.CheckBox(self, wx.ID_ANY, _("Acceleration Override"))
self.slider_accel = wx.Slider(self, wx.ID_ANY, 1, 1, 4, style=wx.SL_AUTOTICKS | wx.SL_LABELS)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_TEXT, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_TEXT, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_CHECKBOX, self.on_check_custom_d_ratio, self.checkbox_custom_d_ratio)
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_speed_dratio, self.spin_speed_dratio)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_speed_dratio, self.spin_speed_dratio)
self.Bind(wx.EVT_TEXT, self.on_spin_speed_dratio, self.spin_speed_dratio)
self.Bind(wx.EVT_CHECKBOX, self.on_check_custom_accel, self.checkbox_custom_accel)
self.Bind(wx.EVT_COMMAND_SCROLL, self.on_slider_accel, self.slider_accel)
self.operation = None
self.Bind(wx.EVT_CLOSE, self.on_close, self)
示例12: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [as 别名]
def __init__(self, *args, **kwargs):
kwargs["style"] = kwargs.get("style", 0) | wx.BORDER_NONE
super(ImageChooserControl, self).__init__(*args, **kwargs)
self._slider = wx.Slider(self, -1, style=wx.SL_AUTOTICKS)
self._slider.SetMin(1)
self._label = wx.StaticText(self, -1, "Some Text")
# Work out the maximum size of the text so that we can cut off the slider to allow room
if WX3:
_, size_y = self._label.GetAdjustedBestSize()
self._label.SetFont(self._label.GetFont().Italic())
self.size_y = max(size_y, self._label.GetAdjustedBestSize()[1])
else:
_, size_y = self._label.GetEffectiveMinSize()
self._label.SetFont(self._label.GetFont().Italic())
self.size_y = max(size_y, self._label.GetEffectiveMinSize()[1])
# Use a horizontal box to control vertical alignment
labelSizer = wx.BoxSizer(wx.HORIZONTAL)
labelSizer.Add(self._label, flag=wx.ALL | wx.ALIGN_BOTTOM)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self._slider, flag=wx.ALL | wx.ALIGN_LEFT)
sizer.Add(labelSizer, proportion=1, flag=wx.EXPAND)
self.SetSizer(sizer)
示例13: addRadioButtons
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [as 别名]
def addRadioButtons(self, bodyparts, individual_names, 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",
majorDimension=3,
style=wx.RA_SPECIFY_COLS,
choices=choices,
)
self.change_marker = wx.Slider(
self,
-1,
markersize,
1,
markersize * 3,
size=(250, -1),
style=wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS,
)
self.change_marker.Enable(False)
names = [k for k in individual_names]
self.individualradiobox = wx.RadioBox(
self,
label="Select an individual",
majorDimension=3,
style=wx.RA_SPECIFY_COLS,
choices=names,
)
self.checkBox = wx.CheckBox(self, id=wx.ID_ANY, label="Adjust marker size")
self.choiceBox.Add(self.change_marker, 0, wx.ALL, 5)
self.choiceBox.Add(self.checkBox, 0, wx.ALL, 5)
self.choiceBox.Add(self.individualradiobox, 0, wx.EXPAND | wx.ALL, 10)
self.choiceBox.Add(self.fieldradiobox, 0, wx.EXPAND | wx.ALL, 10)
self.SetSizerAndFit(self.choiceBox)
self.Layout()
return (
self.choiceBox,
self.individualradiobox,
self.fieldradiobox,
self.change_marker,
self.checkBox,
)
示例14: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import SL_AUTOTICKS [as 别名]
def __init__(self, *args, **kwds):
wx.Panel.__init__(self, *args, **kwds)
self.settings = self.GetParent().settings
self._sizer = wx.BoxSizer(wx.VERTICAL)
s = self._sizer
self.SetSizer(self._sizer)
grid = wx.FlexGridSizer(cols=2, rows=2)
s.Add(grid)
txt1 = wx.StaticText(self, -1, "Zoom level:")
grid.Add(txt1, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
self.zoom_ctrl = wx.Choice(
self, -1, choices=["Auto", "25%", "50%", "100%", "200%", "400%", "800%"]
)
self.zoom_ctrl.SetSelection(self.settings.zoom_level)
grid.Add(self.zoom_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
txt11 = wx.StaticText(self, -1, "Color scheme:")
grid.Add(txt11, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
self.color_ctrl = wx.Choice(
self, -1, choices=["grayscale", "rainbow", "heatmap", "invert"]
)
self.color_ctrl.SetSelection(0)
grid.Add(self.color_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
self._sizer.Fit(self)
box = wx.BoxSizer(wx.HORIZONTAL)
s.Add(box)
txt2 = wx.StaticText(self, -1, "Brightness")
box.Add(txt2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
self.brightness_ctrl = wx.Slider(
self, -1, size=(200, -1), style=wx.SL_AUTOTICKS | wx.SL_LABELS
)
box.Add(self.brightness_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
self.brightness_ctrl.SetMin(1)
self.brightness_ctrl.SetMax(500)
self.brightness_ctrl.SetValue(self.settings.brightness)
self.brightness_ctrl.SetTickFreq(25)
self.center_ctrl = wx.CheckBox(self, -1, "Mark beam center")
self.center_ctrl.SetValue(self.settings.show_beam_center)
s.Add(self.center_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
self.spots_ctrl = wx.CheckBox(self, -1, "Show spotfinder results")
self.spots_ctrl.SetValue(self.settings.show_spotfinder_spots)
s.Add(self.spots_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
self.integ_ctrl = wx.CheckBox(self, -1, "Show integration results")
self.integ_ctrl.SetValue(self.settings.show_integration)
s.Add(self.integ_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
# self.invert_ctrl = wx.CheckBox(self, -1, "Invert beam center axes")
# self.invert_ctrl.SetValue(self.settings.invert_beam_center_axes)
# s.Add(self.invert_ctrl, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
self.Bind(wx.EVT_CHOICE, self.OnUpdate, self.zoom_ctrl)
self.Bind(wx.EVT_CHOICE, self.OnUpdate, self.color_ctrl)
self.Bind(wx.EVT_SLIDER, self.OnUpdateBrightness, self.brightness_ctrl)
self.Bind(wx.EVT_CHECKBOX, self.OnUpdate2, self.center_ctrl)
self.Bind(wx.EVT_CHECKBOX, self.OnUpdate2, self.spots_ctrl)
txt3 = wx.StaticText(self, -1, "Thumbnail view:")
s.Add(txt3, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
self.thumb_panel = rstbx.viewer.display.ThumbnailView(
parent=self, size=(256, 256), style=wx.SUNKEN_BORDER
)
s.Add(self.thumb_panel, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
# self.Bind(wx.EVT_CHECKBOX, self.OnUpdate2, self.invert_ctrl)