Forums > Dev

Creating a double-click drop-down menu.

February 3, 2008 | 2:11 pm

Hi,

Is there by any chance someone who has tried to create a double-click drop-down menu on their external similar to the feature of send/receive? Would it be hard to do?

Cheers,
Mattijs


February 4, 2008 | 11:15 am

Not that hard, but there are some tricky points.

Basically, you write a method and bind it to the dblclick message. I do this in Litter Power objects to post state information to the Max window, dead easy & dead useful. So far, so good.

The menu drawing routine would be OS-dependent. On Mac OS/Carbon you would, I think, dynamically create & draw an on-screen popup. BTW, Max 5 may or may not mean migrating to Cocoa (btw, is there any word out on that issue?), so that might change. On Windows you would probably create a Combo Box or something. Either way you let the user interact and then handle the result.

If you want to popup only in response to something like cmd-shiftlock-dblclick you’ll have to poll the keyboard state yourself because the dblclick method signature doesn’t pass you modifier keys.-( This is not hard, but also requires conditional compilation for Mac OS & Windows.

Hope this helps.


February 4, 2008 | 11:24 am

Thanks for this, Peter, that definitely helps.

So there is no such thing in the max api, I’ll have to get into OS-specific libraries for this. I don’t have much experience in that field but maybe I’ll give it a go.

There is no chance that cycling ’74 would paste a small piece of code from the send/receive objects, I assume? ;)

Mattijs

Quote: Peter Castine wrote on Mon, 04 February 2008 12:15
—————————————————-
> Not that hard, but there are some tricky points.
>
> Basically, you write a method and bind it to the dblclick message. I do this in Litter Power objects to post state information to the Max window, dead easy & dead useful. So far, so good.
>
> The menu drawing routine would be OS-dependent. On Mac OS/Carbon you would, I think, dynamically create & draw an on-screen popup. BTW, Max 5 may or may not mean migrating to Cocoa (btw, is there any word out on that issue?), so that might change. On Windows you would probably create a Combo Box or something. Either way you let the user interact and then handle the result.
>
> If you want to popup only in response to something like cmd-shiftlock-dblclick you’ll have to poll the keyboard state yourself because the dblclick method signature doesn’t pass you modifier keys.-( This is not hard, but also requires conditional compilation for Mac OS & Windows.
>
> Hope this helps.
—————————————————-


Viewing 3 posts - 1 through 3 (of 3 total)