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.
    • Grahame GrieveG
      Grahame Grieve
      last edited by

      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
      • Grahame GrieveG
        Grahame Grieve
        last edited by

        oh - v7.5.6

        Claudia FrankC 1 Reply Last reply Reply Quote 0
        • Claudia FrankC
          Claudia Frank @Grahame Grieve
          last edited by

          @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
          • Grahame GrieveG
            Grahame Grieve
            last edited by

            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?

            Claudia FrankC 1 Reply Last reply Reply Quote 0
            • Claudia FrankC
              Claudia Frank @Grahame Grieve
              last edited by Claudia Frank

              @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
              • Grahame GrieveG
                Grahame Grieve
                last edited by

                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
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors