DATAGRID dgDragImageIndex problem

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

DATAGRID dgDragImageIndex problem

JosepM
Hi List,

I have a problem with dgDragImageIndex, at first drag&drop operations the image is correct, some one after the image change to any random, and no more show the correct image for the row selected.

Any idea?


on dragStart
   
   put the dgIndex of the dgDataControl of the target into theIndex
   
-->   set the dgDragImageIndex of me to theIndex
   set the dragData["private"] to "data grid row" & cr & theIndex
   
   ## Tell Data Grid to track drag reordering
   --set the dgTrackDragReorder[theIndex] of me to true
end dragStart
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

Trevor DeVore
On Jul 20, 2010, at 10:19 AM, JosepM wrote:

> I have a problem with dgDragImageIndex, at first drag&drop  
> operations the
> image is correct, some one after the image change to any random, and  
> no more
> show the correct image for the row selected.

The Data Grid is just setting the dragImage property to the id of an  
image named "dgDragImage" that resides inside the Data Grid group. You  
could try checking that the dragImage is the id of image "dgDragImage"  
of group "Data_Grid_Name".

Check out the rules for search order when locating the image used in  
dragImage in the docs:

http://docs.runrev.com/Property/dragImage

Another option is that some stack is being opened that has the same id  
as the dgDragImage image and the engine is using that instead.

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

JosepM
Hi,

set the dgDragImageIndex of me to the ID of image "dgDragImage" of me

Now no image is showed... :(



Salut,
Josep
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

Trevor DeVore
On Jul 20, 2010, at 11:33 AM, JosepM wrote:

> set the dgDragImageIndex of me to the ID of image "dgDragImage" of me
>
> Now no image is showed... :(

That is because you can't do that :-)

dgDragImageIndex is an index within the data grid array, not the id of  
an image.

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

JosepM
Hi,

Still the same, show other image... :/   buff...


put the dgIndex of the dgDataControl of the target into theIndex

set the dgDragImageIndex of me to theIndex

I don't see how refer to the dgDragImage
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

Trevor DeVore
On Jul 20, 2010, at 11:51 AM, JosepM wrote:

> I don't see how refer to the dgDragImag


put the id of the image "dgDragImage" of group "YOUR_DG_GROUP_NAME"

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

JosepM
Yes, this is that I do, but the image is empty...

The script:

on dragStart
   
   put the dgIndex of the dgDataControl of the target into theIndex
   
   --set the dgDragImageIndex of me to theIndex
   set the dgDragImageIndex of me to the id of the image "dgDragImage" of me
   set the dragData["private"] to "data grid row" & cr & theIndex
   
   ## Tell Data Grid to track drag reordering
   --set the dgTrackDragReorder[theIndex] of me to true
   
   
end dragStart
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

Trevor DeVore
On Jul 20, 2010, at 12:16 PM, JosepM wrote:

> Yes, this is that I do, but the image is empty...
>
> The script:
>
> on dragStart
>
>   put the dgIndex of the dgDataControl of the target into theIndex
>
>   --set the dgDragImageIndex of me to theIndex
>   set the dgDragImageIndex of me to the id of the image  
> "dgDragImage" of me

DO NOT set the dgDragImageIndex to the id of the image. It is an index  
value. Set it to an index.

Again, you should start by checking the id of the image and comparing  
it to the dragImage. Insert this code after you assign the  
dgDragImageIndex:

put the id of the image "dgDragImage" of me & cr & the dragImage

If the values are the same then the dragImage is being assigned  
properly. Next confirm that the image has the data you expect.

Replace the code that outputs the id of the image with code that  
copies the image data to the clipboard:

set the clipboardData["image"] to the text of image "dgDragImage" of me

Paste the clipboard image somewhere where you can see it. Is it your  
row? If so then the data grid code is doing what it is supposed to.

If both of the above tests pass then you need to track down the image  
in another stack that has the same id as the dgDragImage of your data  
grid. Start searching for an image with the same id in any open  
stacks. Once you find it let us know and we can figure out how the  
engine is searching for the image to use and determine how to fix your  
problem.

Regards,

--
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com    -    www.screensteps.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

JosepM
Hi,

>If the values are the same then the dragImage is being assigned  
>properly.

The values are the same.

>Next confirm that the image has the data you expect.

The image is different.
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

Trevor DeVore
On Jul 20, 2010, at 3:27 PM, JosepM wrote:

> The values are the same.
>
>> Next confirm that the image has the data you expect.
>
> The image is different.

And what does it look like? Does it look like what you are seeing  
while dragging or something else?

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

JosepM
> And what does it look like? Does it look like what you are seeing  
> while dragging or something else?

It's the same that I see when dragging. But this isn't the row image.
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

Trevor DeVore
On Jul 20, 2010, at 3:49 PM, JosepM wrote:

>> And what does it look like? Does it look like what you are seeing
>> while dragging or something else?
>
> It's the same that I see when dragging. But this isn't the row image

Edit the script of the data grid behavior:

edit script of btn "Data Grid" of stack revdatagridlibrary

Look for the command "_CreateDragImageFromIndex".

In that handler is the following line of code:

export snapshot from rect theRect of this card to image "dgDragImage"  
of me as PNG

My *guess* is that "this card" is not resolving to the card that the  
data grid is on. Try adding a logging function that outputs the long  
name of "this card".

...
put the long name of this card
export snapshot from rect theRect of this card to image "dgDragImage"  
of me as PNG
...

Is it a card other than the card with the data grid on it? If so, who  
is it?

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

zryip theSlug
In reply to this post by JosepM
On Tue, Jul 20, 2010 at 9:49 PM, JosepM <[hidden email]> wrote:

And is it the image of another row? Always the same image?

I encounter one time the same behavior but it was my fault and
generated by my own code. I had two images with the same name in the
row. But by using the standard dgDragImageIndex, it is not possible to
encounter this.


>
>> And what does it look like? Does it look like what you are seeing
>> while dragging or something else?
>
> It's the same that I see when dragging. But this isn't the row image.
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/DATAGRID-dgDragImageIndex-problem-tp2295566p2296143.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

JosepM
In reply to this post by Trevor DeVore
I modified the script but nothing happen, almost I don't see any in the msg..

I edited and saved it but nothing.

Salut,
Josep
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

JosepM
In reply to this post by zryip theSlug
> And is it the image of another row? Always the same image?

No, the image don't belong to any row. Always the same image.
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

Trevor DeVore
In reply to this post by JosepM
On Jul 20, 2010, at 4:22 PM, JosepM wrote:

> I modified the script but nothing happen, almost I don't see any in  
> the msg..
>
> I edited and saved it but nothing.

Are you using a form or a table? I gave you the code for modifying a  
table so if you are using a form the code wouldn't have fired.  The  
form code is located in "_CreateDragImageFromControl". But that code  
doesn't use a "this card reference" so I don't see how it could have a  
problem.

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

JosepM
Yes, I'm using a Form.. :(
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

zryip theSlug
In reply to this post by JosepM
On Tue, Jul 20, 2010 at 10:23 PM, JosepM <[hidden email]> wrote:
>
>> And is it the image of another row? Always the same image?
>
> No, the image don't belong to any row. Always the same image.

Is it the first time you use the drag & drop capacity in this project?
Did you have other grids in the project?, other stacks?

I have in mind a radical solution which could consist to locate and
remove all the image "dgDragImage" in the project in order to let the
DG engine recreate it with a correct and not conflictual ID.

--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

JosepM
Yes, the first time I use drag drop operations.

Yes, I have other datagrids in others cards of this stack.

It's strange. If I restart the IDE, the drag image is correct until I load the preview of Quartam Reports, then one image used into the report is that replace the drag image.

Reply | Threaded
Open this post in threaded view
|

Re: DATAGRID dgDragImageIndex problem

Trevor DeVore
On Jul 20, 2010, at 6:04 PM, JosepM wrote:

> It's strange. If I restart the IDE, the drag image is correct until  
> I load
> the preview of Quartam Reports, then one image used into the report  
> is that
> replace the drag image.

Try the following -

In the Data Grid behavior script find the command  
_CreateDragImageFromControl.

Change the line:

export snapshot from pControl to image "dgDragImage" of me as PNG

to

export snapshot from pControl of me to image "dgDragImage" of me as PNG

Does that fix the problem?

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
12