473,383 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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 2315
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ken in Melbourne Australia | last post by:
If I use the curly bracket syntax (referred to as the complex syntax) within a string, how do I get to call a function within it? The php manual says that the first (or previous) character for...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
0
by: J.R. | last post by:
Hi, I want to use the wxStyledTextCtrl to open a huge ascii file, see almost 10MB. After I set the wrap mode, i.e. set to wxSTC_WRAP_WORD, the open and resize of the wxStyledTextCtrl will be...
14
by: Sandy Norton | last post by:
If we are going to be stuck with @decorators for 2.4, then how about using blocks and indentation to elminate repetition and increase readability: Example 1 --------- class Klass: def...
5
by: Paul Robson | last post by:
I have a wierd thing with a little editor app I'm writing. I'm using wxStyledTextCtrl ; the wrapper for Scintilla. When I create the frame in wxPython, I use self.Editor.SetFocus() to put the...
19
by: Nicolas Fleury | last post by:
Hi everyone, I would to know what do you think of this PEP. Any comment welcomed (even about English mistakes). PEP: XXX Title: Specialization Syntax Version: $Revision: 1.10 $...
3
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
5
by: David Rasmussen | last post by:
I have several questions about wxStyledTextCtrl: 1) Is it still being maintained? 2) Where are the docs and tutorials? 3) Is it wxStyledTextCtrl, wx.StyledTextCtrl, StyledTextCtrl, or... ? ...
4
by: OpenPavilion Team | last post by:
Hello community, I want to create an editor for a self defined xml markup language. I want to use wxpython with wxstyledtextctrl and I have looked around at yellowbrain site, but there are no...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.