Okay so I finally figured it out. In order to define a style for the keywords i had to use the function call like so :
        m_ScinTxt->StyleSetForeground (5, wxColour (_T("BLUE")));
5 being apparently the vallue for the keywords.
For commentary it was 3.
I was just wondering if there is some place where I can get the list of values because i couldn't find it anywhere and I had to try them one after the other (good thing it was only 5 for the one i was looking for cuz I understand there are 32 of them). Wouldn't it be interesting to list all the values somewhere ? Maybe it's just me and I didn't look in the right place.
Thanks for the help
Tom

From: "Tom Zaffran" <[EMAIL PROTECTED]>
Reply-To: Discussion of the Scintilla editing component<[email protected]>
To: [email protected]
Subject: [scintilla] WxScintilla syntax colouring problem (again)
Date: Mon, 19 Feb 2007 10:47:26 -0500

Hi everyone again.
For those who don't know what this is about, I have a school project for programming an IDE for PASCAL Language. I've managed to change the color of the default style and can now write code in any kind of colour i wish but I still can't figure out how to define a colour that only the keywords I want will take. bait is okay but it is written in C and doesn't use the same function call I do. I'm using C++ and wxWidgets and therefore the function calls are to wxScintilla functions. It shouldn't change that much though. I've tried looking at the wyo editor code but I don't really understand what's going on there either.

Here's what I did :

// wxScintilla
m_ScinTxt = new wxScintilla(this, SCITXT, wxDefaultPosition, wxSize(700,460), wxTE_MULTILINE, _T(""));

        // Setting lexer
        m_ScinTxt->SetLexer(wxSCI_LEX_PASCAL);
        m_ScinTxt->SetStyleBits(5);
        // margin definition
        m_ScinTxt->SetMarginType (0,wxSCI_MARGIN_NUMBER);
        m_ScinTxt->SetMarginWidth (0, 40);

// this defines the colour of default text and that works...
m_ScinTxt->StyleSetForeground (wxSCI_STYLE_DEFAULT, wxColour (_T("DARK_GREY")));
        m_ScinTxt->StyleClearAll();
// this should define any other style as blue but the keywords remain dark grey when they're typed anyway.
        int N = 33;
        while(N<127)
        {
                m_ScinTxt->StyleSetForeground (N, wxColour (_T("BLUE")));
                N++;
        }
// this sets the keywords
        m_ScinTxt->SetKeyWords(0, _T("begin for"));

So I guess I'm still missing something but I don't know what.
I'm sorry if this is a bit of a pain. I'm a newbee at this sort of things.
Thanks for helping me.
Tom

_________________________________________________________________
Mortgage rates as low as 4.625% - Refinance $150,000 loan for $579 a month. Intro*Terms http://www.NexTag.com

_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

_________________________________________________________________
The average US Credit Score is 675. The cost to see yours: $0 by Experian. http://www.freecreditreport.com/pm/default.aspx?sc=660600&bcd=EMAILFOOTERAVERAGE

_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to