AdvCardList related question

Hello,


Does AdvCardList support items rearrange by mouse click  and drag? Is there any sample code available on how to implement this? :)

Regards

If you set in our demo for TAdvCardList the property AdvCardList.CardRearrange = true, you can rearrange cards with drag & drop.

Hello,


Thank you very much for your prompt reply. It looks like when setting the CardRearrange to true the selected card cannot be edited any more by mouse click. I had to add inherited after 9816 line in AdvCardList.pas to continue with the single click but I am not sure this is the correct way to do it.

Regards

This was by design because the click on a selected card would directly trigger the drag instead of putting the card into edit mode.

Hello, I have a similar problem.

When using CardRearrange and Anchors I have the problem that Anchors doesn't work, when a card is selected.
I found out, when adding "FDownXY := Point(X,Y);" at the same position mentioned above (in WMLButtonDown, line 9816/9817 after the "SetFocus") it works. In MouseUp there is a check if the position between MouseDown und MouseUp is changed, so it catch the problem to use anchors when moving the card. Maybe you can check, if this is a solution which works for all of us. Or maybe this tip gives you the hint you need, to have an idea to solve the problem.

Greetings from germany
 Peter Nomden

We have fixed this and we have also added a proprerty CardRearrangeType to select that a rearrange can only be started from dragging on the card caption.
This will be available in the next update.

That is great thanks!

But I have found another problem. In my application I have a TAdvCardList which throws an exception which can not be catched, because it it thrown anywhere because the repaint was called by WM_REPAINT-Window-Message. Let's collect some facts where I can reproduce the problem in our software:
- There is an Window embedded in another Window (MDI-Window) on this window there is a OfficePager with a cardlist on page 2.
- In the CardList there are 2 Cards to be displayed.
- A Timer refresh the cards. But in my example I don't change the data, so there always be the two cards.
- First I use "BeginUpdate" before changing anything.
- Secound I clear the CardList.
- in a while-block I create the 2 card (from the data I have from a query, but this would not be relevant).
- The SortSettings.SortType is "stItem".
- In TAdvCardList.Cards.Add(); there raises the exception.

Some relevant places are:
- "GetItemCalueRect(ItemN, R);", Line 4910 from AdvCardList.
- "... CalcListRects(Cards.Items[FSortedCards[n]] ..." from Line 7716 from AdvCardList

The problem seems to be, that "FSortedCards" have the 2 Cards (from before the BeginUpdate)
and the Cards.Items have only the 1 Card which is actually added.
When I don't use BeginUpdate/EndUpdate the error don't raise.
When using SortSettings.SortType stNone the error don't raise.
What I'm a bit curious about is, that the error only raise, when using die Window as MDI.
In the first OnTimer-Event the exception don't raise which is clear for me because there would be 0 cards in "FSortedCards" from before the BeginUpdate.

The question is: Should "FSortedCards" just hold (the actual) 1 Card-Info (instead of the 2 from before BeginUpdate), or should repaint not be called since "BeginUpdate" is set.

In my app I "solve" this problem simply by commenting BeginUpdate and EndUpdate out. Additionaly I set SortType to stNone, so the problem is double-save corrected. But I think this is a problem you hopefully can solve. I'm Sorry, that I don't have the time to build a example-app with the reproduceable error, at least I don't know if I could build one to surely create this error.

Finally thanks for reading so far and a nice day.
Greetings from Germany
 Peter Nomden 

PUSH

No Idea about this?

Greetings from Germany
 Peter Nomden

I would really appreciate that this can be isolated into a sample source app with which we can reproduce an issue here. There appear to be so much things involved (MDI,OfficePager, Timer, Sorting, ...) we only partially get some information about that it is very hard and especially a lot of guesswork to try to understand this, let alone to suggest a solution for it.