kryslt / KControls

Free components for Delphi and Lazarus, this is the main repository maintained by the original author.
BSD 3-Clause Clear License
58 stars 33 forks source link

TKMemo: Another approach to Undo #32

Open davidbannon opened 3 years ago

davidbannon commented 3 years ago

TK, firstly, sorry about creating a new ticket on this topic, I don't particularly want to be involved in the other ticket relating to undo because of its early history.

Secondly, sorry about (apparently) giving the impression that you will handle the second level tech support for tomboy-ng ! Never my intention and I will answer questions somewhat more carefully in future ! Promise ! I understand fully that you don't have the time right now to work on KControls.

I agree, to implement undo/redo the way you have obviously planned is your job, I had a quick look and really could not follow your plan at all. But I do think I can implement a lot less elegant and probably less efficient model using a stand alone unit. I have the bare bones working now. Its a unit that is declared in the same unit that declares a kmemo, does not interact with KControls at all (apart from calling several public methods). It turns out pretty neat actually, the new unit interacts more with KMemo's parent than it does with KMemo itself.

When and if I get it sufficiently polished to incorporate into tomboy-ng, if you are interested, I can sign it over to you. But a better approach might be for me to release it on my own github, that way, hopefully, questions will be directed to me rather than than to you. And the code is hardly likely to be up to your standard anyway.

Make sense ?

Davo

kryslt commented 3 years ago

Yes. Please add link to that unit here so I can find it when I'll start work on my own version. It can be useful to me.

Refers to #26.

davidbannon commented 3 years ago

Sorry, life keeps getting in the way ...

Please see https://github.com/davidbannon/kmemo_undo

I mention in the readme an exception to the license granting you, TK, the right to use what ever you want in any way you want. Just in case its some way useful...

I have tested it only superficially but its reasonably documented.

Thanks again for KMemo !

Davo

kryslt commented 3 years ago

Oh my god that is very nice, thank you! I did not test yet but from a quick look at the structure it follows many of my plans. When I get time to finally incorporate the feature directly to KMemo I'll certainly look into this. May I use this unit now as is in my own commercial projects? Because some customers of my company (using projects where KMemo is also present) complain about missing Undo as well. That would be a quick fix.

davidbannon commented 3 years ago

May I use this unit now.... ?

Absolutely, my intention is you should use that code as if it was written freshly by yourself. Definitely no attribution needed when used by you for anything to do with KControls. Given the help you have given me, its a trivial gift indeed. Maybe I should add a specific clause in the unit itself to that effect ? I find this legal stuff tiresome but understand, now, its necessary.

EDIT: I have updated to license on tbundo.pas to indicate you have unlimited rights. I bet the Debian licensing people would be horrified with the wording but it suits our needs !

Davo

davidbannon commented 3 years ago

Please note - that code has been tested only on Linux and only with FPC/Lazarus. And only superficially ! Am traveling at preset so don't have access to my Mac or Windows test bed .....

As a bare minimum, will need some ifdefs to get the right key codes on Mac. Don't think the silly two char line endings on Windows will be an issue but it has not been tested.

Davo

kryslt commented 3 years ago

I have updated to license on tbundo.pas to indicate you have unlimited rights.

Ok thank you.