Source language: Translate to:

Resizable Applications and Buttons

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Resizable Applications and Buttons

Postby Pat Baner » Thu Feb 10, 2011 2:58 pm

Hello all.

So I am making my application resizable. Yes, I have read the help file as well (figured I would get that question answered upfront =)). My question and problem lies with the button's position when the page is resized. So, if I create a button and adjust the snap position to "center", it makes the button as wide as the screen (I don't want that). If I put the button inside a container who's snap position is "center", the button stays in its original position while the container's size changes. So, here is my question:

How do I make the button's position stay in it's relative position during page resize without make the button huge?

thanks in advance
Pat Baner
Posts: 75
Joined: Tue Jan 04, 2011 9:21 am

Postby Neosoft Support » Fri Feb 11, 2011 11:24 am

Set the button's snap position to none. Then in the host container's "Resize" action do something like this:

Code: Select all
GetObjectInfo "Container1" "Width" "[CW]"
GetObjectInfo "PushButton1" "Width" "[BW]"
GetObjectInfo "PushButton1" "Top" "[BY]"
Math "([CW] / 2)-([BW] / 2)" "0" "[BX]"
MoveObject "PushButton1" "[BX]" "[BY]"

Replace "Container1" and "PushButton1" with the names of your objects.
NeoSoft Support
Neosoft Support
NeoSoft Team
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 2 guests