Source language: Translate to:

If resize the pub

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

If resize the pub

Postby Dudus » Fri Nov 18, 2016 11:24 am

Hi,

can you help me? How can i align the container when i maximize the pub (resize) ?
Because if I resize the pub the conatiner going on the left top corner of the pub, but i want to lock in center and midle of the pub -even if the pub maximize.

Thank you!
D
User avatar
Dudus
 
Posts: 107
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

Re: If resize the pub

Postby Neosoft Support » Fri Nov 18, 2016 6:23 pm

You would have to use the Resized action (Book Properties > Actions > Resized) and then use the MoveObject action to manually move the container to the center. You can use the global [ClientHeight] and [ClientWidth] variables to determine the new inside dimensions of the main pub window.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: If resize the pub

Postby Dudus » Sat Nov 19, 2016 3:15 am

Neosoft Support wrote:You would have to use the Resized action (Book Properties > Actions > Resized) and then use the MoveObject action to manually move the container to the center. You can use the global [ClientHeight] and [ClientWidth] variables to determine the new inside dimensions of the main pub window.


Thank you for the Help! But do you know how could i count the center midle with the screen resolution?
D
User avatar
Dudus
 
Posts: 107
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

Re: If resize the pub

Postby HPW » Sat Nov 19, 2016 7:29 am

Hello,

Take a look at the predefined global variables in the doc:

[ScreenHeight] The height the entire Windows screen in pixels.
[ScreenWidth] The width of the entire Windows screen in pixels.


Regards
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: If resize the pub

Postby Dudus » Sat Nov 19, 2016 10:35 am

I do not know how, so if there is someone who can PAST a code, than please do it... Thanks.

D
User avatar
Dudus
 
Posts: 107
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

Re: If resize the pub

Postby HPW » Sat Nov 19, 2016 11:16 am

Code: Select all
Math "[ScreenWidth]/2" "0" "[ScreenMidX]"
Math "[ScreenHeight]/2" "0" "[ScreenMidY]"
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: If resize the pub

Postby Dudus » Sun Nov 20, 2016 2:39 am

Worg great - thank you, BUT how to align to center middle if pub resized back to default size?
Thanks!
User avatar
Dudus
 
Posts: 107
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

Re: If resize the pub

Postby HPW » Sun Nov 20, 2016 3:59 am

Code: Select all
Math "[ClientWidth]/2" "0" "[ClientMidX]"
Math "[ClientHeight]/2" "0" "[ClientMidY]"


On the long run you should learn/understand neobooks basic scripting logik. ;-)

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: If resize the pub

Postby Dudus » Sun Nov 20, 2016 6:11 am

Thank you! :) Works great!!!
User avatar
Dudus
 
Posts: 107
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest