コード例 #1
0
    def __init__(
        self,
        parent,
        id=-1,
        pos=wx.DefaultPosition,
        size=wx.DefaultSize,
        style=wx.TR_DEFAULT_STYLE,
        rootObject=None,
        rootLabel=None,
        rootIsNamespace=False,
        static=False,
    ):
        """Create FillingTree instance."""
        wx.TreeCtrl.__init__(self, parent, id, pos, size, style)
        self.rootIsNamespace = rootIsNamespace
        import __main__

        if rootObject is None:
            rootObject = __main__.__dict__
            self.rootIsNamespace = True
        if rootObject is __main__.__dict__ and rootLabel is None:
            rootLabel = "locals()"
        if not rootLabel:
            rootLabel = "Ingredients"
        rootData = wx.TreeItemData(rootObject)
        self.item = self.root = self.AddRoot(rootLabel, -1, -1, rootData)
        self.SetItemHasChildren(self.root, self.objHasChildren(rootObject))
        wx.EVT_TREE_ITEM_EXPANDING(self, self.GetId(), self.OnItemExpanding)
        wx.EVT_TREE_ITEM_COLLAPSED(self, self.GetId(), self.OnItemCollapsed)
        wx.EVT_TREE_SEL_CHANGED(self, self.GetId(), self.OnSelChanged)
        wx.EVT_TREE_ITEM_ACTIVATED(self, self.GetId(), self.OnItemActivated)
        if not static:
            dispatcher.connect(receiver=self.push, signal="Interpreter.push")
コード例 #2
0
ファイル: filling.py プロジェクト: douzujun/priithon
 def __init__(self,
              parent,
              id=-1,
              pos=wx.DefaultPosition,
              size=wx.DefaultSize,
              style=wx.TR_DEFAULT_STYLE,
              rootObject=None,
              rootLabel=None,
              rootIsNamespace=False,
              static=False):
     """Create FillingTree instance."""
     wx.TreeCtrl.__init__(self, parent, id, pos, size, style)
     self.rootIsNamespace = rootIsNamespace
     import __main__
     if rootObject is None:
         rootObject = __main__.__dict__
         self.rootIsNamespace = True
     if rootObject is __main__.__dict__ and rootLabel is None:
         rootLabel = 'locals()'
     if not rootLabel:
         rootLabel = 'Ingredients'
     rootData = wx.TreeItemData(rootObject)
     self.item = self.root = self.AddRoot(rootLabel, -1, -1, rootData)
     self.SetItemHasChildren(self.root, self.objHasChildren(rootObject))
     wx.EVT_TREE_ITEM_EXPANDING(self, self.GetId(), self.OnItemExpanding)
     wx.EVT_TREE_ITEM_COLLAPSED(self, self.GetId(), self.OnItemCollapsed)
     wx.EVT_TREE_SEL_CHANGED(self, self.GetId(), self.OnSelChanged)
     wx.EVT_TREE_ITEM_ACTIVATED(self, self.GetId(), self.OnItemActivated)
     if not static:
         dispatcher.connect(receiver=self.push, signal='Interpreter.push')
コード例 #3
0
    def connect(self, sender, signal, slot=None):
        if slot is None:
            # TODO 2to3 

            #if type(sender) == bytes:
            if type(sender) == str:
                # provides syntactic sugar ; for
                # self.connect(self, "signal", slot)
                # it is possible to do
                # self.connect("signal", slot)
                slot = signal
                signal = sender
                sender = self
            else:
                raise ValueError("invalid slot (None)")

        signal = str(signal)
            
        dispatcher.connect(slot, signal, sender)

        self.connect_dict[sender] = {"signal": signal,
                                     "slot": slot}
 
        if hasattr(sender, "connectNotify"):
            sender.connectNotify(signal)
コード例 #4
0
    def connect(self, sender, signal, slot=None):
        if slot is None:
            # TODO 2to3 

            #if type(sender) == bytes:
            if type(sender) == str:
                # provides syntactic sugar ; for
                # self.connect(self, "signal", slot)
                # it is possible to do
                # self.connect("signal", slot)
                slot = signal
                signal = sender
                sender = self
            else:
                raise ValueError("invalid slot (None)")

        signal = str(signal)
            
        dispatcher.connect(slot, signal, sender)

        self.connect_dict[sender] = {"signal": signal,
                                     "slot": slot}
 
        if hasattr(sender, "connectNotify"):
            sender.connectNotify(signal)
コード例 #5
0
ファイル: crust.py プロジェクト: apetcho/wxPython-2
    def __init__(self, parent=None, id=-1):
        style = wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2 | wx.TE_DONTWRAP
        wx.TextCtrl.__init__(self, parent, id, style=style)
        dispatcher.connect(receiver=self.spy)

        df = self.GetFont()
        font = wx.Font(df.GetPointSize(), wx.TELETYPE, wx.NORMAL, wx.NORMAL)
        self.SetFont(font)
コード例 #6
0
ファイル: crust.py プロジェクト: Einstein-NTE/einstein
    def __init__(self, parent=None, id=-1):
        style = (wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2)
        wx.TextCtrl.__init__(self, parent, id, style=style)
        self.SetBackgroundColour(wx.Colour(255, 255, 208))
        dispatcher.connect(receiver=self.display, signal='Shell.calltip')

        df = self.GetFont()
        font = wx.Font(df.GetPointSize(), wx.TELETYPE, wx.NORMAL, wx.NORMAL)
        self.SetFont(font)
コード例 #7
0
    def __init__(self, parent=None, id=-1):
        style = (wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2)
        wx.TextCtrl.__init__(self, parent, id, style=style)
        self.SetBackgroundColour(wx.Colour(255, 255, 208))
        dispatcher.connect(receiver=self.display, signal='Shell.calltip')

        df = self.GetFont()
        font = wx.Font(df.GetPointSize(), wx.TELETYPE, wx.NORMAL, wx.NORMAL)
        self.SetFont(font)
コード例 #8
0
    def __init__(self, parent=None, id=-1):
        style = (wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2
                 | wx.TE_DONTWRAP)
        wx.TextCtrl.__init__(self, parent, id, style=style)
        dispatcher.connect(receiver=self.spy)

        df = self.GetFont()
        font = wx.Font(df.GetPointSize(), wx.TELETYPE, wx.NORMAL, wx.NORMAL)
        self.SetFont(font)
コード例 #9
0
ファイル: editor.py プロジェクト: wangdyna/wxPython
 def __init__(self, parent=None, id=-1, title='PyAlaMode',
              pos=wx.DefaultPosition, size=(800, 600), 
              style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE,
              filename=None):
     """Create EditorNotebookFrame instance."""
     self.notebook = None
     EditorFrame.__init__(self, parent, id, title, pos,
                          size, style, filename)
     if self.notebook:
         dispatcher.connect(receiver=self._editorChange,
                            signal='EditorChange', sender=self.notebook)
コード例 #10
0
 def __init__(
     self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN, static=False
 ):
     """Create FillingText instance."""
     editwindow.EditWindow.__init__(self, parent, id, pos, size, style)
     # Configure various defaults and user preferences.
     self.SetReadOnly(True)
     self.SetWrapMode(True)
     self.SetMarginWidth(1, 0)
     if not static:
         dispatcher.connect(receiver=self.push, signal="Interpreter.push")
コード例 #11
0
ファイル: editor.py プロジェクト: ktan2020/legacy-automation
 def __init__(self, parent=None, id=-1, title='PyAlaMode',
              pos=wx.DefaultPosition, size=(800, 600), 
              style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE,
              filename=None):
     """Create EditorNotebookFrame instance."""
     self.notebook = None
     EditorFrame.__init__(self, parent, id, title, pos,
                          size, style, filename)
     if self.notebook:
         dispatcher.connect(receiver=self._editorChange,
                            signal='EditorChange', sender=self.notebook)
コード例 #12
0
ファイル: crust.py プロジェクト: Einstein-NTE/einstein
 def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
              size=wx.DefaultSize,
              style=wx.CLIP_CHILDREN | wx.SUNKEN_BORDER,
              static=False):
     """Create Display instance."""
     editwindow.EditWindow.__init__(self, parent, id, pos, size, style)
     # Configure various defaults and user preferences.
     self.SetReadOnly(True)
     self.SetWrapMode(False)
     if not static:
         dispatcher.connect(receiver=self.push, signal='Interpreter.push')
コード例 #13
0
ファイル: crust.py プロジェクト: wangdyna/wxPython
 def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
              size=wx.DefaultSize,
              style=wx.CLIP_CHILDREN | wx.SUNKEN_BORDER,
              static=False):
     """Create Display instance."""
     editwindow.EditWindow.__init__(self, parent, id, pos, size, style)
     # Configure various defaults and user preferences.
     self.SetReadOnly(True)
     self.SetWrapMode(False)
     if not static:
         dispatcher.connect(receiver=self.push, signal='Interpreter.push')
コード例 #14
0
ファイル: editor.py プロジェクト: BackupTheBerlios/pulsar-svn
    def __init__(self, parent=None, id=-1, title='pyPULSAR ' \
		    +version.__PROJECT_VERSION__+" rev."+version.__PROJECT_REVISION__,
                 pos=wx.DefaultPosition, size=(800, 600), 
                 style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE,
                 filename=None):
        """Create EditorNotebookFrame instance."""
        if DEBUG : print "EditorNotebookFrame"

        self.notebook = None
        EditorFrame.__init__(self, parent, id, title, pos,
                             size, style, filename)
        if self.notebook:
            dispatcher.connect(receiver=self._editorChange,
                               signal='EditorChange', sender=self.notebook)
コード例 #15
0
 def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
              size=wx.DefaultSize, style=wx.CLIP_CHILDREN | wx.SUNKEN_BORDER):
     """Create EditWindow instance."""
     stc.StyledTextCtrl.__init__(self, parent, id, pos, size, style)
     self.__config()
     stc.EVT_STC_UPDATEUI(self, id, self.OnUpdateUI)
     dispatcher.connect(receiver=self._fontsizer, signal='FontIncrease')
     dispatcher.connect(receiver=self._fontsizer, signal='FontDecrease')
     dispatcher.connect(receiver=self._fontsizer, signal='FontDefault')
コード例 #16
0
ファイル: crust.py プロジェクト: apetcho/wxPython-2
    def __init__(self, parent=None, id=-1, ShellClassName="Shell"):
        style = wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2 | wx.TE_DONTWRAP
        wx.TextCtrl.__init__(self, parent, id, style=style)
        dispatcher.connect(receiver=self.addHistory, signal=ShellClassName + ".addHistory")
        dispatcher.connect(receiver=self.clearHistory, signal=ShellClassName + ".clearHistory")
        dispatcher.connect(receiver=self.loadHistory, signal=ShellClassName + ".loadHistory")

        df = self.GetFont()
        font = wx.Font(df.GetPointSize(), wx.TELETYPE, wx.NORMAL, wx.NORMAL)
        self.SetFont(font)
コード例 #17
0
ファイル: editwindow.py プロジェクト: LLNL/WVL
    def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
                 size=wx.DefaultSize, style=wx.CLIP_CHILDREN | wx.SUNKEN_BORDER):
        """Create EditWindow instance."""
        stc.StyledTextCtrl.__init__(self, parent, id, pos, size, style)
        self.__config()
        stc.EVT_STC_UPDATEUI(self, id, self.OnUpdateUI)
        dispatcher.connect(receiver=self._fontsizer, signal='FontIncrease')
        dispatcher.connect(receiver=self._fontsizer, signal='FontDecrease')
        dispatcher.connect(receiver=self._fontsizer, signal='FontDefault')

        #seb:    http://wiki.wxpython.org/index.cgi/StyledTextCtrl_Log_Window_Demo
        self._styles = [None]*32
        self._free = 1
コード例 #18
0
    def __init__(self, parent=None, id=-1, ShellClassName='Shell'):
        style = (wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2
                 | wx.TE_DONTWRAP)
        wx.TextCtrl.__init__(self, parent, id, style=style)
        dispatcher.connect(receiver=self.addHistory,
                           signal=ShellClassName + ".addHistory")
        dispatcher.connect(receiver=self.clearHistory,
                           signal=ShellClassName + ".clearHistory")
        dispatcher.connect(receiver=self.loadHistory,
                           signal=ShellClassName + ".loadHistory")

        df = self.GetFont()
        font = wx.Font(df.GetPointSize(), wx.TELETYPE, wx.NORMAL, wx.NORMAL)
        self.SetFont(font)
コード例 #19
0
    def __init__(self,
                 parent,
                 id=-1,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=wx.CLIP_CHILDREN | wx.SUNKEN_BORDER):
        """Create EditWindow instance."""
        stc.StyledTextCtrl.__init__(self, parent, id, pos, size, style)
        self.__config()
        stc.EVT_STC_UPDATEUI(self, id, self.OnUpdateUI)
        dispatcher.connect(receiver=self._fontsizer, signal='FontIncrease')
        dispatcher.connect(receiver=self._fontsizer, signal='FontDecrease')
        dispatcher.connect(receiver=self._fontsizer, signal='FontDefault')

        #seb:    http://wiki.wxpython.org/index.cgi/StyledTextCtrl_Log_Window_Demo
        self._styles = [None] * 32
        self._free = 1
コード例 #20
0
ファイル: crust.py プロジェクト: douzujun/priithon
 def __init__(self, parent=None, id=-1):
     style = (wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2)
     wx.TextCtrl.__init__(self, parent, id, style=style)
     self.SetBackgroundColour(wx.Colour(255, 255, 232))
     dispatcher.connect(receiver=self.display, signal='Shell.calltip')
コード例 #21
0
ファイル: crust.py プロジェクト: douzujun/priithon
 def __init__(self, parent=None, id=-1):
     style = (wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2
              | wx.TE_DONTWRAP)
     wx.TextCtrl.__init__(self, parent, id, style=style)
     dispatcher.connect(receiver=self.spy)
コード例 #22
0
 def __init__(self, parent=None, id=-1):
     style = (wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2)
     wx.TextCtrl.__init__(self, parent, id, style=style)
     self.SetBackgroundColour(wx.Colour(255, 255, 232))
     dispatcher.connect(receiver=self.display, signal='Shell.calltip')
コード例 #23
0
 def __init__(self, parent=None, id=-1):
     style = (wx.TE_MULTILINE | wx.TE_READONLY |
              wx.TE_RICH2 | wx.TE_DONTWRAP)
     wx.TextCtrl.__init__(self, parent, id, style=style)
     dispatcher.connect(receiver=self.spy)