473,715 Members | 6,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

wxStyledTextCtr l and sql syntax highlightning

Hi.
I use wxPy version 2.4.2 for Python 2.3.

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

I have the following:
self.__m_styled _text_ctrl = wxPython.stc.wx StyledTextCtrl(
self, wx.NewId(),
style=wxPython. wx.wxNO_FULL_RE PAINT_ON_RESIZE )
self.__m_styled _text_ctrl.SetL exer(wxPython.s tc.wxSTC_LEX_SQ L)
self.__m_styled _text_ctrl.SetP roperty("fold", "1")
self.__m_styled _text_ctrl.SetM argins(0,0)
self.__m_styled _text_ctrl.SetK eyWords(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 2333
> I have the following:
self.__m_styled _text_ctrl = wxPython.stc.wx StyledTextCtrl(
self, wx.NewId(),
style=wxPython. wx.wxNO_FULL_RE PAINT_ON_RESIZE )
self.__m_styled _text_ctrl.SetL exer(wxPython.s tc.wxSTC_LEX_SQ L)
self.__m_styled _text_ctrl.SetP roperty("fold", "1")
self.__m_styled _text_ctrl.SetM argins(0,0)
self.__m_styled _text_ctrl.SetK eyWords(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.wx StyledTextCtrl(
self, wx.NewId(),
style=wxPython. wx.wxNO_FULL_RE PAINT_ON_RESIZE )
self.__m_styled _text_ctrl.SetL exer(wxPython.s tc.wxSTC_LEX_SQ L)
self.__m_styled _text_ctrl.SetP roperty("fold", "1")
self.__m_styled _text_ctrl.SetM argins(0,0)
self.__m_styled _text_ctrl.SetK eyWords(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
6835
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 the curly bracket has to be a dollar sign '$'. This is fine for variables, arrays and some objects but doesn't allow me to call a function such as addslashes() or trim() before I return the string in the variable.
699
33993
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 capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it could be possible to add Pythonistic syntax to Lisp or Scheme, while keeping all of the...
0
1105
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 much slow. Any idea to resolve this issue?
14
2312
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 __init__(self, name):
5
1804
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 focus initially on the editor. This works fine. Odd thing is though, switching back and forwards between applications alternately hides and reappears the caret.
19
2972
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 $ Last-Modified: $Date: 2003/09/22 04:51:49 $ Author: Nicolas Fleury <nidoizo at gmail.com> Status: Draft Type: Standards Track
3
16245
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 strange error. In your experience, where I should looking to find the real error? Surely the sintax of glut is correct... gcc.exe -c glut_bitmap.c -o glut_bitmap.o -I"C:/Dev-Cpp/include" -I"../../include" -D__GNUWIN32__ -W -DWIN32 -DNDEBUG...
5
3121
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) Is there an alternative?
4
2151
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 examples. I also watched the styledtextctrl examples with wxpython 2.8.4. What I am looking for is an example of how to do the autocompletion part for the styledtextctrl based on my self defined XML language.
0
8821
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8718
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9340
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7973
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5967
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4477
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2118
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.