def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.SP_3D | wx.SP_LIVE_UPDATE, name='Crust Window', rootObject=None, rootLabel=None, rootIsNamespace=True, intro='', locals=None, InterpClass=None, startupScript=None, execStartupScript=True, *args, **kwds): """Create Crust instance.""" wx.SplitterWindow.__init__(self, parent, id, pos, size, style, name) self.shell = Shell(parent=self, introText=intro, locals=locals, InterpClass=InterpClass, startupScript=startupScript, execStartupScript=execStartupScript, *args, **kwds) self.editor = self.shell if rootObject is None: rootObject = self.shell.interp.locals self.notebook = wx.Notebook(parent=self, id=-1) self.shell.interp.locals['notebook'] = self.notebook self.filling = Filling(parent=self.notebook, rootObject=rootObject, rootLabel=rootLabel, rootIsNamespace=rootIsNamespace) # Add 'filling' to the interpreter's locals. self.shell.interp.locals['filling'] = self.filling self.notebook.AddPage(page=self.filling, text='Namespace', select=True) self.display = Display(parent=self.notebook) self.notebook.AddPage(page=self.display, text='Display') # Add 'pp' (pretty print) to the interpreter's locals. self.shell.interp.locals['pp'] = self.display.setItem self.display.nbTab = self.notebook.GetPageCount() - 1 self.calltip = Calltip(parent=self.notebook) self.notebook.AddPage(page=self.calltip, text='Calltip') self.sessionlisting = SessionListing(parent=self.notebook) self.notebook.AddPage(page=self.sessionlisting, text='History') self.dispatcherlisting = DispatcherListing(parent=self.notebook) self.notebook.AddPage(page=self.dispatcherlisting, text='Dispatcher') self.SplitHorizontally(self.shell, self.notebook, -self.sashoffset) self.SetMinimumPaneSize(100) self.Bind(wx.EVT_SIZE, self.SplitterOnSize) self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.OnChanged)
def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.SP_3D|wx.SP_LIVE_UPDATE, name='Crust Window', rootObject=None, rootLabel=None, rootIsNamespace=True, intro='', locals=None, InterpClass=None, startupScript=None, execStartupScript=True, *args, **kwds): """Create Crust instance.""" wx.SplitterWindow.__init__(self, parent, id, pos, size, style, name) # Turn off the tab-traversal style that is automatically # turned on by wx.SplitterWindow. We do this because on # Windows the event for Ctrl-Enter is stolen and used as a # navigation key, but the Shell window uses it to insert lines. style = self.GetWindowStyle() self.SetWindowStyle(style & ~wx.TAB_TRAVERSAL) self.shell = Shell(parent=self, introText=intro, locals=locals, InterpClass=InterpClass, startupScript=startupScript, execStartupScript=execStartupScript, *args, **kwds) self.editor = self.shell if rootObject is None: rootObject = self.shell.interp.locals self.notebook = wx.Notebook(parent=self, id=-1) self.shell.interp.locals['notebook'] = self.notebook self.filling = Filling(parent=self.notebook, rootObject=rootObject, rootLabel=rootLabel, rootIsNamespace=rootIsNamespace) # Add 'filling' to the interpreter's locals. self.shell.interp.locals['filling'] = self.filling self.notebook.AddPage(page=self.filling, text='Namespace', select=True) self.display = Display(parent=self.notebook) self.notebook.AddPage(page=self.display, text='Display') # Add 'pp' (pretty print) to the interpreter's locals. self.shell.interp.locals['pp'] = self.display.setItem self.display.nbTab = self.notebook.GetPageCount()-1 self.calltip = Calltip(parent=self.notebook) self.notebook.AddPage(page=self.calltip, text='Calltip') self.sessionlisting = SessionListing(parent=self.notebook) self.notebook.AddPage(page=self.sessionlisting, text='History') self.dispatcherlisting = DispatcherListing(parent=self.notebook) self.notebook.AddPage(page=self.dispatcherlisting, text='Dispatcher') self.SplitHorizontally(self.shell, self.notebook, -self.sashoffset) self.SetMinimumPaneSize(100) self.Bind(wx.EVT_SIZE, self.SplitterOnSize) self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.OnChanged)
def __init__(self, parent, id=-1, pos=wxDefaultPosition, \ size=wxDefaultSize, style=wxSP_3D, name='Crust Window', \ rootObject=None, rootLabel=None, rootIsNamespace=1, \ intro='', locals=None, \ InterpClass=None, *args, **kwds): """Create a PyCrust Crust instance.""" wxSplitterWindow.__init__(self, parent, id, pos, size, style, name) self.shell = Shell(parent=self, introText=intro, \ locals=locals, InterpClass=InterpClass, \ *args, **kwds) self.filling = Filling(parent=self, \ rootObject=self.shell.interp.locals, \ rootLabel=rootLabel, rootIsNamespace=1) """Add 'filling' to the interpreter's locals.""" self.shell.interp.locals['filling'] = self.filling self.SplitHorizontally(self.shell, self.filling, 300) self.SetMinimumPaneSize(1)
def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.SP_3D | wx.SP_LIVE_UPDATE, name='Crust Window', rootObject=None, rootLabel=None, rootIsNamespace=True, intro='', locals=None, InterpClass=None, startupScript=None, execStartupScript=True, *args, **kwds): """Create Crust instance.""" wx.SplitterWindow.__init__(self, parent, id, pos, size, style, name) # Turn off the tab-traversal style that is automatically # turned on by wx.SplitterWindow. We do this because on # Windows the event for Ctrl-Enter is stolen and used as a # navigation key, but the Shell window uses it to insert lines. style = self.GetWindowStyle() self.SetWindowStyle(style & ~wx.TAB_TRAVERSAL) self.autoDiscover = False self.discover = None self.discover_timer = None self.shell = Shell(parent=self, introText=intro, locals=locals, InterpClass=InterpClass, startupScript=startupScript, execStartupScript=execStartupScript, *args, **kwds) self.editor = self.shell if rootObject is None: rootObject = self.shell.interp.lua_locals self.notebook = wx.Notebook(parent=self, id=-1) self.shell.interp.locals['notebook'] = self.notebook self.filling = Filling(parent=self.notebook, rootObject=rootObject, rootLabel="env", rootIsNamespace=rootIsNamespace) # Add 'filling' to the interpreter's locals. self.shell.interp.locals['filling'] = self.filling self.notebook.AddPage(page=self.filling, text='Namespace', select=True) self.display = Display(parent=self.notebook) self.notebook.AddPage(page=self.display, text='Prompt') # Add 'pp' (pretty print) to the interpreter's locals. self.shell.interp.locals['pp'] = self.display.setItem self.display.nbTab = self.notebook.GetPageCount() - 1 self.helptip = Helptip(parent=self.notebook) self.notebook.AddPage(page=self.helptip, text='Help') self.sessionlisting = SessionListing(parent=self.notebook) self.notebook.AddPage(page=self.sessionlisting, text='History') # Initialize in an unsplit mode, and check later after loading # settings if we should split or not. self.shell.Hide() self.notebook.Hide() self.Initialize(self.shell) self._shouldsplit = True wx.CallAfter(self._CheckShouldSplit) self.SetMinimumPaneSize(100) self.Bind(wx.EVT_SIZE, self.SplitterOnSize) self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.OnChanged) self.Bind(wx.EVT_SPLITTER_DCLICK, self.OnSashDClick) self.Bind(wx.EVT_TIMER, self.OnTimer) dispatcher.connect(receiver=self.connect_change, signal='Interpreter.connection')
def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.SP_3D, name='Crust Window', rootObject=None, rootLabel=None, rootIsNamespace=True, intro='', locals=None, InterpClass=None, *args, **kwds): """Create Crust instance.""" wx.SplitterWindow.__init__(self, parent, id, pos, size, style, name) self.shell = Shell(parent=self, introText=intro, locals=locals, InterpClass=InterpClass, *args, **kwds) self.editor = self.shell if rootObject is None: rootObject = self.shell.interp.locals self.notebook = wx.Notebook(parent=self, id=-1) self.shell.interp.locals['notebook'] = self.notebook self.filling = Filling(parent=self.notebook, rootObject=rootObject, rootLabel=rootLabel, rootIsNamespace=rootIsNamespace) # Add 'filling' to the interpreter's locals. self.shell.interp.locals['filling'] = self.filling self.notebook.AddPage(page=self.filling, text='Namespace', select=True) self.display = Display(parent=self.notebook) self.notebook.AddPage(page=self.display, text='Display') # Add 'pp' (pretty print) to the interpreter's locals. self.shell.interp.locals['pp'] = self.display.setItem self.calltip = Calltip(parent=self.notebook) self.notebook.AddPage(page=self.calltip, text='Calltip') self.sessionlisting = SessionListing(parent=self.notebook) self.notebook.AddPage(page=self.sessionlisting, text='Session') self.dispatcherlisting = DispatcherListing(parent=self.notebook) self.notebook.AddPage(page=self.dispatcherlisting, text='Dispatcher') ## from wxd import wx_ ## self.wxdocs = Filling(parent=self.notebook, ## rootObject=wx_, ## rootLabel='wx', ## rootIsNamespace=False, ## static=True) ## self.notebook.AddPage(page=self.wxdocs, text='wxPython Docs') ## from wxd import stc_ ## self.stcdocs = Filling(parent=self.notebook, ## rootObject=stc_.StyledTextCtrl, ## rootLabel='StyledTextCtrl', ## rootIsNamespace=False, ## static=True) ## self.notebook.AddPage(page=self.stcdocs, text='StyledTextCtrl Docs') self.SplitHorizontally(self.shell, self.notebook, 300) self.SetMinimumPaneSize(1)