RB 5.1 Drag and Drop Garbage 
Author Message
 RB 5.1 Drag and Drop Garbage

Anyone else run into problems with the Drag-and-Drop behaviour in 5.1?
(The following works fine in 5.0.)

Extracted from my Canvas MouseDown event handler:
...
theDragText = "xOffset=" + str(me.Left) + chr(9) + "yOffset=" +
str(me.Top)
theDragText = theDragText + chr(9) + theActivity.CreateDragText()

theDragWidth = me.columnWidth
theDragHeight = theActivity.GetNumberOfSlots*me.slotHeight
theDragX = theActivity.GetColumn() * me.columnWidth + me.xOffset +
self.Left
theDragY = theActivity.GetTimeslot() * me.slotHeight + me.yOffset +
self.Top
theDragItem = NewDragItem(theDragX, theDragY, theDragWidth,
theDragHeight)
theDragItem.Text = theDragText
theDragItem.Drag
...
return True

In 5.1, the dragItem text goes in just fine, but ends up looking an
awful lot like Japanese characters when I process the drop. The other
information is transferred without problem. (Curiously, when I pass a
string constant identical to the variable one passed above, it doesn't
do any Far East translations.)

I suspect that this has to do with text encoding changes in 5.1.

Anyone experienced this? Anyone have a work-around?

-- Tom



Sat, 05 Nov 2005 12:02:13 GMT  
 RB 5.1 Drag and Drop Garbage


Quote:
> theDragText = "xOffset=" + str(me.Left) + chr(9) + "yOffset=" +
> str(me.Top)
> theDragText = theDragText + chr(9) + theActivity.CreateDragText()
>           ...
> theDragItem.Text = theDragText

> In 5.1, the dragItem text goes in just fine, but ends up looking an
> awful lot like Japanese characters when I process the drop. The other
> information is transferred without problem. (Curiously, when I pass a
> string constant identical to the variable one passed above, it doesn't
> do any Far East translations.)

> I suspect that this has to do with text encoding changes in 5.1.

I suspect so too.  I bet if you display theDragText in a StaticText or
EditField, you'll find it's messed up there too.  Hard to guess why,
since we don't know what theActivity.CreateDragText is doing, and that's
obviously the critical part.  But apparently it's returning text with
unknown encoding.  Fix that, and your drag will work reliably.

Cheers,
- Joe

,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'



Sun, 06 Nov 2005 01:11:01 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Drag and Drop - How to get what was dropped onto

2. From Demo to Full RB 5.1

3. Printing Problems on Window with RB 5.1 for both the mac and windows

4. RB 5.1 and EditableMovies

5. RB 5.1 windows : Is it a joke ?

6. Drag and Drop from non-List widgets?

7. Drag and Drop

8. drag-drop help please....

9. APL2000 Tree Control Drag & Drop

10. Visual (drag/drop) View Presenter Finder...

11. Drag and Drop question

 

 
Powered by phpBB® Forum Software