Forum > LCL

SynEdit question(s)

(1/3) > >>

440bx:
Hello,

Is it possible to have some lines be read-only mixed with lines that are read-write ? if the answer is yes, what properties or methods are used to control that line characteristic ?

If the answer is no, I'd like to have an estimate of how difficult and how much work it would be to add that feature to SynEdit.

Thank you for your help.

Joanna from IRC:
Doesn’t edit by definition mean that you can change things though?

Martin_fr:
Not as part of the editor itself. There are no per line options.

But you can hook the keydown/up or On[User]Command and Mouse events, and then stop them.

Or you can react to caret move, and change readonly in the event. Though I don't know if combined actions will check after they moved the caret.... (e.g. middle button paste).

Otherwise by which means is it to be decided?

440bx:

--- Quote from: Joanna from IRC on November 27, 2024, 09:54:56 am ---Doesn’t edit by definition mean tha5 you can change things though?

--- End quote ---
Yes but, edit does not imply everything is editable.



--- Quote from: Martin_fr on November 27, 2024, 10:33:02 am ---Not as part of the editor itself. There are no per line options.

But you can hook the keydown/up or On[User]Command and Mouse events, and then stop them.

--- End quote ---
I can see how that would work.  Very useful observation, thank you Martin.


--- Quote from: Martin_fr on November 27, 2024, 10:33:02 am ---Or you can react to caret move, and change readonly in the event. Though I don't know if combined actions will check after they moved the caret.... (e.g. middle button paste).

--- End quote ---
I'll look into that.


--- Quote from: Martin_fr on November 27, 2024, 10:33:02 am ---Otherwise by which means is it to be decided?

--- End quote ---
In this particular case, text that is generated by the program is not editable whereas text that is user-entered is.

To give an example that is "parallel" to what I intend to do, imagine a user can add comments to the debugger's dis-assembly window, those comments may be edited at any time while the dis-assembly text (which is generated by the debugger) is normally read-only.

Question: is the dis-assembly window a SynEdit or is it a different control ?

Joanna from IRC:
Ah , are you using synedit within your own project? That makes sense

Navigation

[0] Message Index

[#] Next page

Go to full version