當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.WANTS_CHARS屬性代碼示例

本文整理匯總了Python中wx.WANTS_CHARS屬性的典型用法代碼示例。如果您正苦於以下問題:Python wx.WANTS_CHARS屬性的具體用法?Python wx.WANTS_CHARS怎麽用?Python wx.WANTS_CHARS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在wx的用法示例。


在下文中一共展示了wx.WANTS_CHARS屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import WANTS_CHARS [as 別名]
def __init__(self, parent, id):
        wx.Panel.__init__(
            self, parent, id,
            # wxMSW/Windows does not seem to support
            # wx.NO_BORDER, which sucks
            style = wx.WANTS_CHARS | wx.NO_BORDER)

        hsizer = wx.BoxSizer(wx.HORIZONTAL)

        self.scrollBar = wx.ScrollBar(self, -1, style = wx.SB_VERTICAL)
        self.ctrl = MyCtrl(self, -1)

        hsizer.Add(self.ctrl, 1, wx.EXPAND)
        hsizer.Add(self.scrollBar, 0, wx.EXPAND)

        wx.EVT_COMMAND_SCROLL(self, self.scrollBar.GetId(),
                              self.ctrl.OnScroll)

        wx.EVT_SET_FOCUS(self.scrollBar, self.OnScrollbarFocus)

        self.SetSizer(hsizer)

    # we never want the scrollbar to get the keyboard focus, pass it on to
    # the main widget 
開發者ID:trelby,項目名稱:trelby,代碼行數:26,代碼來源:trelby.py

示例2: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import WANTS_CHARS [as 別名]
def __init__(self, parent, nodelist):
        Grid.__init__(self, parent, style=wx.WANTS_CHARS)

        self.CreateGrid( 0, 2, wx.grid.Grid.SelectRows)
        self.SetColLabelValue(0, _("Host"))
        self.SetColLabelValue(1, _("Port"))

        self.SetColRenderer(1, wx.grid.GridCellNumberRenderer())
        self.SetColEditor(1, wx.grid.GridCellNumberEditor(0, 65535))

        self.SetColLabelSize(self.GetTextExtent("l")[1]+4)
        self.SetRowLabelSize(1)
        self.SetSize((1000,1000))

        self.storing = False
        self.Bind(wx.grid.EVT_GRID_CMD_CELL_CHANGE, self.store_value)

        self.append_node(('router.bittorrent.com', '65536'))

        for i, e in enumerate(nodelist.split(',')):
            host, port = e.split(':')
            self.append_node((host,port))

        self.append_node(('','')) 
開發者ID:kenorb-contrib,項目名稱:BitTorrent,代碼行數:26,代碼來源:MakeTorrent.py

示例3: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import WANTS_CHARS [as 別名]
def __init__(self, parent, owner, items=None):
        style = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.WANTS_CHARS
        wx.Dialog.__init__(self, parent, -1, _("Menu editor"), style=style)

        self.create_gui()
        self.bind_event_handlers()
        self._set_tooltips()
        self.owner = owner

        import re
        self.handler_re = self.name_re = re.compile(r'^[a-zA-Z_]+[\w-]*(\[\w*\])*$')

        self.selected_index = -1  # index of the selected element in the wx.ListCtrl menu_items
        self._ignore_events = False

        if items:
            self.add_items(items)
            self._select_item(0)
        else:
            self._enable_fields(False) 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:22,代碼來源:menubar.py

示例4: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import WANTS_CHARS [as 別名]
def __init__(self, parent, owner, items=None):
        style = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.WANTS_CHARS
        wx.Dialog.__init__(self, parent, -1, _("Toolbar editor"), style=style)

        self.create_gui()
        self.bind_event_handlers()
        self._set_tooltips()
        self.owner = owner

        self.handler_re = self.name_re = re.compile(r'^[a-zA-Z_]+[\w-]*(\[\w*\])*$')

        self.selected_index = -1  # index of the selected element in the wx.ListCtrl menu_items
        self._ignore_events = False

        if items:
            self.add_items(items)
            self._select_item(0)
        else:
            self._enable_fields(False) 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:21,代碼來源:toolbar.py

示例5: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import WANTS_CHARS [as 別名]
def __init__(self, parent, text, title, validateFunc = None):
        wx.Dialog.__init__(self, parent, -1, title,
                           style = wx.DEFAULT_DIALOG_STYLE | wx.WANTS_CHARS)

        # function to call to validate the input string on OK. can be
        # None, in which case it is not called. if it returns "", the
        # input is valid, otherwise the string it returns is displayed in
        # a message box and the dialog is not closed.
        self.validateFunc = validateFunc

        vsizer = wx.BoxSizer(wx.VERTICAL)

        vsizer.Add(wx.StaticText(self, -1, text), 1, wx.EXPAND | wx.BOTTOM, 5)

        self.tc = wx.TextCtrl(self, -1, style = wx.TE_PROCESS_ENTER)
        vsizer.Add(self.tc, 1, wx.EXPAND);

        vsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        hsizer = wx.BoxSizer(wx.HORIZONTAL)

        cancelBtn = gutil.createStockButton(self, "Cancel")
        hsizer.Add(cancelBtn)

        okBtn = gutil.createStockButton(self, "OK")
        hsizer.Add(okBtn, 0, wx.LEFT, 10)

        vsizer.Add(hsizer, 0, wx.EXPAND | wx.TOP, 5)

        util.finishWindow(self, vsizer)

        wx.EVT_BUTTON(self, cancelBtn.GetId(), self.OnCancel)
        wx.EVT_BUTTON(self, okBtn.GetId(), self.OnOK)

        wx.EVT_TEXT_ENTER(self, self.tc.GetId(), self.OnOK)

        wx.EVT_CHAR(self.tc, self.OnCharEntry)
        wx.EVT_CHAR(cancelBtn, self.OnCharButton)
        wx.EVT_CHAR(okBtn, self.OnCharButton)

        self.tc.SetFocus() 
開發者ID:trelby,項目名稱:trelby,代碼行數:43,代碼來源:misc.py

示例6: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import WANTS_CHARS [as 別名]
def __init__(self, torrent, parent, *a, **k):
        self.torrent = torrent
        k['style'] = k.get('style', wx.DEFAULT_FRAME_STYLE) | wx.WANTS_CHARS
        BTFrameWithSizer.__init__(self, parent, *a, **k)
        self.Bind(wx.EVT_CLOSE, self.close)
        self.Bind(wx.EVT_CHAR, self.key)
        self.panel.BindChildren(wx.EVT_CHAR, self.key)
        if sys.platform == 'darwin':
            self.sizer.AddSpacer((0, 14))
        self.sizer.Layout()
        self.Fit()
        self.SetMinSize(self.GetSize()) 
開發者ID:kenorb-contrib,項目名稱:BitTorrent,代碼行數:14,代碼來源:DownloadManager.py

示例7: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import WANTS_CHARS [as 別名]
def __init__(self, main_window, config, setfunc):
        BTDialog.__init__(self, main_window, style=wx.DEFAULT_DIALOG_STYLE|wx.CLIP_CHILDREN|wx.WANTS_CHARS)
        self.Bind(wx.EVT_CLOSE, self.close)
        self.Bind(wx.EVT_CHAR, self.key)
        self.SetTitle(_("%s Settings")%app_name)

        self.setfunc = setfunc
        self.config = config

        self.notebook = wx.Notebook(self)

        self.notebook.Bind(wx.EVT_CHAR, self.key)

        self.general_panel    =    GeneralSettingsPanel(self.notebook)
        self.saving_panel     =     SavingSettingsPanel(self.notebook)
        self.network_panel    =    NetworkSettingsPanel(self.notebook)
        self.appearance_panel = AppearanceSettingsPanel(self.notebook)
        self.language_panel   =   LanguageSettingsPanel(self.notebook)

        self.vbox = VSizer()
        self.vbox.AddFirst(self.notebook, proportion=1, flag=wx.GROW)

        self.vbox.Layout()

        self.SetSizerAndFit(self.vbox)
        self.SetFocus() 
開發者ID:kenorb-contrib,項目名稱:BitTorrent,代碼行數:28,代碼來源:SettingsWindow.py

示例8: _MakeDateEditor

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import WANTS_CHARS [as 別名]
def _MakeDateEditor(olv, rowIndex, subItemIndex):
        dte =  DateEditor(olv, style=wx.DP_DROPDOWN | wx.DP_SHOWCENTURY | wx.WANTS_CHARS)
        #dte.SetValidator(MyValidator(olv))
        return dte 
開發者ID:JackonYang,項目名稱:bookhub,代碼行數:6,代碼來源:CellEditor.py

示例9: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import WANTS_CHARS [as 別名]
def __init__(self, parent, appstyle, clientpanel):
        """Constructor. Create a smartcard and reader tree control on the
        left-hand side of the application main frame.
        @param parent: the tree panel parent
        @param appstyle: a combination of the following styles (bitwise or |)
          - TR_SMARTCARD: display a smartcard tree panel
          - TR_READER: display a reader tree panel
          - default is TR_DEFAULT = TR_SMARTCARD
        @param clientpanel: the client panel to notify of smartcard and reader events
        """
        wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS)

        sizer = wx.BoxSizer(wx.VERTICAL)

        # create the smartcard tree
        if appstyle & smartcard.wx.SimpleSCardApp.TR_SMARTCARD:
            self.cardtreectrl = CardTreeCtrl(self, clientpanel=clientpanel)

            # create the smartcard insertion observer
            self.cardtreecardobserver = self._CardObserver(self.cardtreectrl)

            # register as a CardObserver; we will ge
            # notified of added/removed cards
            self.cardmonitor = CardMonitor()
            self.cardmonitor.addObserver(self.cardtreecardobserver)

            sizer.Add(
                self.cardtreectrl, flag=wx.EXPAND | wx.ALL, proportion=1)

        # create the reader tree
        if appstyle & smartcard.wx.SimpleSCardApp.TR_READER:
            self.readertreectrl = ReaderTreeCtrl(
                                        self, clientpanel=clientpanel)

            # create the reader insertion observer
            self.readertreereaderobserver = self._ReaderObserver(
                                                    self.readertreectrl)

            # register as a ReaderObserver; we will ge
            # notified of added/removed readers
            self.readermonitor = ReaderMonitor()
            self.readermonitor.addObserver(self.readertreereaderobserver)

            # create the smartcard insertion observer
            self.readertreecardobserver = self._CardObserver(
                                                self.readertreectrl)

            # register as a CardObserver; we will get
            # notified of added/removed cards
            self.cardmonitor = CardMonitor()
            self.cardmonitor.addObserver(self.readertreecardobserver)

            sizer.Add(
                self.readertreectrl, flag=wx.EXPAND | wx.ALL, proportion=1)

        self.SetSizer(sizer)
        self.SetAutoLayout(True) 
開發者ID:LudovicRousseau,項目名稱:pyscard,代碼行數:59,代碼來源:CardAndReaderTreePanel.py

示例10: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import WANTS_CHARS [as 別名]
def __init__(self, url, icon, title, size):
        self.browser = None

        # Must ignore X11 errors like 'BadWindow' and others by
        # installing X11 error handlers. This must be done after
        # wx was intialized.
        if LINUX:
            cef.WindowUtils.InstallX11ErrorHandlers()

        global g_count_windows
        g_count_windows += 1

        if WINDOWS:
            # noinspection PyUnresolvedReferences, PyArgumentList
            logging.debug("[wxpython.py] System DPI settings: %s"
                          % str(cef.DpiAware.GetSystemDpi()))
        if hasattr(wx, "GetDisplayPPI"):
            logging.debug("[wxpython.py] wx.GetDisplayPPI = %s" % wx.GetDisplayPPI())
        logging.debug("[wxpython.py] wx.GetDisplaySize = %s" % wx.GetDisplaySize())

        logging.debug("[wxpython.py] MainFrame DPI scaled size: %s" % str(size))

        wx.Frame.__init__(self, parent=None, id=wx.ID_ANY,
                          title=title)
        # wxPython will set a smaller size when it is bigger
        # than desktop size.
        logging.debug("[wxpython.py] MainFrame actual size: %s" % self.GetSize())

        ic = wx.Icon(icon, wx.BITMAP_TYPE_ICO)
        self.SetIcon(ic)

        self.Bind(wx.EVT_CLOSE, self.OnClose)

        # Set wx.WANTS_CHARS style for the keyboard to work.
        # This style also needs to be set for all parent controls.
        self.browser_panel = wx.Panel(self, size=tuple(size))
        self.browser_panel.Bind(wx.EVT_SIZE, self.OnSize)
        wx.Window.Fit(self)

        if MAC:
            # Make the content view for the window have a layer.
            # This will make all sub-views have layers. This is
            # necessary to ensure correct layer ordering of all
            # child views and their layers. This fixes Window
            # glitchiness during initial loading on Mac (Issue #371).
            NSApp.windows()[0].contentView().setWantsLayer_(True)

        if LINUX:
            self.Show()
            self.embed_browser(url)
        else:
            self.embed_browser(url)
            self.Show() 
開發者ID:RimoChan,項目名稱:Librian,代碼行數:55,代碼來源:wxcef.py


注:本文中的wx.WANTS_CHARS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。