Menu PopUp
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Menu PopUp
Hi,
I have a pop up menu which uses a stack as the pop up menu. Within the stack there is a Scrolling List Field, some buttons and some Text Fields. The code for these controls is held within this Stacks script. When I click on the button it shows the stack in the drop down menu but when i click in the stack I can not get the code to run on the stack. The stack closes straight away and the code will only run within the dropdown script.
How can I send the menuPick message to the stack and 'cancel' the drop down cancel message
thanks
Phil
I have a pop up menu which uses a stack as the pop up menu. Within the stack there is a Scrolling List Field, some buttons and some Text Fields. The code for these controls is held within this Stacks script. When I click on the button it shows the stack in the drop down menu but when i click in the stack I can not get the code to run on the stack. The stack closes straight away and the code will only run within the dropdown script.
How can I send the menuPick message to the stack and 'cancel' the drop down cancel message
thanks
Phil
Re: Menu PopUp
Hi Phil,
Your stack should not contain any scripts that run after the stack closes. Scripts in closed stacks can't run.
You have to catch the menuPick message in the script of the button that opens the popup menu stack or higher up the message hierarchy.
If you use the scrolling field to make a choice, you could save this choice in a global variable. This variable will still be available after the stack closes. You can also use a custom property of an object that is stll available after the menu stack closes.
Kind regards,
Mark
Your stack should not contain any scripts that run after the stack closes. Scripts in closed stacks can't run.
You have to catch the menuPick message in the script of the button that opens the popup menu stack or higher up the message hierarchy.
If you use the scrolling field to make a choice, you could save this choice in a global variable. This variable will still be available after the stack closes. You can also use a custom property of an object that is stll available after the menu stack closes.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Menu PopUp
Hi Mark,
Thanks for your reply.
Currently I can not select items in the list box as when i click on an item in the list it closes the stack. I can use the menupick to catch the users action on buttons etc but it will only access the highlighted item in the listbox which is always the first item irrelevant of where i click.
thanks
Phil
Thanks for your reply.
Currently I can not select items in the list box as when i click on an item in the list it closes the stack. I can use the menupick to catch the users action on buttons etc but it will only access the highlighted item in the listbox which is always the first item irrelevant of where i click.
thanks
Phil
Re: Menu PopUp
Hi Phil,
As you have probably noticed, choices in menus are never made by clicking but by moving. Use the mouseMove handler to change the selectedLine of the list field. Make the list field scroll automatically if the mouse cursor is at the bottom or top of the field. Don't use a scroll bar.
Kind regards,
Mark
As you have probably noticed, choices in menus are never made by clicking but by moving. Use the mouseMove handler to change the selectedLine of the list field. Make the list field scroll automatically if the mouse cursor is at the bottom or top of the field. Don't use a scroll bar.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Menu PopUp
Hi Mark
Will the mousemove event still work on a iPad app?
Phil
Will the mousemove event still work on a iPad app?
Phil
Re: Menu PopUp
Hi Phil,
Yes, I believe it still works on an iPad, but an iPad interface is supposed to be different from a desktop interface so I wouldn't bother using LiveCode's menus.
Kind regards,
Mark
Yes, I believe it still works on an iPad, but an iPad interface is supposed to be different from a desktop interface so I wouldn't bother using LiveCode's menus.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Menu PopUp
Yeh, Im taking your advice on this and have decided to keep the app iPad native
Re: Menu PopUp
Hi Phil,
and since iOS only supports the display of ONE stack at a time,
popping up a STACK will not work anyway!
Best
Klaus
and since iOS only supports the display of ONE stack at a time,
popping up a STACK will not work anyway!
Best
Klaus
Re: Menu PopUp
Hey Klaus! That's a nice catch. Didn't think of that. Menus work, though. I wonder how that's done, internally.
Mark
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode