Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
182 user(s) are online (173 user(s) are browsing Forums)

Members: 2
Guests: 180

afxgroup, VooDoo, more...

Support us!

Headlines

 
  Register To Post  

[SOLVED] MUI : NList notify on "end of multiselection" or "Mouse-Up" event
Just can't stay away
Just can't stay away


See User information
Hi,
With MUI NList in C, I'm searching for a way to be notified when the user end a multiselection (or when the mouse-click is released) on a NList.

I have searched in the Autodocs a notification similar to MUIA_Pressed,FALSE for the buttons.

For example, I would like to know when a user end to multi-select elements of a NList.


Is it possible ?

Thank you by advance


Edited by zzd10h on 2013/9/3 15:48:32
Edited by zzd10h on 2013/9/6 22:45:27
Go to top
Re: MUI : NList notify on "end of multiselection" or "Mouse-Up" event
Just popping in
Just popping in


See User information
Quote:
For example, I would like to know when a user end to multi-select elements of a NList.

Is it possible ?


Short answer: No.
Long answer: No, for what do you need it? You can never know when a multi selection is finished, because it is possible to add further elements to the selection at any time. A multi selection must not necessarily consist of adjacent elements.


Edited by tboeckel on 2013/9/3 19:50:53
Go to top
Re: MUI : NList notify on "end of multiselection" or "Mouse-Up" event
Just can't stay away
Just can't stay away


See User information

Thank Thore,
right I can't know when a multi-selection is ended but it will be enough for me to know when the mouse is released during a multi-selection.

In my program, I have a NList including songs.

When a song is selected, it calls a function who search for MP3 tags including cover (to display in a Bitmap object).

The problem is when I multi-select NList, this "search for tags" procedure is called many times. It's useful just for the last selected element of the NList

What I would like is to call this "search for tags" procedure only when the mouse is released. Even if the user adds elements to the selection, it's not a problem.

Is it possible to be notified when the Click is released (like the MUIA_Pressed FALSE for Buttons) ?

Thank you

Go to top
Re: MUI : NList notify on "end of multiselection" or "Mouse-Up" event
Just can't stay away
Just can't stay away


See User information
Maybe you could simplify/generalize by always, when a song selection is being made (whether it's part of a multi-select or not), check whether you are displaying the info for whichever song is the last one selected in the list, and if not, call your search function for it.

If only one song is selected, it will still be the last one selected, so you shouldn't need to distinguish (from a purely algorithmic point of view).

Best regards,

Niels

Go to top
Re: MUI : NList notify on "end of multiselection" or "Mouse-Up" event
Just can't stay away
Just can't stay away


See User information
Thank you for the suggestion nbache, but the problem is that each element will be the last one at a moment (when selected to be added to the selection)

Nothing related, nbache, but PM sent for NetDock.


Go to top
Re: MUI : NList notify on "end of multiselection" or "Mouse-Up" event
Not too shy to talk
Not too shy to talk


See User information

Typically one would start to render on the first selection event and ignore new events while rendering is going on and when rendering has finished start rendering the last selection.

Another approach would be to start a timer when the first event arrives, then on every new event reset the timer and only when the timer comes to an end render the last selection which was received.

Go to top
Re: MUI : NList notify on "end of multiselection" or "Mouse-Up" event
Just can't stay away
Just can't stay away


See User information
Thank you Thomas for the Timer solution, seems to be a good way to make what I want.

Go to top
Re: MUI : NList notify on "end of multiselection" or "Mouse-Up" event
Just can't stay away
Just can't stay away


See User information
Solved thank to Timer idea of Thomas.

i set up a Timer who expire in 1 second if no new selection stop and restart it.


Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project