Originally Posted by
Beefy
I don't know if it's staring me in the face, but I can't find out how to attach a script to a screen button.
Looking at the screen making documentation, a button is added as follows:
Function: void Addbutton(double xposition, double yposition, double width, double height, bool toggletype, bool blinktype, int picturenumber, int buttonnumber, int layernumber)
Description: This function adds one button object to the screen. The first 2 parameters are the X and Y position in pixels of the top-left corner of the button.
The width and height are also in pixels and they define how wide and how tall the button will be.
If the toggletype parameter is true then the button is toggling between the on and off states with rendering the left side half image onto the button in the off state and rendering the right side half image in the on state of the button.
If the blinktype parameter is true then in the on state of the button the rendering of the left and right side images is rendered periodically creating a blinking effect.
The picturenumber is the identifier of the image used to render this button,
this identifier was set in the Loadpicture functions and any picture which was loaded previously can be selected.
The buttonnumber is an identifier for this button and this identifier also defines the function of this button. For example code 128. is the cycle start button code.
The different button codes are listed and described in a separated document.
The layernumber defines on which tab layer will the button appear on.
Example: AS3.Addbutton(50, 60, 100, 100, 18, 128, 2);
So the buttonnumber is the identifier that defines the function of this button. I've looked at the list of the button functions and can't find anything related to running a script. So far the only way I can think of running a custom script is to put it in a macro and call the macro from the MDI line.
Am I missing something ?
Keith