Status & Roadmap
Authors & License
Funding Ultimate++
Search on this site
Search in forums

SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » How do I detect if the data in a RichEdit was changed by user?
How do I detect if the data in a RichEdit was changed by user? [message #53028] Wed, 12 February 2020 10:47 Go to next message
slashupp is currently offline  slashupp
Messages: 196
Registered: July 2009
Experienced Member
I have a RichEdit in a tab, and when the user clicks away I want to save the data if it was changed, but
I cannot determine how to find out if the data was changed.

IsModified() does not seem to work as advertised Smile and I cannot find any other clue.

An obvious way would be to check if it contains undo-dat, but for some reason undo-buffer is
not accessible (why-ever not?) and using PickUndoData() CLEARS the editor (why?)

[Updated on: Wed, 12 February 2020 11:56]

Report message to a moderator

Re: How do I detect if the data in a RichEdit was changed by user? [message #53035 is a reply to message #53028] Fri, 14 February 2020 09:00 Go to previous message
mirek is currently offline  mirek
Messages: 12179
Registered: November 2005
Ultimate Member
Admittedly, the issue is that IsModified queries the whole widget tree, which I now find quite confusing. Anyway, current solution is IsModifySet.

That said, I agree that current situation is confusing, so I am changing
ResetModify -> ClearModify
ClearModify -> ClearModifyDeep
IsModifySet -> IsModified

(While this is quite a change of contract, search through all of my projects revealed that a) Modify flag is really not used that much often b) current use actually rather expects above behaviour).

All that said, this whole solution is not able to check for the situation where you change data and change it back. So maybe even better would be to actually compare original content witch current one, or its hash...
Previous Topic: Does a Ctrl may be a RichObject ?
Goto Forum:

Current Time: Mon Feb 17 08:34:11 CET 2020

Total time taken to generate the page: 0.01286 seconds