Sub-Card???

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
DaltonCalford
Posts: 22
Joined: Fri May 06, 2011 7:33 pm

Sub-Card???

Post by DaltonCalford » Wed Jul 27, 2011 6:09 pm

I am looking for a control that acts like a partial card - ie it is part of the current stack, but sits above the current card and is smaller.

In Delphi, I can have a "Tpanel" which can be switched in and out easily and can be set to auto-resize in regards to it's parent control.

I have looked in livecode and the closest I have found is the use of groups, but, between hiding/unhidding objects and having all sorts of "if this or that" type of code to determine which group is active, it is a bit cumbersome.

I am attempting to build a menu structure that follows the windows7/vista environment.

For those of you who have created such a beast, can you give me some guidance as to how you approached this?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9660
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Sub-Card???

Post by dunbarx » Wed Jul 27, 2011 6:27 pm

If none of the usual controls work for you, why the hesitation to use another stack, sized and populated as you need? This stack, though not a "card" of the main stack, can be a substack, and is therefore part of the stack file, so it travels well. It can be a palette or modal style.

I only mention this because I got the feeling you wanted to stay in one stack, perhaps for simplicity. This may cause more complexity than it solves. LC handles multiple stacks very well, much better than Hypercard did, and they can be integrated easily into a conceptually single idea. I do not see a downside; whatever you might have done to manage your "subCard" can be identically done with a subStack.

Craig Newman

DaltonCalford
Posts: 22
Joined: Fri May 06, 2011 7:33 pm

Re: Sub-Card???

Post by DaltonCalford » Wed Jul 27, 2011 6:39 pm

Hi Craig,

Think of a word processor - you have a toolbar on the top of the form that changes depending upon what you are doing and where you are doing it.

With sub-stacks, I would have to be flipping stacks as the user moves through the document - without the user noticing......

Or, I can try to have one stack float above the main form while making the main form keep track of where it is and having the main form controls resize based upon the placement of the sub-stack.

Also, sub-stacks are not portable across platforms - android does not support sub-stacks the last time I looked - each stack opens full screen, not very useful on a tablet device.

Toolbars, menus, tab bars etc all dynamically change in modern interfaces in regards to the users actions within the application. Changing the whole form for every possible layout, when you are just changing a tab sheet is not practical.

Now, when you try doing it with groups, you may have different event handlers depending upon the tab you are on, so you need to keep your code on the group, but the groups may be dynamic, as users add or remove optional icons from the tab/menu/toolbar.

With other languages, you can have a single unit that holds all your standard actions and then link the various event handlers of objects to specific objects via pointers. Live code is different and I am trying to find the best method of doing this sort of thing.

It appears that livecode would require more code than other languages to perform the same task, which is opposite of what I have read on various blogs/forums. I am just trying to get an idea of how a seasoned livecode operator would approach such a problem.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”