Discussion:
Use different Margin for markers
Stefano Mtangoo
2013-11-15 17:16:46 UTC
Permalink
Hi,
I have an app acting as debugger and I need three markers
1. Marker to show erronous line in case of failed Lint check
2. Marker to show debug breakpoints
3. Marker to show current debugger line

The two are working fine but I want the third to be in its own margin and
cannot get it to do it.
My problem is, I cannot find single method to assign a marker to a given
Margin.
Is there such a method (since scintilla is said to have 5 margins)

I use wxSTC in case that will add anything and here is how I create them

//Margin and Marker Errors
SetMarginType(1, wxSTC_MARGIN_SYMBOL);
SetMarginWidth(1, 16);
SetMarginSensitive(1, false);

//fold margin
SetMarginType(2, wxSTC_MARGIN_SYMBOL);
SetMarginWidth(2, 16);
SetMarginSensitive(2, true);
SetMarginMask(2, wxSTC_MASK_FOLDERS);
SetFoldFlags(wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED |
wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED);

//Margin and Marker for Debug breakpoints currentline
SetMarginType(3, wxSTC_MARGIN_SYMBOL);
SetMarginWidth(3, 16);
SetMarginSensitive(3, true);

and here is how I define them
//debugger
MarkerDefineBitmap(HMARGIN_DEBUG_BREAKPOINT,
wxBitmap(ConfigManager::Instance()->GetIconPath()+wxT("breakpoint.png"),
wxBITMAP_TYPE_PNG));
//current debugger line
MarkerDefine(HMARGIN_DEBUG_CURRENT, wxSTC_MARK_ARROW, wxT("green"),
wxT("green"));
//Marker for parsing errors
MarkerDefine(HMARGIN_PARSE_ERROR, wxSTC_MARK_SHORTARROW, *wxRED,
*wxRED);

And finally when Line changes here is how I change themarker (and does not
work as I expect)
m_editorPage->MarkerDeleteAll(HMARGIN_DEBUG_CURRENT);
m_editorPage->MarkerAdd(HMARGIN_DEBUG_CURRENT,
GetLineNo());
m_editorPage->GotoLine(GetLineNo());
m_editorPage->EnsureCaretVisible();

Thanks in Advace,
Stefano
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-11-15 21:27:32 UTC
Permalink
The two are working fine but I want the third to be in its own margin and cannot get it to do it.
My problem is, I cannot find single method to assign a marker to a given Margin.
Set the margin mask to the bits that match the markers you want displayed.
http://www.scintilla.org/ScintillaDoc.html#SCI_SETMARGINMASKN

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Stefano Mtangoo
2013-11-16 16:44:47 UTC
Permalink
Post by Stefano Mtangoo
The two are working fine but I want the third to be in its own margin
and cannot get it to do it.
Post by Stefano Mtangoo
My problem is, I cannot find single method to assign a marker to a given
Margin.
Set the margin mask to the bits that match the markers you want displayed.
http://www.scintilla.org/ScintillaDoc.html#SCI_SETMARGINMASKN
Hi Neil,
can you give me a simple example that have three margin each with one
independent symbol?
I have tried code below and many variation it does not work. It seems I'm
ignorant of something here and I don't know it

//Margin and Marker Errors
SetMarginType(1, wxSTC_MARGIN_SYMBOL);
SetMarginWidth(1, 16);
SetMarginSensitive(1, true);

//fold margin
SetMarginType(HMARGIN_FOLD, wxSTC_MARGIN_SYMBOL);
SetMarginWidth(HMARGIN_FOLD, 16);
SetMarginSensitive(HMARGIN_FOLD, true);
SetMarginMask(HMARGIN_FOLD, wxSTC_MASK_FOLDERS);
SetFoldFlags(wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED |
wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED);

//Margin and Marker for Debug currentline
SetMarginType(HMARGIN_DEBUG_CURRENT, wxSTC_MARGIN_SYMBOL);
SetMarginWidth(HMARGIN_DEBUG_CURRENT, 16);
SetMarginSensitive(HMARGIN_DEBUG_CURRENT, false);
SetMarginMask(HMARGIN_DEBUG_CURRENT, wxSTC_MARK_ARROW);

Defines are here

#define HMARGIN_LINE_NUMBERS 0
#define HMARGIN_DEBUG_BREAKPOINT 1
#define HMARGIN_FOLD 2
#define HMARGIN_DEBUG_CURRENT 3
#define HMARGIN_PARSE_ERROR 4
Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-11-20 02:35:05 UTC
Permalink
can you give me a simple example that have three margin each with one independent symbol?
I have tried code below and many variation it does not work. It seems I'm ignorant of something here and I don't know it
I don't enjoy writing examples. You could search the web for uses of the API.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Stefano Mtangoo
2013-11-21 07:20:11 UTC
Permalink
Post by Stefano Mtangoo
Post by Stefano Mtangoo
can you give me a simple example that have three margin each with one
independent symbol?
Post by Stefano Mtangoo
I have tried code below and many variation it does not work. It seems
I'm ignorant of something here and I don't know it
I don't enjoy writing examples. You could search the web for uses of the API.
Actually before I post I do a lot of googling. I finally found project
that helped me
http://kldp.net/projects/mygdb
Post by Stefano Mtangoo
Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Continue reading on narkive:
Loading...