Word selection in MaxIDE

BlitzMax Forums/MaxGUI Module/Word selection in MaxIDE

remz(Posted 2007) [#1]
Hello fellow coders

I must not be the only out there that would REALLY LIKE to have a correct word selection in the code editor?
Word selection is when you double-click on a word to auto-select it.
Now in Visual Studio, it does include the _ underscore caracter so variable names like MENU_ITEM gets selected correctly. In MaxIDE however, it does not: the underscore is a word delimiter apparently. And another annoying quirk is that it always select an extra space at the end of a word.

(I investigated a bit, and it's not MaxIDE's fault at all, it's just the way RichEdit control works in Windows. Try opening a text file in WordPad and you'll see. Even typing in this forum exhibit the same behavior)

Anyhow, I'm coding a 'word select' add-on that could go in MaxIDE Community Edition. It's fully working here in my test app, so I'll try tomorrow to integrate it into maxIDE CE and see if everything works fine. The way I've implemented it at the moment is by holding down CTRL and clicking on a word, the word will get auto-selected, Visual Studio style. I might try to also support double-click depending on feasibility of detecting a double-click event.

I would like to know if this little modification would be of any help to any of you guys?

See ya!


remz(Posted 2007) [#2]
Good news!
It works: I have added this 'word selection' function right into maxgui's textarea (win32 only).
I have tested it with MaxIDE CE and with the good old MaxIDE 1.26, both works perfectly.
I'll post the code up if anyone's interested.

Note: although this modification would also work correctly when catching double-click event, intercepting this message results in an unwanted side-effect: triple-click wouldn't select the current line anymore. So I've only set the code to perform word selection on Left Mouse Button Up and holding down CTRL key.

About portability: since the TextArea gadget word selection is already incoherent between Windows and Mac, this fix is only for Windows, where the problem was worst. On Mac, the word selection is also bad but differently. I can't check the linux version but I'll bet it's different too.