how to get text in mini-window supports select/copy

Posted by Zhenzh on Mon 05 Mar 2018 06:24 PM — 6 posts, 21,374 views.

China #0
I find all my current mini-window related plugins using WindowText function to draw text which treated text as a picture and can not be selected and copied.

Is there any way to get all text in mini-window support selecting and copying as what we can do in main window?
USA Global Moderator #1
Miniwindows are just pictures. If you want this, you have to do it from scratch using raw pixel geometry like I did for Aardwolf.
Amended on Mon 05 Mar 2018 08:21 PM by Fiendish
Australia Forum Administrator #2
A simple way would be to make each line a hotspot (the same rectangle as what you draw the text in). You could then make something like RH (or LH) mouse-click pops up a menu which offers to copy the whole line. At least you can get back a line from the window like that. Of course, you would have to remember somewhere what was drawn for each line.
China #3
I consider this feature as I'm going to move chat data into mini-window and omit the useless output from main window.

I main window, I used to be able to select and copy part of a chat line. When moving such line into mini-window, I have to do the same operation in mini-window as the output in main window has been omitted.

So, the idea mentioned by Fiendish may be the closest choice for my request.

Fiendish said:

do it from scratch using raw pixel geometry like I did for Aardwolf


Can you provide an example for how using raw pixel geometry?
Amended on Tue 06 Mar 2018 07:06 AM by Zhenzh
USA Global Moderator #4
Quote:
Can you provide an example for how using raw pixel geometry?


I do it for Aardwolf's channel capture plugin. Link is in my signature. The full explanation of how it works is unfortunately too complicated for me to post here now, though.

The basic idea is to use the mouse coordinates at the start of dragging, and the current mouse coordinates, and the bounding box of the text, and the height of each line of text to find which text in your window has been dragged over, and then draw a highlighted background for just the dragged-over part snapped to the nearest whole character, and then draw the text again on top of that. That way it looks like you are pulling the highlight background with your mouse.
Amended on Tue 06 Mar 2018 07:57 AM by Fiendish
China #5
Thank you. I can read you code for understanding details.