styled text control & indentation & enter key

This is the default behaviour of stc.

You could derive the stc class somelike:

class MyStyledTextControl(wx.stc.StyledTextCtrl):

  self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
  
  def OnKeyDown(self, event):
    if event.GetKeyCode() == wx.WXK_RETURN:
      self.autoindent()

in self.autoindent, you can check the indentation of the current line.

···

On Mon, 4 Jul 2005 04:17:10 -0700 (PDT), f rom <etaoinbe@yahoo.com> wrote:

I am using a styled text control. However when I press
enter it goes to column one instead of respecting the
indentation of the previous line. How to make it do
that ?

--
Franz Steinhaeusler