Screen Controls

Accessing screen controls

All screen controls belong to the WINCTL module

Accessing the context of a control is done through the XPE 'this' variable

Accessing other controls on the same form or dialog is done by following the links starting at the XPE 'this' variable until the required control is reached.


Assuming that the current function being executed is a button log function invoked when a particular button is pressed

'this'   refers to the context of the button being pressed (the button object)

'this . frame'   refers to the control frame to which the button is attached

'this . frame . my_own_title'   refers to the title bar on the frame which we have called 'my_own_title'

'this . frame . my_own_textbox'   refers to the text extry field on the frame which we have called 'my_own_textbox'.

pictorially this would look like this

to read the value of this text entry field simply apply the 'get_value()' method to it

val   =   this . frame . my_own_textbox . get_value()

to write a value to this text entry field simply apply the 'set_value()' method to it.

this . frame . my_own_textbox . set_value(val)

Assigning functions to screen controls

To invoke a function when a button is pressed or when a slider is moved or when a value is entered into a textbox is very simple. All that is required is that the control has the name of the function added to the apropriote property field using the control edit dialog. e.g. to invoke the function 'CALCULATOR::digit_pressed' when a button is pressed, edit the control properties of the button and set the entry called 'pressed_func_name' to 'CALCULATOR::digit_pressed' the calculator example

Building screen controls

building controls