Sunday, March 3, 2013

New Line Change Detection – Inserting Text

The insert text function of the edit box was implemented to process text inserted into the program so that changed lines could be detected and reported.  It was used to insert a new line, for the return key, the reimplemented pasted function, and the paste selection function (middle-click paste on Linux).  This function is not longer needed and was removed.  The code for the return key was already changed to simply use the insert text function of the text cursor (and the document change function handles the line change detection).

The other two uses were also updated starting with the reimplemented paste function originally necessary to catch the paste action (menu, context menu, and tool bar) and call the insert text function.  The paste function is no longer necessary since the document change slot function will be called for all paste operations.  Therefore the reimplemented paste function was removed.  The check for the paste key sequence is also no longer necessary (will be handled by the plain text edit base class key event handle, which will call the document change slot function).

The mouse release event handler was reimplemented in the edit box class to catch the middle-click paste of the selection and call the insert text function.  This is also no longer necessary, so the handler function was removed.  However, the paste selection function, which was called from the mouse release event handler, is also called for the Control+Shift+Insert key sequence to pasting the selection.  This is still needed, so the insert text function call was replaced with the text cursor insert text function.

[commit 361f10a7f5]

No comments:

Post a Comment

All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)