Beispiel #1
0
    def __init__(self, parent, env, path=""):
        StyledTextCtrl.__init__(self, parent, env)
        wx.FileDropTarget.__init__(self)
        self.SetDropTarget(self)

        self.path = path
        self.file_encoding = "utf-8"
        self.modified_externally = False
        self.static_title = None

        self.sig_title_changed = Signal(self)
        self.sig_status_changed = Signal(self)

        self.SetTabIndents(True)
        self.SetBackSpaceUnIndents(True)
        self.SetViewWhiteSpace(wx.stc.STC_WS_VISIBLEALWAYS)
        self.SetWhitespaceForeground(True, "#dddddd")
        self.SetEdgeMode(wx.stc.STC_EDGE_LINE)
        self.SetEdgeColumn(80)
        self.SetEdgeColour("#dddddd")

        self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
        self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
        self.Bind(wx.stc.EVT_STC_SAVEPOINTLEFT, self.OnSavePointLeft)
        self.Bind(wx.stc.EVT_STC_SAVEPOINTREACHED, self.OnSavePointReached)
        self.Bind(wx.stc.EVT_STC_UPDATEUI, self.OnStcUpdateUI)
Beispiel #2
0
    def __init__(self, parent, env, auto_scroll=False):
        StyledTextCtrl.__init__(self, parent, env)

        self.auto_scroll = auto_scroll

        self.__lock = threading.Lock()
        self.__queue = []
        self.__timer = wx.Timer(self)

        self.Bind(wx.EVT_TIMER, self.__OnTimer, self.__timer)