WxScintilla Help  [SOLVED]

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
LK
In need of some credit
In need of some credit
Posts: 6
Joined: Wed May 17, 2006 2:40 am

WxScintilla Help

Postby LK » Wed May 17, 2006 3:01 am

Hello,
I have to do a text editor that make syntaxical colouring,
and after that, I'll add a cryptographic function to the editor.
I know that scintilla can do the colouring, but how use the lexer, I really do not understand how to use it and set it up, and will it be set by saving the document (eg: save example.cpp will colour with the cpp lexer) or "by hand" (select in a menu the cpp lexer).
(I'm under Linux Ubuntu Dapper-Drake 6.06 dev version)

Thanks you for your help.

benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Postby benedicte » Wed May 17, 2006 9:11 am

You should have a look at wxStEdit (in wxCode). It uses Scintilla and does syntax colouring.

http://wxcode.sourceforge.net/showcomp. ... e=wxStEdit

LK
In need of some credit
In need of some credit
Posts: 6
Joined: Wed May 17, 2006 2:40 am

Postby LK » Wed May 17, 2006 3:21 pm

yes I know, and also wxscintilla, but I can't find any how to or doc/help
about anything.

if some one have a tutorial or something or a sample code?


I don't know what is possible to do in fact, syntax colouring at save, or by user selection or something else.

do you know a gui designer for wxwidgets under linux?

sethjackson
Super wx Problem Solver
Super wx Problem Solver
Posts: 396
Joined: Wed Oct 05, 2005 1:19 am

Postby sethjackson » Wed May 17, 2006 6:12 pm

LK wrote:yes I know, and also wxscintilla, but I can't find any how to or doc/help
about anything.

if some one have a tutorial or something or a sample code?


I don't know what is possible to do in fact, syntax colouring at save, or by user selection or something else.

do you know a gui designer for wxwidgets under linux?


Function reference here.

http://wxcode.sourceforge.net/component ... rence.html

LK
In need of some credit
In need of some credit
Posts: 6
Joined: Wed May 17, 2006 2:40 am

Postby LK » Wed May 17, 2006 6:44 pm

what is possible to do in fact, syntax colouring at save, or by user request or something else?

benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Postby benedicte » Wed May 17, 2006 7:04 pm

LK wrote:yes I know, and also wxscintilla, but I can't find any how to or doc/help
about anything.

if some one have a tutorial or something or a sample code?


I don't know what is possible to do in fact, syntax colouring at save, or by user selection or something else.

You can set the lexer at saving time, you can also make a menu for the user to choose the lexer to apply.
You just need to look into wxStEdit code.

LK wrote:do you know a gui designer for wxwidgets under linux?

wxDesigner.

LK
In need of some credit
In need of some credit
Posts: 6
Joined: Wed May 17, 2006 2:40 am

Postby LK » Wed May 17, 2006 7:33 pm

benedicte wrote:
LK wrote:yes I know, and also wxscintilla, but I can't find any how to or doc/help
about anything.

if some one have a tutorial or something or a sample code?


I don't know what is possible to do in fact, syntax colouring at save, or by user selection or something else.

You can set the lexer at saving time, you can also make a menu for the user to choose the lexer to apply.
You just need to look into wxStEdit code.

LK wrote:do you know a gui designer for wxwidgets under linux?

wxDesigner.


yeah, but wxDesigner is not free of charge and I don't think it's opensource...
I tried wxGlade and it's not fine, Glade for GTK+ is better.
anybody knows a gui designer for wxWidget free and easy to use?

buildere
Super wx Problem Solver
Super wx Problem Solver
Posts: 358
Joined: Thu Oct 28, 2004 3:45 pm
Location: Costa Rica

Postby buildere » Wed May 17, 2006 8:10 pm

LK wrote:do you know a gui designer for wxwidgets under linux?


https://sourceforge.net/projects/wxformbuilder/

LK
In need of some credit
In need of some credit
Posts: 6
Joined: Wed May 17, 2006 2:40 am

Postby LK » Wed May 17, 2006 8:44 pm

buildere wrote:
LK wrote:do you know a gui designer for wxwidgets under linux?


https://sourceforge.net/projects/wxformbuilder/


Thanks you ;)
I'll try it
-----------------------------

I want to set the syntaxic colouring at save, easiest I thing, but how?
(WxStEdit)

geralds
I live to help wx-kind
I live to help wx-kind
Posts: 186
Joined: Tue Nov 01, 2005 9:22 am
Contact:

  [SOLVED]

Postby geralds » Wed Jun 14, 2006 11:29 am

You could try the following to apply syntax colouring (the example is for XML, but you could use any lexer here):

Code: Select all

SetLexer(wxSTC_LEX_XML);
StyleSetForeground(wxSTC_STYLE_DEFAULT, *wxBLACK);
StyleSetBackground(wxSTC_STYLE_DEFAULT, *wxWHITE);
StyleClearAll();

StyleSetForeground(wxSTC_H_TAG, *wxBLUE);
StyleSetForeground(wxSTC_H_TAGUNKNOWN, *wxBLUE);
StyleSetForeground(wxSTC_H_ATTRIBUTE, *wxRED);
StyleSetForeground(wxSTC_H_ATTRIBUTEUNKNOWN, *wxRED);
StyleSetForeground(wxSTC_H_NUMBER, *wxBLACK);
StyleSetForeground(wxSTC_H_OTHER, *wxBLUE);
StyleSetForeground(wxSTC_H_COMMENT,
  wxTheColourDatabase->Find(_T("GREY")));
StyleSetForeground(wxSTC_H_ENTITY, *wxRED);
StyleSetForeground(wxSTC_H_TAGEND, *wxBLUE);
StyleSetForeground(wxSTC_H_XMLSTART, *wxBLUE);
StyleSetForeground(wxSTC_H_XMLEND, *wxBLUE);
StyleSetForeground(wxSTC_H_CDATA, *wxRED);

Colourise(0, -1);


Return to “wxCode”

Who is online

Users browsing this forum: No registered users and 1 guest