TextViewer.py
changeset 675 0ea836add01f
parent 671 47b9ad1471cc
child 684 f10449b18dbe
equal deleted inserted replaced
674:bbffe4110141 675:0ea836add01f
   241         self.Editor.SetStyling(length, style)
   241         self.Editor.SetStyling(length, style)
   242     
   242     
   243     def GetCurrentPos(self):
   243     def GetCurrentPos(self):
   244         return self.Editor.GetCurrentPos()
   244         return self.Editor.GetCurrentPos()
   245     
   245     
       
   246     def GetState(self):
       
   247         return {"cursor_pos": self.Editor.GetCurrentPos()}
       
   248     
       
   249     def SetState(self, state):
       
   250         self.Editor.GotoPos(state["cursor_pos"])
       
   251         
   246     def OnModification(self, event):
   252     def OnModification(self, event):
   247         if not self.DisableEvents:
   253         if not self.DisableEvents:
   248             mod_type = event.GetModificationType()
   254             mod_type = event.GetModificationType()
   249             if mod_type&wx.stc.STC_MOD_BEFOREINSERT:
   255             if mod_type&wx.stc.STC_MOD_BEFOREINSERT:
   250                 if self.CurrentAction == None:
   256                 if self.CurrentAction == None: