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")
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')
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)
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)
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)
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)
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)
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")
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')
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)
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')
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)
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
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)
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
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')
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)