STC Marker Appears on Number Line Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2292
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

STC Marker Appears on Number Line

Post by evstevemd » Thu Dec 19, 2013 9:24 am

Hi,
I have this STC that I use to show Error. As shown below, a marker appears on Line number which is not what I want.
I want only one Marker and it should go into symbols margin only.
Here is a code I use for margins and markers (stripped) and Shot.

What am I doing wrong?

Code: Select all

#define HBOOKMARK_MARKER     0x7
#define HBREAKPOINT_MARKER   0x8
#define HDEBUG_MARKER        0x9
#define HERROR_MARKER        0xA

#define HNUMBER_MARGIN_ID 	0
#define HSEP_MARGIN_ID 		1
#define HSYMBOLS_MARGIN_ID 	2
#define HFOLD_MARGIN_ID 		3
//defining Margins

Code: Select all

SetMarginType(HNUMBER_MARGIN_ID, wxSTC_MARGIN_NUMBER);
	SetMarginType(HSYMBOLS_MARGIN_ID, wxSTC_MARGIN_SYMBOL);
	SetMarginWidth(HSYMBOLS_MARGIN_ID, 16);

	// margin for bookmarks, breakpoints
        SetMarginMask(HNUMBER_MARGIN_ID, ~(256 | 512 | 128 | 64 | wxSTC_MASK_FOLDERS));

	// Fold margin - allow only folder symbols to display
	//SetMarginMask(HFOLD_MARGIN_ID, wxSTC_MASK_FOLDERS);

	// allow everything except for the folding symbols
	SetMarginMask(HSYMBOLS_MARGIN_ID, ~(wxSTC_MASK_FOLDERS));

	// Mark fold margin & symbols margins as sensitive
	SetMarginSensitive(HNUMBER_MARGIN_ID, false);
	SetMarginSensitive(HFOLD_MARGIN_ID, true);
	SetMarginSensitive(HSYMBOLS_MARGIN_ID, true); 

	SetMarginType(2, wxSTC_MARGIN_SYMBOL);
	SetMarginWidth(2, 16);
	SetMarginMask(2, wxSTC_MASK_FOLDERS);
	SetMarginSensitive(2, 1);
And here is how I call it

Code: Select all

//clear any previous error markers (page ==> wxSTC)
		page->MarkerDeleteAll(HERROR_MARKER);
		errorMsg = wxString::Format(_("%s on %s Line %d Near Position %d\n"), result.Error.c_str(),
		                            result.File.c_str(), result.LineNumber, result.CharacterPosition);
		page->MarkerAdd(result.LineNumber - 1, HERROR_MARKER);
		page->GotoLine(result.LineNumber - 1);
error.png
error.png (34.49 KiB) Viewed 974 times
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]

eranif
Moderator
Moderator
Posts: 607
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Re: STC Marker Appears on Number Line

Post by eranif » Thu Dec 19, 2013 8:31 pm

The way I see it, the error marker is 0xA (=10)
So its mask is 2^10 = 1024 so you should add it to this line:

Code: Select all

SetMarginMask(HNUMBER_MARGIN_ID, ~(1024 | 256 | 512 | 128 | 64 | wxSTC_MASK_FOLDERS));
Eran
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org

User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2292
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Re: STC Marker Appears on Number Line

Post by evstevemd » Fri Dec 20, 2013 7:49 am

eranif wrote:The way I see it, the error marker is 0xA (=10)
So its mask is 2^10 = 1024 so you should add it to this line:

Code: Select all

SetMarginMask(HNUMBER_MARGIN_ID, ~(1024 | 256 | 512 | 128 | 64 | wxSTC_MASK_FOLDERS));
Eran
Thanks Eran. Thats what I missed!
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]

Post Reply