This example shows how to use the button component.
When the blue button is clicked then the onButtonsButtonBlueClick procedure is called,
when the green button is clicked then the onButtonsButtonGreenClick procedure is called,
when the red button is clicked then the onButtonsButtonRedClick procedure is called.
All the click event procedures have a windowHandle parameter, the value of this paramerer
is equal to the return value of the showButtonsForm procedure.
The windowHandle has to be used to address the components on the form, in this example it's
used to change the color of the status light with the components.statusLight.setColor procedure.
"Buttons example" "lib/modules/standard.whl" "lib/modules/components/component.whl" "lib/modules/components/form.whl" "lib/modules/components/button.whl" "lib/modules/components/statusLight.whl" BUTTONS_BUTTON_BLUE 0x780ACFDE BUTTONS_BUTTON_GREEN 0x4F7DB0F4 BUTTONS_BUTTON_RED 0xD846C71A BUTTONS_STATUS_LIGHT 0x18551397 "buttons.wfrm" ; @proc Button onClick event. ; @param windowHandle The handle to the active window. proc onButtonsButtonBlueClick(number windowHandle) components.statusLight.setColor(windowHandle, BUTTONS_STATUS_LIGHT, COMPONENT_COLOR_BLUE) end ; @proc Button onClick event. ; @param windowHandle The handle to the active window. proc onButtonsButtonGreenClick(number windowHandle) components.statusLight.setColor(windowHandle, BUTTONS_STATUS_LIGHT, COMPONENT_COLOR_GREEN) end ; @proc Button onClick event. ; @param windowHandle The handle to the active window. proc onButtonsButtonRedClick(number windowHandle) components.statusLight.setColor(windowHandle, BUTTONS_STATUS_LIGHT, COMPONENT_COLOR_RED) end ; @proc Show the form. ; @ret The handle to the form. proc showButtonsForm() ret components.form.show("buttons.wfrm") end proc main() showButtonsForm() halt() end