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 previous 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

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


Current Time: Thu Apr 25 17:26:44 CEST 2024

Total time taken to generate the page: 0.02775 seconds