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


Python wx.Control方法代码示例

本文整理汇总了Python中wx.Control方法的典型用法代码示例。如果您正苦于以下问题:Python wx.Control方法的具体用法?Python wx.Control怎么用?Python wx.Control使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wx的用法示例。


在下文中一共展示了wx.Control方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Control [as 别名]
def initialize(self):
        self.device.close('window', self.name)
        self.Show()
        if self.device.is_root():
            for attr in dir(self):
                value = getattr(self, attr)
                if isinstance(value, wx.Control):
                    value.Enable(False)
            dlg = wx.MessageDialog(None, _("You do not have a selected device."),
                                   _("No Device Selected."), wx.OK | wx.ICON_WARNING)
            result = dlg.ShowModal()
            dlg.Destroy()
            return
        self.device.setting(bool, 'rotary', False)
        self.device.setting(float, 'scale_x', 1.0)
        self.device.setting(float, 'scale_y', 1.0)
        self.spin_rotary_scalex.SetValue(self.device.scale_x)
        self.spin_rotary_scaley.SetValue(self.device.scale_y)
        self.checkbox_rotary.SetValue(self.device.rotary)
        self.on_check_rotary(None) 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:22,代码来源:RotarySettings.py

示例2: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Control [as 别名]
def __init__(self, parent, id):
        style = wx.WANTS_CHARS | wx.FULL_REPAINT_ON_RESIZE | wx.NO_BORDER
        wx.Control.__init__(self, parent, id, style = style)

        self.panel = parent

        wx.EVT_SIZE(self, self.OnSize)
        wx.EVT_PAINT(self, self.OnPaint)
        wx.EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
        wx.EVT_LEFT_DOWN(self, self.OnLeftDown)
        wx.EVT_LEFT_UP(self, self.OnLeftUp)
        wx.EVT_LEFT_DCLICK(self, self.OnLeftDown)
        wx.EVT_RIGHT_DOWN(self, self.OnRightDown)
        wx.EVT_MOTION(self, self.OnMotion)
        wx.EVT_MOUSEWHEEL(self, self.OnMouseWheel)
        wx.EVT_CHAR(self, self.OnKeyChar)

        self.createEmptySp()
        self.updateScreen(redraw = False) 
开发者ID:trelby,项目名称:trelby,代码行数:21,代码来源:trelby.py

示例3: SetLabel

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Control [as 别名]
def SetLabel(self, label, wrapped=False):
        """
        Sets the :class:`AutoWrapStaticText` label.

        All "&" characters in the label are special and indicate that the following character is
        a mnemonic for this control and can be used to activate it from the keyboard (typically
        by using ``Alt`` key in combination with it). To insert a literal ampersand character, you
        need to double it, i.e. use "&&". If this behaviour is undesirable, use :meth:`~Control.SetLabelText` instead.

        :param string `label`: the new :class:`AutoWrapStaticText` text label;
        :param bool `wrapped`: ``True`` if this method was called by the developer using :meth:`~AutoWrapStaticText.SetLabel`,
         ``False`` if it comes from the :meth:`~AutoWrapStaticText.OnSize` event handler.

        :note: Reimplemented from :class:`wx.Control`.
        """

        if not wrapped:
            self.label = label

        wx.StaticText.SetLabel(self, label) 
开发者ID:chriskiehl,项目名称:Gooey,代码行数:22,代码来源:wrapped_static_text.py

示例4: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Control [as 别名]
def initialize(self):
        self.device.close('window', self.name)
        device = self.device
        self.Show()
        if device.is_root():
            for attr in dir(self):
                value = getattr(self, attr)
                if isinstance(value, wx.Control):
                    value.Enable(False)
            dlg = wx.MessageDialog(None, _("You do not have a selected device."),
                                   _("No Device Selected."), wx.OK | wx.ICON_WARNING)
            result = dlg.ShowModal()
            dlg.Destroy()
            return
        self.device.execute("Realtime Pause")
        try:
            self.checkbox_pattern_group.SetValue(self.device.interpreter.group_modulation)
        except AttributeError:
            pass 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:21,代码来源:Adjustments.py

示例5: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Control [as 别名]
def initialize(self):
        self.device.close('window', self.name)
        self.Show()

        if self.device.is_root():
            for attr in dir(self):
                value = getattr(self, attr)
                if isinstance(value, wx.Control):
                    value.Enable(False)
            dlg = wx.MessageDialog(None, _("You do not have a selected device."),
                                   _("No Device Selected."), wx.OK | wx.ICON_WARNING)
            result = dlg.ShowModal()
            dlg.Destroy()
            return

        self.device.setting(int, "buffer_max", 1500)
        self.device.setting(bool, "buffer_limit", True)
        self.device.listen('pipe;status', self.update_status)
        self.device.listen('pipe;packet_text', self.update_packet_text)
        self.device.listen('pipe;buffer', self.on_buffer_update)
        self.device.listen('pipe;usb_state', self.on_connection_state_change)
        self.device.listen('pipe;thread', self.on_control_state)
        self.checkbox_limit_buffer.SetValue(self.device.buffer_limit)
        self.spin_packet_buffer_max.SetValue(self.device.buffer_max)
        self.text_device.SetValue(self.device.device_name)
        self.text_location.SetValue(self.device.device_location) 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:28,代码来源:Controller.py

示例6: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Control [as 别名]
def initialize(self):
        self.device.close('window', self.name)
        self.Show()
        if self.device.is_root():
            for attr in dir(self):
                value = getattr(self, attr)
                if isinstance(value, wx.Control):
                    value.Enable(False)
            dlg = wx.MessageDialog(None, _("You do not have a selected device."),
                                   _("No Device Selected."), wx.OK | wx.ICON_WARNING)
            result = dlg.ShowModal()
            dlg.Destroy()
            return
        pipe = self.device.interpreter.pipe
        buffer = None
        if pipe is not None:
            try:
                buffer = pipe._buffer + pipe._queue
            except AttributeError:
                buffer = None
        if buffer is None:
            buffer = _("Could not find buffer.\n")

        try:
            bufferstr = buffer.decode()
        except ValueError:
            bufferstr = buffer.decode("ascii")
        except AttributeError:
            bufferstr = buffer

        self.text_buffer_length = self.text_buffer_length.SetValue(str(len(bufferstr)))
        self.text_buffer_info = self.text_buffer_info.SetValue(bufferstr) 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:34,代码来源:BufferView.py

示例7: camera_error_requirement

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Control [as 别名]
def camera_error_requirement(self):
        try:
            for attr in dir(self):
                value = getattr(self, attr)
                if isinstance(value, wx.Control):
                    value.Enable(False)
            dlg = wx.MessageDialog(None, _(
                "If using a precompiled binary, this was requirement was not included.\nIf using pure Python, add it with: pip install opencv-python-headless"),
                                   _("Interface Requires OpenCV."), wx.OK | wx.ICON_ERROR)
            dlg.ShowModal()
            dlg.Destroy()
        except RuntimeError:
            pass 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:15,代码来源:CameraInteface.py

示例8: camera_error_webcam

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Control [as 别名]
def camera_error_webcam(self):
        try:
            for attr in dir(self):
                value = getattr(self, attr)
                if isinstance(value, wx.Control):
                    value.Enable(False)
            dlg = wx.MessageDialog(None, _("No Webcam found."),
                                   _("Error"), wx.OK | wx.ICON_ERROR)
            dlg.ShowModal()
            dlg.Destroy()
        except RuntimeError:
            pass 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:14,代码来源:CameraInteface.py

示例9: camera_success

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Control [as 别名]
def camera_success(self):
        try:
            for attr in dir(self):
                value = getattr(self, attr)
                if isinstance(value, wx.Control):
                    value.Enable(True)
        except RuntimeError:
            pass 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:10,代码来源:CameraInteface.py

示例10: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Control [as 别名]
def initialize(self):
        self.device.close('window', self.name)
        self.Show()
        if self.device.is_root():
            for attr in dir(self):
                value = getattr(self, attr)
                if isinstance(value, wx.Control):
                    value.Enable(False)
            dlg = wx.MessageDialog(None, _("You do not have a selected device."),
                                   _("No Device Selected."), wx.OK | wx.ICON_WARNING)
            result = dlg.ShowModal()
            dlg.Destroy()
            return
        self.device.listen('spooler;queue', self.on_spooler_update)
        self.refresh_spooler_list() 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:17,代码来源:JobSpooler.py

示例11: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Control [as 别名]
def initialize(self):
        self.device.close('module', self.name)
        self.Show()
        self.operations = []
        self.device.setting(bool, "rotary", False)
        self.device.setting(float, "scale_x", 1.0)
        self.device.setting(float, "scale_y", 1.0)
        self.device.setting(bool, "prehome", False)
        self.device.setting(bool, "autohome", False)
        self.device.setting(bool, "autobeep", True)
        self.device.setting(bool, "autostart", True)
        self.device.listen('element_property_update', self.on_element_property_update)

        if self.device.is_root():
            for attr in dir(self):
                value = getattr(self, attr)
                if isinstance(value, wx.Control):
                    value.Enable(False)
            dlg = wx.MessageDialog(None, _("You do not have a selected device."),
                                   _("No Device Selected."), wx.OK | wx.ICON_WARNING)
            result = dlg.ShowModal()
            dlg.Destroy()
            return
        self.menu_prehome.Check(self.device.prehome)
        self.menu_autohome.Check(self.device.autohome)
        self.menu_autobeep.Check(self.device.autobeep)
        self.menu_autostart.Check(self.device.autostart) 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:29,代码来源:JobInfo.py

示例12: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Control [as 别名]
def initialize(self):
        self.device.close('window', self.name)
        self.Show()
        if self.device.is_root():
            for attr in dir(self):
                value = getattr(self, attr)
                if isinstance(value, wx.Control):
                    value.Enable(False)
            dlg = wx.MessageDialog(None, _("You do not have a selected device."),
                                   _("No Device Selected."), wx.OK | wx.ICON_WARNING)
            result = dlg.ShowModal()
            dlg.Destroy() 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:14,代码来源:Alignment.py


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