wxStyledTextCtrl and sql syntax highlightning

P

pierre_py

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.wxSTC_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
 
J

jean-michel bain-cornu

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.wxSTC_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
 
P

pierre_py

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top