473,698 Members | 2,241 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 2331
> 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
33935
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
1100
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
2308
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
1801
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
2970
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
16237
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
3116
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
2148
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
8603
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
9157
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
9026
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...
1
8893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
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
5860
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
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.