Forums

Welcome Guest Search | Active Topics | Members

Rearrange Thumbnail Options
undead80
Posted: Saturday, February 09, 2008 6:51:40 PM
Rank: Member
Groups: Member

Joined: 1/8/2008
Posts: 28
Points: 84
Hi,

May I know is there anyway we could let the user drag and drop to rearrange the thumbnail?

Please advice.

Thanks in advance.
Alex Kon
Posted: Monday, February 11, 2008 3:27:43 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 1/31/2005
Posts: 386
Points: 403
Hello,

Try to set ThumbnailListView.UseDragToMove property to "true".



Best wishes, Alex.
undead80
Posted: Monday, February 11, 2008 5:07:44 PM
Rank: Member
Groups: Member

Joined: 1/8/2008
Posts: 28
Points: 84
Alex Kon wrote:
Hello,

Try to set ThumbnailListView.UseDragToMove property to "true".



Hi,

May I know which event will be fired when the user "dragtomove"?

Please advice.
undead80
Posted: Monday, February 11, 2008 5:43:12 PM
Rank: Member
Groups: Member

Joined: 1/8/2008
Posts: 28
Points: 84
Alex Kon wrote:
Hello,

Try to set ThumbnailListView.UseDragToMove property to "true".



Hi

Beside that

_thl.Items.Insert(PageIndex, New Aurigma.GraphicsMill.WinControls.ThumbnailListItem(pidl))

When I insert item, seems like it will still appear @ the last item in the list and now following the index.

If I call _thl.Refresh, it seems like doesn't work too.
Alex Kon
Posted: Wednesday, February 13, 2008 11:43:04 PM
Rank: Advanced Member
Groups: Administration , Member

Joined: 1/31/2005
Posts: 386
Points: 403
Hello,

Regarding to the first question - all standart drag-n-drop events will be fired (DragOver, DragEnter, DragDrop).

As for Insert(...) method - there is no obligatory correspondence between index in the ThumbnailListView.Items collection and visual order. Here is method which inserts item into the control and updates thumbnails visual order.

Code:
private void InsertItemToIndex(IListItem item, int index)
{
    if (index < 0 || index > _thumbList.Items.Count)
        throw new ArgumentOutOfRangeException("index");

    _thumbList.Items.Add(item);
    if (index < _thumbList.Items.Count)
    {
        int[] indexes = new int[_thumbList.Items.Count - index - 1];
        for (int k = index, i = 0; k < _thumbList.Items.Count - 1; k++)
               indexes[i++] = k;

       _thumbList.Items.Swap(indexes, _thumbList.Items.Count);
    }
}


Best wishes, Alex.
undead80
Posted: Thursday, February 14, 2008 8:14:03 PM
Rank: Member
Groups: Member

Joined: 1/8/2008
Posts: 28
Points: 84
Great !!! The Rearrange code works great !!!

And here is the issue...
We are trying to let the user rearrange the Thumbnail as we mentioned...
But, we do have internal array that keep track of the sequence together with details. Thus, we would like the array to be rearrange while the Thumbnail is being Rearranged. And yet, we would like to prevent the user to rearrange the 1st and the last thumbnail, (means the 1st and last thumbnail position is fix)

We also would like to prevent the Thumbnail being drag outside the Thumbnail Viewer, and also nothing else should be drag into the Thumbnail viewer.

Thanks in advance.
Alex Kon
Posted: Thursday, February 14, 2008 9:35:13 PM
Rank: Advanced Member
Groups: Administration , Member

Joined: 1/31/2005
Posts: 386
Points: 403
Hello,

As for internal array: the best way I see is to bind all your additional data to IListItems using IListItem.Tag property. Maybe you will be able to get rid of the internal array at all and use ThumbnailListView.Items collection instead.

Regarding to drag-n-drop specific of your application - as you understand, we have no such built-in feature. In your case simple "UseDragToMove" is useless, so you should to re-implement this functionality with additional restrictions for the first/last elements.

You can look at Aurigma.GraphicsMill.WinControls source code (not available in trial version) or at MultFrameTiff demo source code and use them as base point for your implementation.


Best wishes, Alex.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.