Buttons Component
Fnd_Bttn_CreateButton
Fnd_Bttn_CreateButton (->button object; ->picture; icon name; label)
Parameters
| Parameter | Type | Description |
|---|---|---|
| button object | Pointer | A picture button form object |
| picture | Pointer | A picture variable |
| icon name | Text | Name of the icon to use from the 4D picture library |
| label | Text | Label for the button |
Description
Use this routine in the On Load phase to quickly set up a picture button on a 4D form. Pass this routine a pointer to a picture button form object, a picture variable to hold the button image, the icon name to use and a label to use. Case of : (Form event=On Load ) C_PICTURE(myPicture)
Fnd_Bttn_Style ("Small2")
Fnd_Bttn_CreateButton (->myButton;->myPicture;"Button_Home";"Home")
End case
The style of the button created will depend on the current button settings set by the Fnd_Bttn_Platform and Fnd_Bttn_Style commands. The first parameter is a pointer to a Picture Button form object. The size of this form object is unimportant, as it will be resized by this call. The object’s attributes do not need to be specified — this routine will set them to properly display a rollover picture button. The picture variable is used as storage space for the picture button’s image. It must be declared as a picture variable before calling this method. You will not need to access this variable to use the button, however, you may clear the contents of this variable when the button is no longer needed. After this call, the picture button will be resized to properly fit the button image. This varies depending on the current button style, the size of the icon, and the width of the button label. If necessary, you can procedurally move the button using 4D’s MOVE OBJECT command. You can control the button’s attributes using 4D’s ENABLE BUTTON and DISABLE BUTTON commands: DISABLE BUTTON(myButton)
Use the form object’s method to detect a click on the button: Case of : (Form event=On Clicked )
` Put your code here to handle the click.
End case
Extracted source text
Fnd_Bttn_CreateButton (->button object; ->picture; icon name; label)
Parameter Type Description
button object Pointer A picture button form object
picture Pointer A picture variable
icon name Text Name of the icon to use from the 4D picture library
label Text Label for the button
Use this routine in the On Load phase to quickly set up a picture button on a 4D form. Pass this routine
a pointer to a picture button form object, a picture variable to hold the button image, the icon name to
use and a label to use.
Case of
: (Form event=On Load )
C_PICTURE(myPicture)
Fnd_Bttn_Style ("Small2")
Fnd_Bttn_CreateButton (->myButton;->myPicture;"Button_Home";"Home")
End case
The style of the button created will depend on the current button settings set by the Fnd_Bttn_Platform
and Fnd_Bttn_Style commands.
The first parameter is a pointer to a Picture Button form object. The size of this form object is
unimportant, as it will be resized by this call. The object’s attributes do not need to be specified — this
routine will set them to properly display a rollover picture button.
The picture variable is used as storage space for the picture button’s image. It must be declared as a
picture variable before calling this method. You will not need to access this variable to use the button,
however, you may clear the contents of this variable when the button is no longer needed.
After this call, the picture button will be resized to properly fit the button image. This varies depending
on the current button style, the size of the icon, and the width of the button label. If necessary, you can
procedurally move the button using 4D’s MOVE OBJECT command.
You can control the button’s attributes using 4D’s ENABLE BUTTON and DISABLE BUTTON
commands:
DISABLE BUTTON(myButton)
Use the form object’s method to detect a click on the button:
Case of
: (Form event=On Clicked )
` Put your code here to handle the click.
End case