Jump to content

Possible to define button size/position with equation?


Recommended Posts

Posted (edited)
Is it possible to define the size and/or position of a button (or any icon) with an equation? For example, if I wanted to have four buttons along the bottom of the screen, I would like to be able to define button 2 a bit like this: button2_x_size = screen_x_size/4; //Set the width of button 2 to 1/4 of screen width. button2_y_size = screen_y_size/8; //Set the height of button 2 to 1/8 of screen height. button2_x_position = button1_x_size; //Set the x-position of button 2 to the right edge of button 1. button2_y_position = screen_y_size - button1_y_size; //Set the y-position of button 2 to the top edge of button 1. I would like it in equation form, so that if I decide to change the size and position of button 1, the size and position of button 2 will be updated automatically. (In fact, is it possible to simply write all the layout logic in some kind of text editor?) Edited by ct8356

Posted (edited)
There are a three primary methods to access NS macros, "Project Properties", "Screen/Sheet Properties" and the "Macro" tab associated with screen objects. "Project Properties" -> "Macro" offers the most options to launch macros, "When Loading a Project", triggered by Alarm/Event and "On change of an address value" [This selection has 10 Boolean triggers and 10 Value triggers" Screen/Sheet macros can be launched when a screen is Opened, Closed or both Opened and Closed. Likewise screen object macros can be set for "Touch ON timing", "Touch OFF timing or both. Note that is you are using multifunction objects that launching macros is via the "Special" tab associated with the multifunction object. It is up to the developer to define the macro triggers and what macro should run. Have you downloaded and studied the NS Macro manual? It is a bit brief but should get you in the right direction. Edited by BITS N BYTES
  • Like 1
Posted
I have tried writing MOVEPARTS(0,1,1); in the project property macro called "When loading a project". I hoped that this would move the label with ID "LBL0000" to position (1,1) when I press "Tools > Test > Start testing offline", or when I reload the project in CX Designer, but nothing happens... Am I misunderstanding something?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...