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

Reply via email to