Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » LineEdit, EditFields, DocEdit » BUG: LineEdit "Drag And Drop" violates read-only state
BUG: LineEdit "Drag And Drop" violates read-only state [message #38768] Wed, 16 January 2013 08:00 Go to next message
navi is currently offline  navi
Messages: 107
Registered: February 2012
Location: Sydney, Australia
Experienced Member
Hi All,

If you add 2 LineEdit ctrl in your window and 1 of them is read-only. if text drag from read-only LineEdit to a non read-only LineEdit ctrl text are moved from read-only ctrl to other ctrl. Essentially violating the read-only state of the read-only ctrl.

I have investigated the DragAndDrop(Point p, PasteClip& d) function of the LineEdit ctrl in LineEdit.cpp Line:777. And found that the writer of the function put a safeguard for such an issue in the first line. see follwoing:

LineEdit.cpp Line:777

void LineEdit::DragAndDrop(Point p, PasteClip& d)
{
        //My FIX::
        //if(IsReadOnly() || GetDragAndDropSource()->IsReadOnly()) return;

	if(IsReadOnly()) return;
...
}




however in reality in "dragging & dropping" action, half the action triggers execution of the DND function of the source ctrl. and other half the triggers execution of the DND function of target ctrl. Since target ctrl is not read-only, the function executes and the text is moved from read-only ctrl to a non read-only ctrl.

attached project is elaborate test example & fix example.

[Updated on: Wed, 16 January 2013 08:01]

Report message to a moderator

Re: BUG: LineEdit "Drag And Drop" violates read-only state [message #38805 is a reply to message #38768] Sat, 19 January 2013 14:47 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13442
Registered: November 2005
Ultimate Member
Excellent bug report. Fix is not quite correct, as I guess we still want to drag from RO fields, so I have used slightly different patch.

Fixed.

Mirek
Re: BUG: LineEdit "Drag And Drop" violates read-only state [message #38809 is a reply to message #38805] Sat, 19 January 2013 15:29 Go to previous messageGo to next message
navi is currently offline  navi
Messages: 107
Registered: February 2012
Location: Sydney, Australia
Experienced Member
mirek wrote on Sat, 19 January 2013 14:47

Excellent bug report. Fix is not quite correct, as I guess we still want to drag from RO fields, so I have used slightly different patch.

Fixed.

Mirek


Thanks for fixing. I wanted to device the fix with DND still enable for RO fields but my understanding of DND function in LineEdit isn't clear enough to get me there. can't wait to get my hands on your fixed code and see if its improves my understanding.

regards
Navi
Re: BUG: LineEdit "Drag And Drop" violates read-only state [message #38811 is a reply to message #38768] Sun, 20 January 2013 02:11 Go to previous message
navi is currently offline  navi
Messages: 107
Registered: February 2012
Location: Sydney, Australia
Experienced Member
Very Happy Just confirming I have tested the fix/patch is working 100% since the following

nightly builds
01/19/2013 01:20:20 upp-x11-src-5717.tar.gz
01/19/2013 01:17:05 upp-win32-5717.exe

Thanks & Regards
navi

Previous Topic: How to capture Key Press events?
Next Topic: Should EditField::Paint respect IsEditable method???
Goto Forum:
  


Current Time: Sat Oct 23 16:25:52 CEST 2021

Total time taken to generate the page: 0.01338 seconds