469,626 Members | 877 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

wxStyledTextCtrl and sql syntax highlightning

Hi.
I use wxPy version 2.4.2 for Python 2.3.

Now I wanted to use the wxStyledTextCtrl for viewing (editing) of sql
code.

I have the following:
self.__m_styled_text_ctrl = wxPython.stc.wxStyledTextCtrl(
self, wx.NewId(),
style=wxPython.wx.wxNO_FULL_REPAINT_ON_RESIZE)
self.__m_styled_text_ctrl.SetLexer(wxPython.stc.wx STC_LEX_SQL)
self.__m_styled_text_ctrl.SetProperty("fold", "1")
self.__m_styled_text_ctrl.SetMargins(0,0)
self.__m_styled_text_ctrl.SetKeyWords(0, SQL_KEYWORDS)

Where sql_keywords is string with space separated sql keywords.

When i add text to the ctrl i don't get the right highlightning.

What do i do wrong and what else do i have to specify?

thx in advance

Jun 21 '06 #1
2 2202
> I have the following:
self.__m_styled_text_ctrl = wxPython.stc.wxStyledTextCtrl(
self, wx.NewId(),
style=wxPython.wx.wxNO_FULL_REPAINT_ON_RESIZE)
self.__m_styled_text_ctrl.SetLexer(wxPython.stc.wx STC_LEX_SQL)
self.__m_styled_text_ctrl.SetProperty("fold", "1")
self.__m_styled_text_ctrl.SetMargins(0,0)
self.__m_styled_text_ctrl.SetKeyWords(0, SQL_KEYWORDS)

Hi Pierre,
I'd like to do some tests with your stuff, but I'd appreciate to have a
working sample. Would you like to post it ?
Regards,
jm
Jun 21 '06 #2
Hi.

Thanks it works now .. i must reset the default styles with
StyleClearAll and then set the styles apropriate again.

Is there a way that the keyword list isn't case sensitive, as sql
isn't.

reg,
Pierre

jean-michel bain-cornu wrote:
I have the following:
self.__m_styled_text_ctrl = wxPython.stc.wxStyledTextCtrl(
self, wx.NewId(),
style=wxPython.wx.wxNO_FULL_REPAINT_ON_RESIZE)
self.__m_styled_text_ctrl.SetLexer(wxPython.stc.wx STC_LEX_SQL)
self.__m_styled_text_ctrl.SetProperty("fold", "1")
self.__m_styled_text_ctrl.SetMargins(0,0)
self.__m_styled_text_ctrl.SetKeyWords(0, SQL_KEYWORDS)

Hi Pierre,
I'd like to do some tests with your stuff, but I'd appreciate to have a
working sample. Would you like to post it ?
Regards,
jm


Jun 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Ken in Melbourne Australia | last post: by
699 posts views Thread by mike420 | last post: by
14 posts views Thread by Sandy Norton | last post: by
5 posts views Thread by Paul Robson | last post: by
19 posts views Thread by Nicolas Fleury | last post: by
3 posts views Thread by Manuel | last post: by
5 posts views Thread by David Rasmussen | last post: by
4 posts views Thread by OpenPavilion Team | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.