Sizing Desktop Displays?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Sizing Desktop Displays?
I developed my 768 x 1024 card on a 1920 x 1200 screen.
Now I need it to run on my wife's laptop screen which is 1280 x 800.
How can I re-size my card to fit 1280 x 800 laptop screen?
Thanks,
David
Now I need it to run on my wife's laptop screen which is 1280 x 800.
How can I re-size my card to fit 1280 x 800 laptop screen?
Thanks,
David
Re: Sizing Desktop Displays?
as a complete novice here - I was wondering whether or not you had come across the "screenrect" command? Or am I really missing the boat?
Re: Sizing Desktop Displays?
I have never heard of "screenrect".
I just now looked up in the dictionary, (The screenRects function returns a return-delimited list of four integers, separated by commas.)
How do I use it to re-size my screen after I have complied it to an exe?
I just now looked up in the dictionary, (The screenRects function returns a return-delimited list of four integers, separated by commas.)
How do I use it to re-size my screen after I have complied it to an exe?
Re: Sizing Desktop Displays?
Unfortunately I am at your level here. You mentioned exe so I assume you have a windows environment. Well my first guess in your situation would be to go back to your orginal stack and go to the first stack, enter an "on preopen" handler
the screenRect
set the rect of this stack ?(something to do with resolution of the screen I presume)
screenRects
Find out how to do this and then re-create your stack as a standalone again and ditch the first one.
As I said I have not had any time to experiment with this situation, I have only spent a few moments looking it up. Sorry I can not take you further at this stage.
regards
Chris
the screenRect
set the rect of this stack ?(something to do with resolution of the screen I presume)
screenRects
Find out how to do this and then re-create your stack as a standalone again and ditch the first one.
As I said I have not had any time to experiment with this situation, I have only spent a few moments looking it up. Sorry I can not take you further at this stage.
regards
Chris
Re: Sizing Desktop Displays?
Chris,
Thanks for your time,
David
Thanks for your time,
David
Re: Sizing Desktop Displays?
What about something like this -
Code: Select all
on preOpenStack
set the fullscreen of the stack "testStack" to true
end preOpenStack
Last edited by shawnblc on Sun Nov 03, 2013 7:17 pm, edited 1 time in total.
Re: Sizing Desktop Displays?
You'll need to write a handler that loops through all the controls and repositions them on every card. Typically this goes into a resizeStack handler (a resizeStack message is sent whenever the user drags the resizer handle at the lower right of the window.) Since you want it to run automatically when the stack opens on a smaller screen, you can call that handler yourself on preOpenStack:
Resizing is a pain, you must account for every object in the stack. To make it somewhat easier, LiveCode provides the Geometry Manager. You can read about that in the User Guide. It requires setting up every object in the stack with geometry information; after that the objects will reorient themselves to your settings.
Many of us have had inconsistent results with the geometry manager and prefer to write our own resizing scripts. Either way, it's a tedious affair. Another approach would be to create a substack at the other size and just manually position the objects once. That's not the best solution though because any change in script will require you to change it in two places, and you will also have duplications of every object which increases the stackfile size. Resizing is a better approach.
Code: Select all
on preOpenStack
set the height of this stack to 800 -- I'm assuming the width stays the same
resizeStack
end preOpenStack
on resizeStack
-- all resizing goes here
-- it's likely to be a pretty long handler depending on the number of objects
end resizeStack
Many of us have had inconsistent results with the geometry manager and prefer to write our own resizing scripts. Either way, it's a tedious affair. Another approach would be to create a substack at the other size and just manually position the objects once. That's not the best solution though because any change in script will require you to change it in two places, and you will also have duplications of every object which increases the stackfile size. Resizing is a better approach.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Sizing Desktop Displays?
Jacque,
The is a very graphic application consist of 100+ objects, including spinning stars.
How has everyone written programs (over the years) for desktops, that may need to run on several different size display screens?
Thanks,
David
The is a very graphic application consist of 100+ objects, including spinning stars.
How has everyone written programs (over the years) for desktops, that may need to run on several different size display screens?
Thanks,
David
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Sizing Desktop Displays?
When I first got started, all Macs were 512x342, and Windows hadn't been invented yet. By the time Windows came along Macs started shipping with multiple resolutions, and before you knew it 1990 was upon us and suddenly we couldn't avoid having many different screen sizes to support.DR White wrote:How has everyone written programs (over the years) for desktops, that may need to run on several different size display screens?
The resizeStack message is your friend.

The specifics of what changes size and what merely moves when a stack is resized will depend on the nature of the layout itself. When in doubt, you can almost always find some example in the wild of another app that's had to solve the same problem.
And if you need, you can also constrain resizing, allowing vertical resizing at a fixed width or vice versa. See the minHeight, minWidth, maxHeight, and maxWidth properties.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Sizing Desktop Displays?
I think everyone has a different approach to the problem, but a very common one is to just create the stack at the smallest acceptable size in the first place and then require a monitor of at least that size in the application specs. That's why you'll see commercial software with a list on the side of the box that includes a minimum monitor resolution. (At least, we used to see that back when software shipped in boxes.)
In your case, that would mean changing the height of your stack to 800 pixels and manually rearranging the objects. You'd only need to do that once and then it would run on all your machines.
In your case, that would mean changing the height of your stack to 800 pixels and manually rearranging the objects. You'd only need to do that once and then it would run on all your machines.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com