Best Way to Create a Menu

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
William Jamieson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 212
Joined: Fri Feb 01, 2013 1:31 am
Contact:

Best Way to Create a Menu

Post by William Jamieson » Thu Jul 31, 2014 8:06 pm

So if you pull out your iPhone or Android and you go onto your favorite social network app, you will see that there is a menu that slides in from either the right or the left of the screen. What are your ideas on the most efficient way to create this in LC?

Attributes:
-the menu can slide in with touch from the edge of the screen without leaving or altering the current window
-the menu slides back and forth with the mouseLoc
-the menu snaps into position when released showing the previous screen in the back edge
-the menu is now scrollable
-when the menu slides back, the old screen if nothing selected appears in the same state, or changes to the new screen if there is a selection
-when pulling out the menu again, it remembers if you had scrolled halfway down or not
-The menu exists on every card in the application

Deciding factor:
-Build with Datagrid?
-Build with grouped objects and a native scroller?

What would you do?

-Will

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Best Way to Create a Menu

Post by Simon » Thu Jul 31, 2014 8:40 pm

Here you go Will,
http://forums.livecode.com/viewtopic.php?f=49&t=16981
Ender's excellent work.
I think that is what you are asking for?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

William Jamieson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 212
Joined: Fri Feb 01, 2013 1:31 am
Contact:

Re: Best Way to Create a Menu

Post by William Jamieson » Wed Aug 13, 2014 6:30 pm

Yeah thanks Simon! That is a really good example. I had a look through the code. It looks like it will work well for static or scrolling objects or groups. I think that is definitely step 1 complete of the total scope. I suggest to anyone reading this thread that they look at the above link posted by Simon and download the link at the bottom of the page.

step 2 would be to implement scrolling into each of the fields and step 3 would be to implement scrolling momentum and physics as well as physics in the slide.

So now the question is how to implement native scrollers if possible (included physics) on both panels such as the Merg Datagrid scroller and the native group scroller for mobile. I know that they are delivered by the operating system on top of the app so they might have to be created and destroyed upon locking the panels into place. Also, by having a datagrid sliding, one would have to define what a selection touch to the datagrid might be and a touch for when the person is looking to swipe to the menu.

Hmm. I think something I am going to try is just create a sample stack with a datagrid with a mergDatagridScroller and move it back and forth across my stack and see how it behaves. Let me know if you have any thoughts.

-Will

William Jamieson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 212
Joined: Fri Feb 01, 2013 1:31 am
Contact:

Re: Best Way to Create a Menu

Post by William Jamieson » Wed Aug 13, 2014 6:57 pm

Ooops! I played around with the stack and I realized that I was wrong about the order of the steps!!

2nd step: Figure out how to keep part of the screen (such as a banner at the top) static and unchanged while the rest of the card comes in.

3rd step: Find out how to keep the card that one is trying to load on the edge of the screen while it changes, and keep the menu in the same state as it was on the previous card during the change of cards

AND THEN do the steps in the previous post.

(can't forget the important stuff!) :D

Post Reply