formZ SDK | 5.0 API Reference | System | User Interface (FUIM) | Script Only Templates

fz_fuim_script_new_button

Description

Creates a new button item.
An id will be created and assigned to the item and returned.
Pass FZ_FUIM_ROOT for parent if there is no parent group.
The item_func is the name of the script function, which will be called by formZ, when the button is pressed. This function can have any name, but must fit the required return type and arguments. The callback function definition is :

fzrt_int my_button_func(
fz_fuim_tmpl_ptr fuim_tmpl,
fzrt_int item_id
);
The button callback function should return TRUE, if it did anything when it was called. It should return FALSE, when noting was processed. The item_id passed in to the button callback function is the id generated and returned by fz_fuim_script_new_button. It is possible to use the same button callback function for multiple buttons. The item_id passed in can be used to distinguish which button is pressed. The palt_my_view.fsl sample script contains a use of a button and its callback function.

Parameters

fuim_tmpl [Input]

fuim manager

parent [Input]

parent group

flags [Input]

construction flags

Bit Flag Type: fz_fuim_flag_enum

titl_str [Input, Optional]

button title

Default Value: button item is created without a title

item_func [Input, Optional]

name of button callback function

Returns

Button id

Availability

5.0.0.0