The Edit control is missing a line select area

I use the Edit control a lot in Opus dialogs. In a number of cases I use it to work with lists, each line of which I need to do something with. These are not static lists (which I could load in a ListView control), they are actively maintained and edited lists of data - for instance an url, a title, and a description. I’m of course using it with Edit type Multiline, and also Word wrap set to False. Then I select a line, and buttons do the work, capturing the selected line (using SelectRange() and all these handy methods) and doing a lot of stuff.

In many text editors (such as Notepad++, but also the standard script editor of Directory Opus) you can select a line by just clicking in the margin, close to the beginning of the line. I’m missing this in the Opus edit control, which makes selecting a line more like precision work.

Basically what is needed is a tiny vertical area, maybe 3 or 4 mm wide , where we can click in order to select the entire line at once. There should then of course be an option, something like Line select, which is by default set to False (for backward compatibility) but which can be activated in order to get the additional mouseclick area. Needless to say, when word wrap is active in the control, it should equally select the line (which in that case we use to call a “paragraph”).

I think this would be added value for this control.

PS. If the edit control would produce an event every time I click in it, I could probably have coded the auto-selection, but the control only produces an event the first time you click into the editor field. (It would also require me to search back and forth to find the line breaks, but more importantly, it would probably disable the possibility to select just part of a phrase - which is also sometimes needed to copy some part of the line). So the better option would really be having a small mouse-click area on the left.

But I can imagine few people have a need for this. So it’s just an idea. Ideas and business (ROI) are two very different things.

In the next beta we'll make it so that script dialogs can use the code editor control that Opus uses in various dialogs (e.g. the script editor), as this has that feature (plus others of course).

4 Likes

Wow, that’s an even better idea! Looking forward to it.

It works fantastic! Even includes hyperlinks being control-clickable, putting lines in comments colours them green and all that stuff. And all standard functions still seem to work too (although I would expect to find some glitches anyway, because magic rarely comes without some unexpected side-effects).

no word-wrap, no fonts. :frowning:

Sounds logical to me: the code editor doesn’t have that either.

You can set the font, but it will affect all code editors.

That’s an undesirable side-effect then. I can’t think of many people who would like their code editor to become a non-fixed-width font, for instance.

But it is unavoidable if the implemented new editor is the original code editor (passed by reference'). To me that’s still okay but it would be wise to warn the user about it when choosing this setting, or they may end up discovering a font change in their code editor later on, and not realizing where that comes from.