Page 1 of 1

wxStyledTextCtrl Indicators

Posted: Wed Apr 17, 2013 6:59 pm
by evstevemd
Hi,
I'm trying to highlight similar text in my editor and I use indicators. The problem is the text is underlined than being surrounded by a box.
I need to do something nicer (a box around text or highlight with color) than a colored line.

Here is my relevant code and below is the shot.

Code: Select all

IndicatorSetForeground(wxSTC_INDIC_ROUNDBOX, *wxRED);
SetIndicatorCurrent(wxSTC_INDIC_ROUNDBOX);
IndicatorFillRange(posFound, GetTargetEnd() - posFound);
problem.png
problem.png (69.2 KiB) Viewed 1089 times

Re: wxStyledTextCtrl Indicators

Posted: Thu Apr 18, 2013 6:20 am
by eranif
Hi!
You need to set the indicator number and use it, wxSTC_INDIC_ROUNDBOX is a style

For example, in codelite I have this code:

Code: Select all

// somewhere at the top of the file
#define MATCH_INDICATOR 10

//...
IndicatorSetUnder(MATCH_INDICATOR, true);
IndicatorSetStyle(MATCH_INDICATOR, wxSTC_INDIC_ROUNDBOX);

// When there is a match:
SetIndicatorCurrent(MATCH_INDICATOR);
IndicatorFillRange(...);
Eran

Re: wxStyledTextCtrl Indicators

Posted: Thu Apr 18, 2013 10:07 am
by evstevemd
eranif wrote:Hi!
You need to set the indicator number and use it, wxSTC_INDIC_ROUNDBOX is a style

For example, in codelite I have this code:

Code: Select all

// somewhere at the top of the file
#define MATCH_INDICATOR 10

//...
IndicatorSetUnder(MATCH_INDICATOR, true);
IndicatorSetStyle(MATCH_INDICATOR, wxSTC_INDIC_ROUNDBOX);

// When there is a match:
SetIndicatorCurrent(MATCH_INDICATOR);
IndicatorFillRange(...);
Eran
You are maverick!
It works nicely...thank you! =D>