コード例 #1
0
ファイル: larchframe.py プロジェクト: NEWille/xraylarch
    def __init__(self,  parent=None, _larch=None,
                 histfile='history_larchgui.lar',
                 exit_on_close=False, **kwds):

        self.histfile = histfile
        self.BuildFrame(parent=parent, **kwds)
        self.larchshell = LarchWxShell(wxparent=self,
                                       _larch = _larch,
                                       prompt = self.prompt,
                                       output = self.output,
                                       input  = self.input)
        self.datapanel.SetRootObject(self.larchshell.symtable)
        if exit_on_close:
            self.Bind(wx.EVT_CLOSE,  self.onExit)
        else:
            self.Bind(wx.EVT_CLOSE,  self.onClose)
        # self.timer.Start(200)
        larchdir = larch.site_config.larchdir
        fico = os.path.join(larchdir, 'icons', ICON_FILE)
        if os.path.exists(fico):
            self.SetIcon(wx.Icon(fico, wx.BITMAP_TYPE_ICO))

        self.larchshell.write(larch.make_banner(), color='blue', bold=True)
        root = self.datapanel.tree.GetRootItem()
        self.datapanel.tree.Expand(root)
コード例 #2
0
ファイル: larchframe.py プロジェクト: atomneb/xraylarch
    def __init__(self,  parent=None, _larch=None,
                 historyfile='history_larchgui.lar', **kwds):
        self.parent = parent
        if not historyfile.startswith(larch.site_config.usr_larchdir):
            historyfile = os.path.join(larch.site_config.usr_larchdir,
                                       historyfile)

        wx.Panel.__init__(self, parent, -1, size=(750, 725))

        self.splitter = splitter = wx.SplitterWindow(self, style=wx.SP_LIVE_UPDATE)
        splitter.SetMinimumPaneSize(150)
        self.SetBackgroundColour('#E9EEE0')

        self.objtree = Filling(splitter,  rootLabel='_main')

        self.output = wx.TextCtrl(splitter, -1,  '',
                                  style=wx.TE_MULTILINE|wx.TE_RICH|wx.TE_READONLY)

        self.output.CanCopy()
        self.output.SetInsertionPointEnd()
        # self.output.SetDefaultStyle(wx.TextAttr('black', 'white', sfont))

        splitter.SplitHorizontally(self.objtree, self.output, 0.5)

        ipanel = wx.Panel(self, -1)

        self.prompt = wx.StaticText(ipanel, -1, 'Larch>', size=(65,-1),
                                    style=wx.ALIGN_CENTER|wx.ALIGN_RIGHT)

        self.input = ReadlineTextCtrl(ipanel, -1,  '', size=(525,-1),
                                      historyfile=historyfile, mode='emacs',
                                      style=wx.ALIGN_LEFT|wx.TE_PROCESS_ENTER)

        self.input.Bind(wx.EVT_TEXT_ENTER, self.onText)
        isizer = wx.BoxSizer(wx.HORIZONTAL)
        isizer.Add(self.prompt,  0, wx.BOTTOM|wx.CENTER)
        isizer.Add(self.input,   1, wx.ALIGN_LEFT|wx.ALIGN_CENTER|wx.EXPAND)

        ipanel.SetSizer(isizer)
        isizer.Fit(ipanel)

        opts = dict(flag=wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, border=2)
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(splitter,  1, **opts)
        sizer.Add(ipanel, 0, **opts)

        self.SetSizer(sizer)
        self.larchshell = LarchWxShell(wxparent=self,
                                       _larch = _larch,
                                       historyfile=historyfile,
                                       prompt = self.prompt,
                                       output = self.output,
                                       input  = self.input)

        self.objtree.SetRootObject(self.larchshell.symtable)
        self.larchshell.set_textstyle('text2')
        self.larchshell.write(larch.make_banner())
        self.larchshell.set_textstyle('text')
        root = self.objtree.tree.GetRootItem()
        self.objtree.tree.Expand(root)
コード例 #3
0
ファイル: larchframe.py プロジェクト: tacaswell/xraylarch
    def __init__(self,
                 parent=None,
                 _larch=None,
                 histfile='history_larchgui.lar',
                 with_inspection=False,
                 exit_on_close=False,
                 **kwds):
        self.with_inspection = with_inspection
        self.histfile = histfile
        self.subframes = {}
        self.last_array_sel = {}
        self.BuildFrame(parent=parent, **kwds)
        self.larchshell = LarchWxShell(wxparent=self,
                                       _larch=_larch,
                                       prompt=self.prompt,
                                       output=self.output,
                                       input=self.input)
        self.BuildMenus()

        self.objtree.SetRootObject(self.larchshell.symtable)
        if exit_on_close:
            self.Bind(wx.EVT_CLOSE, self.onExit)
        else:
            self.Bind(wx.EVT_CLOSE, self.onClose)
        # self.timer.Start(200)
        larchdir = larch.site_config.larchdir
        fico = os.path.join(larchdir, 'icons', ICON_FILE)
        if os.path.exists(fico):
            self.SetIcon(wx.Icon(fico, wx.BITMAP_TYPE_ICO))

        self.larchshell.write(larch.make_banner(), color='blue', bold=True)
        root = self.objtree.tree.GetRootItem()

        self.objtree.tree.Expand(root)
コード例 #4
0
ファイル: larchframe.py プロジェクト: NEWille/xraylarch
    def onAbout(self, event=None):
        about_msg =  """LarchGui:
        %s""" % (larch.make_banner())

        dlg = wx.MessageDialog(self, about_msg,
                               "About LarchGui", wx.OK | wx.ICON_INFORMATION)
        dlg.ShowModal()
        dlg.Destroy()
コード例 #5
0
ファイル: larchframe.py プロジェクト: atomneb/xraylarch
    def onAbout(self, event=None):
        about_msg =  """LarchGui:
        %s""" % (larch.make_banner())

        dlg = wx.MessageDialog(self, about_msg,
                               "About LarchGui", wx.OK | wx.ICON_INFORMATION)
        dlg.ShowModal()
        dlg.Destroy()
コード例 #6
0
ファイル: larchframe.py プロジェクト: maurov/xraylarch
    def __init__(self,  parent=None, _larch=None,
                 historyfile='history_larchgui.lar', **kwds):
        self.parent = parent
        if not historyfile.startswith(larch.site_config.usr_larchdir):
            historyfile = os.path.join(larch.site_config.usr_larchdir,
                                       historyfile)

        wx.Panel.__init__(self, parent, -1, size=(750, 725))

        self.splitter = splitter = wx.SplitterWindow(self, style=wx.SP_LIVE_UPDATE)
        splitter.SetMinimumPaneSize(150)
        self.SetBackgroundColour('#E9EEE0')

        self.objtree = Filling(splitter,  rootLabel='_main')

        self.output = wx.TextCtrl(splitter, -1,  '',
                                  style=wx.TE_MULTILINE|wx.TE_RICH|wx.TE_READONLY)

        self.output.CanCopy()
        self.output.SetInsertionPointEnd()
        # self.output.SetDefaultStyle(wx.TextAttr('black', 'white', sfont))

        splitter.SplitHorizontally(self.objtree, self.output, 0.5)

        ipanel = wx.Panel(self, -1)

        self.prompt = wx.StaticText(ipanel, -1, 'Larch>', size=(65,-1),
                                    style=wx.ALIGN_CENTER|wx.ALIGN_RIGHT)

        self.input = ReadlineTextCtrl(ipanel, -1,  '', size=(525,-1),
                                      historyfile=historyfile,
                                      style=wx.ALIGN_LEFT|wx.TE_PROCESS_ENTER)

        self.input.Bind(wx.EVT_TEXT_ENTER, self.onText)
        isizer = wx.BoxSizer(wx.HORIZONTAL)
        isizer.Add(self.prompt,  0, wx.BOTTOM|wx.CENTER)
        isizer.Add(self.input,   1, wx.ALIGN_LEFT|wx.ALIGN_CENTER|wx.EXPAND)

        ipanel.SetSizer(isizer)
        isizer.Fit(ipanel)

        opts = dict(flag=wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, border=2)
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(splitter,  1, **opts)
        sizer.Add(ipanel, 0, **opts)

        self.SetSizer(sizer)
        self.larchshell = LarchWxShell(wxparent=self,
                                       _larch = _larch,
                                       historyfile=historyfile,
                                       prompt = self.prompt,
                                       output = self.output,
                                       input  = self.input)

        self.objtree.SetRootObject(self.larchshell.symtable)
        self.larchshell.set_textstyle('text2')
        self.larchshell.write(larch.make_banner())
        self.larchshell.write("\n  \n")
        self.larchshell.set_textstyle('text')
        root = self.objtree.tree.GetRootItem()
        self.objtree.tree.Expand(root)