Beispiel #1
0
    def UpdateFields(self):
        """Update document fields based on the currently selected
        document in the editor.
        @postcondition: encoding and lexer fields are updated
        @todo: update when readonly hooks are implemented

        """
        nb = self.GetParent().GetNotebook()
        if nb is None:
            return

        try:
            cbuff = nb.GetCurrentCtrl()
            doc = cbuff.GetDocument()
            wx.CallAfter(self.__SetStatusText, doc.GetEncoding(),
                         ed_glob.SB_ENCODING)
            wx.CallAfter(self.__SetStatusText,
                         GetFtypeDisplayName(cbuff.GetLangId()),
                         ed_glob.SB_LEXER)

    #        pstatbar.ProgressStatusBar.SetStatusText(self,
    #                                                 ,
    #                                                 ed_glob.SB_READONLY)
        except wx.PyDeadObjectError:
            # May be called asyncronasly after the control is already dead
            return
Beispiel #2
0
    def UpdateFields(self):
        """Update document fields based on the currently selected
        document in the editor.
        @postcondition: encoding and lexer fields are updated
        @todo: update when readonly hooks are implemented

        """
        nb = self.GetParent().GetNotebook()
        if nb is None:
            return

        try:
            cbuff = nb.GetCurrentCtrl()
            doc = cbuff.GetDocument()
            wx.CallAfter(self.__SetStatusText, doc.GetEncoding(),
                         ed_glob.SB_ENCODING)
            wx.CallAfter(self.__SetStatusText,
                         GetFtypeDisplayName(cbuff.GetLangId()),
                         ed_glob.SB_LEXER)

            eol = {
                wx.stc.STC_EOL_CR: u"CR",
                wx.stc.STC_EOL_LF: u"LF",
                wx.stc.STC_EOL_CRLF: u"CRLF"
            }
            wx.CallAfter(self.__SetStatusText, eol[cbuff.GetEOLMode()],
                         ed_glob.SB_EOL)

        except wx.PyDeadObjectError:
            # May be called asyncronasly after the control is already dead
            return
Beispiel #3
0
    def UpdateFields(self):
        """Update document fields based on the currently selected
        document in the editor.
        @postcondition: encoding and lexer fields are updated
        @todo: update when readonly hooks are implemented

        """
        nb = self.GetParent().GetNotebook()
        if nb is None:
            return

        cbuff = nb.GetCurrentCtrl()
        doc = cbuff.GetDocument()
        pstatbar.ProgressStatusBar.SetStatusText(self, doc.GetEncoding(),
                                                 ed_glob.SB_ENCODING)
        pstatbar.ProgressStatusBar.SetStatusText(
            self, GetFtypeDisplayName(cbuff.GetLangId()), ed_glob.SB_LEXER)
        #        pstatbar.ProgressStatusBar.SetStatusText(self,
        #                                                 ,
        #                                                 ed_glob.SB_READONLY)

        self.AdjustFieldWidths()