Detect end of drag in listbox

Hello All,

I needed to update listbox after moving row in the same listbox, because the first column is list of number.
I have tested the code in ‘Change’ Event, not works because i can edit cell.

Any suggestion ?

Thanks
Olivier

Use the DragReorderRows event. It is called when you drop the row.

Hi Tim,

I have tested this event, not works because this event is executed before the moving row.

Another suggestion ?

Thanks
Olivier

Without seeing code its hard to know how you tested it
Tims right
DragReorderRows is the right one
http://documentation.xojo.com/index.php/ListBox.DragReorderRows

[quote=124504:@Olivier Gossuin]I have tested this event, not works because this event is executed before the moving row.

[/quote]
No it’s not.

It most definitely is fired after the drop.

If it did not my code to drag reorder a hierarchical listbox would not work… and it does.

  • Karen

My code is not secret: http://www.gossuin.be/xojo/Oven.zip

Clic New on toolbar, after clic 3x Add.
For example move the row 3 to 2, the message box appear before the row move in listbox.

Thanks
Olivier

[quote=124515:@Olivier Gossuin]Clic New on toolbar, after clic 3x Add.
For example move the row 3 to 2, the message box appear before the row move in listbox.

[/quote]

You don’t quite understand what is going on…

DragReorderRows fires after the drop, but before before the row is actually moved. It would do no good otherwise. It allows you to handle the actual reordering if you want.

I suggest you read the docs Norm linked to again.

  • karen

you can always start a timer which does something 1 millisecond later.

Thank you all for responding.

For the answer to does matter, there is no event after the drop.
It does not matter to me.

Thank you
Olivier

I thought about that, but I think it actually even ‘DIY’.

The Change event fires after the drop.

Not Works, because the 2 row is edit mode.

Thanks
Olivier

[quote=124490:@Olivier Gossuin]I needed to update listbox after moving row in the same listbox, because the first column is list of number.
I have tested the code in ‘Change’ Event, not works because i can edit cell.[/quote]

Olivier, I tried very hard to understand this post, even downloaded your project to make sense, but this remains a mystery. I see that you are trying your best to say it, but the language barrier adds to the confusion.

The exchanges so far show only miscommunication, probably because you need to explain more clearly what you want to obtain.

Here is what I understand so far. Step by step being the only way to really make sense, let us try to communicate this way. Numbers will make it even clearer to correct if needed :

1 - In the lbHeating Listbox of the winWave window entitled “Wave”, add several steps with temperature and time
2 - Drag a step up the list, for instance take 7 at 300 degrees for 5 minutes, under 1
3 - After the drag, the first column reads from top to bottom 1,7,2,3,4,5,6

Now if I understand right, you want to keep the steps in the new order, so the rows must stay where they are, but you want column zero to read 1,2,3,4,6,7. Is it the result you want ? Have I understood right ?

Just a few remarks. Please do not take them personally, they are just the result of trying to use your app, but could improve it with very little effort.
Sure, your “close” icon is cute, but it is really not ergonomic. Why have you removed the close button, and deprived the user of his standard interface ?
With the same concern, the standard keyboard shortcut to close a window under Mac OS X is CMD-W and Windows Ctrl-W. Why not implement that very simple command ? Never forget that users have been accustomed to use that for dozens of years in standard applications and really resent being greeted by a beep instead.
Do not forget to add File, Edit and Window menus for Mac users, if you want to have any chance ever to sell your app in the Mac App Store. I understand in Windows it looks redundant, since the toolbar is here, but on Mac, the menu is not on the window. And is required by the Human Interface Guidelines.

Michel - regarding the last few sentences of your above post - are you saying that for the MAS - every app MUST have a Window menu title?

Even when I start a new project, there is no windows menu title created by default - only the File and Edit?

Thanks.

[quote=124630:@Richard Summers]Michel - regarding the last few sentences of your above post - are you saying that for the MAS - every app MUST have a Window menu title?

Even when I start a new project, there is no windows menu title created by default - only the File and Edit?[/quote]

I had an app rejected last year because it had no Window menu, and am not the only one, it happened to other members as well. Apple reviewers have their pet things. Just throw one in your app and you will be fine.

Does it have to be visible? Or just created?
Thanks.

It would have to be visible for them to know it was there.

How do you know what they are capable of finding out.

Richard, Apple reviewers do work with every aspect of your app. If they do not see a Window menu, they will reject your app. If the File menu is empty, or the Window menu, they will reject your app.

I have had all sorts of rejections since I have apps in the MAS. I assure you these are very conscientious people. I may not always like seeing my app rejected, but at least I know when it has been accepted, it is conformant to all Apple guidelines.

Michel - my statement you quoted was in response to Tim’s post (not yours) :slight_smile:
I will add a Window menu (but it will be empty??)