This sounds really useful. It would be even more so if it
could be written as a Mixin class for wx.stc.
That way anyone needing Snippets can mix it into their stc
class.
If more of the excellent functionality of the excellent
wxPython editors out there would be turned into mixins life
would be great !
Especially since then I could just borrow the mixins for
GNUmed
Maybe wxSnip could be the first one ?
Karsten
路路路
On Tue, May 08, 2007 at 11:04:46PM +0200, kib2 wrote:
Hi,
I just finished a very early release of wxSnip (the name is not the
final one, if you've got ideas...) :a wxStyledTextCtrl with basic snippets support, like the Scite one.
Snippets can be defined inside a dictionary (momentary, an XML based
solution would be better),
inside of file called 'snippets_dic.py'.
This one contains keys/values like this : shortcut : snippet text.Placeholders/tabstops :
-----------------------
they are defined like this : ${number:default value}Mirrors:
--------
${number}Cursor:(his position when the snippet finish)
-------
${0}
If no cursor is given, you'll be automatically driven to the end of the
snippet'text.Transformations:
----------------
$<number:some code here using the variable "last_item">Unlike Scite ones, transformations are made using the Python's eval
function. I'm not currently satisfied with it, and they may change in
a near future.Key:
-----
Ctrl+I activate the snippet or go to the next field.Don't blame me for the poor GUI I've build :
- I'm not a Python expert nor a wxPython one
- I've tried to use some of Andrea Gavana's controls but didn't study them
at all;You can download it here :
h**p://kib2.webfactional.com/SnipEdit/If some of Python IDE guys want it (SPE, Ulipad, DrPython, etc), maybe they
can use it inside their product.Some parts have to be rewritten, and maybe you can help me. I'll take a
closer look soon if some of you are interested in this widget.Note: it has only been tested with wxPython non Unicode.
Cheers, hoping to see some feedbacks:
------------------------------------------------
Kib虏 :
------------------------------------------------
Blog : http://kib2.webfactional.com/---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346