Card Size

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Card Size

Post by lohill » Sat Mar 20, 2010 6:03 pm

What are the tricks for getting stacks to open and show all of what you want to be showing on the card. Typically my cards have some text fields at the top, a dataGrid in the middle and some buttons at the bottom. I can struggle to make the window just the size I want and set the geometry of the objects so that when the window is resized everything moves as desired. I can then save the stack and quit Rev. The next time I start Rev and open that stack, the buttons at the bottom are not showing or only partially showing. If I resize the window I can make the buttons appear as they should and they stay visible while I use the stack.

If I compile the application to a standalone, the truncated windows show up in most of my stacks and even those that are opened modally. Resizing them takes care of the problem for that use of the application but they are truncated the next time the application is run. It seems pretty silly to me to have to resize with every use.

This brings me to another question that may be related to my problem. While working in the IDE, what gets 'Saved' when you take the Save option from the File Menu? Also, what gets saved when you press the 'Close' button (red) on a Mac and it asks you if you want to' save the changes'. The changes I make do not seem to want to stick. I am using Rev Enterprise 4.0.0.

Thanks for any help you can give,
Larry

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Re: Card Size

Post by gyroscope » Sat Mar 20, 2010 8:56 pm

Hi Larry

Off the top of my head, try putting the following in the card script of the stack you want to size:

Code: Select all

on preOpenCard
set the width of stack "Suchandsuch" to 400
set the height of stack "SuchandSuch" to 600
end preOpenCard
Should do the trick.

:)

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Card Size

Post by bn » Sat Mar 20, 2010 9:12 pm

Larry,
what operating system? Are you using menus?
It sounds like you are on a mac and your stack is doing this adjust for menus thing.
As far as I know everything, including size and position is saved. Just if you have the menu set to adjust it everything will move up 22 some pixel.
I find the menu setting for MacOs very confusing.

You can force the size and position by script as gyroscope (hi gyroscope) suggested, I would try to work out the menu thing first.
regards
Bernd

lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Re: Card Size

Post by lohill » Mon Mar 22, 2010 3:08 am

Thanks gyroscope and Bernd,

I have decided to use gyroscope's technique for the stacks that I open modally. The user shouldn't have any reason to want to resize those. For the regular stack opening, I will see if I can stick with Bernd's wishes. I have implemented the following for the regular stacks to see If that will help. I have put the following in the stack's preOpenCard:

Code: Select all

   get the height of stack "SuchAndSuch"
   put it into tHeight
   set the height of stack "SuchAndSuch" to tHeight + 22
I'll see how this pans out.

Larry

lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Re: Card Size

Post by lohill » Mon Mar 22, 2010 7:01 pm

Larry said:
'll see how this pans out.
And I'm back to say in doesn't - unless you want the window to get taller every time you move to another card. Even in the preOpenStack it will give the same problem if the stack is closed and opened repeatedly.

Back to the drawing board. I guess gyroscope's way is what I'll have to settle with unless there is some good way to handle it. This is for a Mac with menus originally produced in the MenuBuilder.

Larry

dablock
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 23
Joined: Wed Apr 23, 2008 2:51 pm

Re: Card Size

Post by dablock » Mon Apr 12, 2010 10:02 pm

Larry, I had the same problem. Make a card with large field & a small status field below. Use the geometry pane to setup scaling & positioning. Works great in the IDE--sizes & position are correct, and it scales/positions properly. But build an application & run it, the window opens & you can't see the small status field below. Resize the window any amount & everything appears correct.

This solved the problem for me. I hardcoded the window size in the stack script.

Code: Select all

on preOpenStack
   set the height of window "MyApp" to 350
   set the width of window "MyApp" to 540
   set the top of window "MyApp" to 47
   set the left of window "MyApp" to 9
end preOpenStack
Then in the card script call the geometry manager to refresh:

Code: Select all

on openCard
  revUpdateGeometry
end openCard
You may be able to just call revUpdateGeometry in the stack or card script, but this worked for me & I thought I'd quickly pass it along.

lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Re: Card Size

Post by lohill » Tue Apr 13, 2010 1:23 am

Thanks dablock,

I'll give that a try.

Larry

lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Re: Card Size

Post by lohill » Wed Apr 14, 2010 1:54 am

It seems to work great. Thanks dablock.

Larry

Post Reply