Hello!
Before diving into wxPython and [wxStyledTextCtrl or wxTextCtrl],
I wanted to clarify a few doubts:
1. In the documentation for wxPython.stc from
http://www.pyframe.com/wxdocs/stc/index.html
I did not find documentation of any way to completely over-ride the
key assignments of the wxStyledTextCtrl object. There is
a CmdKeyAssign() function provided, but the configurability is
severley limited as far as I can see. To be clearer, the syntax is:
CmdKeyAssign(key, modifiers, command)
and the command is from a selected list of commands which
wxStyledTextCtrl provides, like wxSTC_CMD_BACKTAB etc. But to emulate
something like the vi editor (which I would eventually like to do),
I would like to process all the key-presses via a custom function and
issue the wxSTC_CMD_XXX commands from within that function
programmatically. Simply assigning keys to other commands is not
enough because the vi editor maintains state information. The 'i' key
means different things at different times to give an example.
To summarize:
Is there a way to have the command argument in the function above
be a python function instead of wxSTC_CMD_XXX?
I had a very brief look at QT's QMultiLineEdit widget and in that,
the way to do was simple. Just inherit from QMultiLineEdit and then
over-ride the keyPressEvent() member. I would love it if STC provided
a similar mechanism...
If STC is unable to do this, does wxTextCtrl have any facility like
this? Again I didn't find any mention of it in the wxWindows
documentation...
2. STC seems to provide some default Lexers for syntax coloring. Is it
possible to define completely new syntax coloring schemes, even at
runtime?
Thanks,
Srinath