• Login
Community
  • Login

Problem setting annotation text

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
6 Posts 2 Posters 1.6k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    Grahame Grieve
    last edited by Jun 1, 2018, 10:27 AM

    I am setting an annotation (pascal):

    procedure squiggle(level, line, start, length: integer; message : String);
    var
    b, c : TBytes;
    begin
    b := TEncoding.UTF8.GetBytes(message);
    mcheck(SendMessage(ScintillaMainHandle, SCI_SETINDICATORCURRENT, level, 0));
    mcheck(SendMessage(ScintillaMainHandle, SCI_INDICATORFILLRANGE, start, length));
    mcheck(SendMessage(ScintillaMainHandle, SCI_ANNOTATIONSETTEXT, 0, LPARAM(@b[0])));
    SetLength(c, 100000);
    mcheck(SendMessage(ScintillaMainHandle, SCI_ANNOTATIONGETTEXT, 0, LPARAM(@c[0])));
    end;

    NPP encoding is UTF8, which is what I’m using. No matter what I provide - UTF-8 or 16, or ASCII, what is actually displayed in the annotation is ‘B’ (even if the last parameter is 0). if I provide a bad pointer, I’ll get an access violation, so the construction of the 4th parameter is not - probably - the error. I’ve played around a lot with the text, but I wonder if that’s not the source… “B” is not the first letter of any text I’m displaying… I am at a loss, and any hints gratefully received. thanks

    1 Reply Last reply Reply Quote 0
    • G
      Grahame Grieve
      last edited by Jun 1, 2018, 11:18 AM

      oh - v7.5.6

      C 1 Reply Last reply Jun 1, 2018, 12:52 PM Reply Quote 0
      • C
        Claudia Frank @Grahame Grieve
        last edited by Jun 1, 2018, 12:52 PM

        @Grahame-Grieve

        I don’t SCI_ANNOTATIONSETVISIBLE in your code.

        The basic steps are (python example)

        editor.annotationSetText(line, text)
        editor.annotationSetStyles(line, styles)
        editor.annotationSetVisible(annotation_visible)
        

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • G
          Grahame Grieve
          last edited by Jun 2, 2018, 8:40 PM

          ok, so I was quite confused, and this clarified, thanks. Annotations work fine. I’m not asking about annotations. I’m asking about the popup text that displays when the mouse hovers over the indicator. That’s what is displaying as a single character. It’s now changed, to “T” - but I don’t seem to have any control over it?

          C 1 Reply Last reply Jun 2, 2018, 8:57 PM Reply Quote 0
          • C
            Claudia Frank @Grahame Grieve
            last edited by Claudia Frank Jun 2, 2018, 8:57 PM Jun 2, 2018, 8:57 PM

            @Grahame-Grieve

            Can you give me an example where in notepad++ you see the reported popup text?
            Currently I’m unsure about which functionality you are looking for.
            Or is this functionality only available in your plugin currently?
            If so, could describe in more detail what you try to achieve?

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • G
              Grahame Grieve
              last edited by Jun 2, 2018, 10:49 PM

              Actually, my question was about Call Tips - and once I found out what I was supposed to asking, my own error was also obvious… sorry

              1 Reply Last reply Reply Quote 1
              6 out of 6
              • First post
                6/6
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors