How to write a Delphi IDE plugin that paints on the code editor - Part 2. The first article showed how to write a plugin that drew 'Hello world' on the top left of the code editor. This second part shows how to know what file is being drawn onscreen, what lines of code are visible (including handling code folding), etc, so that you can paint whatever you want for any line of code or portion of text in that line of code, in the text or gutter areas. It also covers how to be compatible with other plugins also hooking the same functions.

How to write a Delphi IDE plugin that paints on the code editor - Part 2. The first article showed how to write a plugin that drew 'Hello world' on the top left of the code editor. This second part shows how to know what file is being drawn onscreen, what lines of code are visible (including handling code folding), etc, so that you can paint whatever you want for any line of code or portion of text in that line of code, in the text or gutter areas. It also covers how to be compatible with other plugins also hooking the same functions.

http://parnassus.co/mysteries-ide-plugins-painting-code-editor-part-2/
http://parnassus.co/mysteries-ide-plugins-painting-code-editor-part-2

Comments

  1. Rodrigo Ruz Thanks!
    Stefan Glienke I reckon you're right. I haven't seen that bug (I don't use regions much) but I've seen a couple of other repainting bugs that are fixed when you place the caret on the line, or select the line. I suspect the IDE is too conservative in its invalidation sometimes.

    What really surprises me is that it's not double-buffered - if you artificially slow down a line paint, you can see them occur one by one, and in fact you can sometimes see this without any artificial slowdown at all. It makes it flicker. This was no doubt excellent, top-notch fast graphics output in the early days, but these days it's not so good.

    ReplyDelete
  2. You need to get your blog included in DelphiFeeds.com; Dennis Gurock

    ReplyDelete
  3. Nowadays its faster to repaint a big bitmap (ie: a buffer of the entire screen) than text output for a small portion. Specially on mobile gpus

    ReplyDelete

Post a Comment