[QScintilla] Margin help

Scott Bloom scott at towel42.com
Thu Apr 19 01:16:45 BST 2018


It turns out , it was a mask issue.. I have it resolved.

However, another issue has come up, also with margins.

You can get the Line/Index info from a QPoint, but not if the mouse point is over the margin.

is there any way to tell what line number the mouse is hovering over in the margin?

Scott

From: QScintilla <qscintilla-bounces at riverbankcomputing.com> On Behalf Of Scott Bloom
Sent: Wednesday, April 18, 2018 17:06
To: qscintilla at riverbankcomputing.com; Phil Thompson <phil at riverbankcomputing.com>
Subject: [QScintilla] Margin help


This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing<http://aka.ms/LearnAboutSpoofing>

Feedback<http://aka.ms/SafetyTipsFeedback>

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 01D3D739.063746F0]

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/e7502669/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/e7502669/attachment-0001.png>


More information about the QScintilla mailing list