[QScintilla] Margin help
Scott Bloom
scott at towel42.com
Thu Apr 19 01:05:57 BST 2018
The margins I want to have are the following:
0 - Line Nmber
1 - Text (5 characters)
2 - Bookmark
3 - Folding
The code I use to set this up is the following
enum EMargin
{
eLineNumber = 0,
eDataMark = 1,
eBookMarks = 2,
eFoldingMargin=3
};
setMarginType( eLineNumber, QsciScintilla::NumberMargin );
setMarginType( eDataMark, QsciScintilla::TextMargin );
setMarginWidth( eDataMark, "CIWEF" ); // will be set to one or more of these characters
setMarginType( eFoldingMargin, QsciScintilla::SymbolMargin );
setMarginType( eBookMarks, QsciScintilla::SymbolMargin );
setMarginWidth( eBookMarks, 16 );
QPixmap bookmark( ":/resources/bookmark.png" );
bookmark = bookmark.scaled( 12, 12, Qt::KeepAspectRatio );
markerDefine( bookmark, eBookMarks );
For the bookmarks
markerAdd( lineNum, eBookmarks) is called when the correct action is triggered.
For the text margin I use
setMarginText( lineNum, text, STYLE_LINENUMBER )
The problem I have, is the location of where the bookmark is painted is wrong
[cid:image001.png at 01D3D737.82FFC650]
Its painting it in the middle of the 1 margin and not painting it in the 2 margin.
Any ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20180419/4b9da24b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 27475 bytes
Desc: image001.png
URL: <https://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20180419/4b9da24b/attachment-0001.png>
More information about the QScintilla
mailing list