# FormPushButton

A push button item. Push button are used to trigger a function/call back that is associated with the button.

## Example

app = pf.GetApplication()
project = app:NewProject()

-- Call back function for the button on the form.

function exampleCallBack()
print("Hello!")
end

form = pf.Form.New()

-- Create a 'FormPushButton' form item

formPushButton = pf.FormPushButton.New(exampleCallBack,"Hello")

-- Add button to the form

-- Show and run the form

form:Run()


## Inheritance

The FormPushButton object is derived from the FormItem object.

## Usage locations (object properties)

The following objects have properties using the FormPushButton object:

## Property List

Enabled
Controls the item enabled state. Setting the enabled state of an item to false will also disable items or their contents. (Read/Write boolean)
FixedHeight
The fixed height of the item in pixels. When the fixed height is set to a positive value, it is the height of the item. Setting the fixed height to zero or a negative value will restore the default/auto setting and the height will be dynamically determined. The fixed height takes precedence over the minimum height and thus the minimum height is ignored when a fixed height is set. (Read/Write number)
FixedWidth
The fixed width of the item in pixels. When the fixed width is set to a positive value, it is the width of the item. Setting the fixed width to zero or a negative value will restore the default/auto setting and the width will be dynamically determined. The fixed width takes precedence over the minimum width and thus the minimum width is ignored when a fixed width is set. (Read/Write number)
IconPath
The icon of the push button. (Read/Write string)
ItemHeight
The height of the item in pixels. (Read only number)
ItemWidth
The width of the item in pixels. (Read only number)
Label
The label of the push button. (Read/Write string)
MinimumHeight
The minimum height of the item in pixels. When the height is dynamically determined, it will not be less than the minimum height setting. The minimum height value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum height to zero or a negative value will restore the default/auto setting where no minimum height is enforced. (Read/Write number)
MinimumWidth
The minimum width of the item in pixels. When the width is dynamically determined, it will not be less than the minimum width setting. The minimum width value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum width to zero or a negative value will restore the default/auto setting where no minimum width is enforced. (Read/Write number)
Type
The object type string. (Read only string)
Visible
Controls the item visibility. Setting the visibility of an item to false will also hide items or their contents. (Read/Write boolean)

## Method List

ClearCallBack ()
Clear the function that will be called when the button is pressed.
SetCallBack (callback function)
Set the function that will be called when the button is pressed.

## Constructor Function List

New (callBack function, label string, path string)
Create a new push button item with an icon. (Returns a FormPushButton object.)
New (callBack function, label string)
Create a new push button item. (Returns a FormPushButton object.)

## Property Details

Enabled
Controls the item enabled state. Setting the enabled state of an item to false will also disable items or their contents.
Type
boolean
Access
FixedHeight
The fixed height of the item in pixels. When the fixed height is set to a positive value, it is the height of the item. Setting the fixed height to zero or a negative value will restore the default/auto setting and the height will be dynamically determined. The fixed height takes precedence over the minimum height and thus the minimum height is ignored when a fixed height is set.
Type
number
Access
FixedWidth
The fixed width of the item in pixels. When the fixed width is set to a positive value, it is the width of the item. Setting the fixed width to zero or a negative value will restore the default/auto setting and the width will be dynamically determined. The fixed width takes precedence over the minimum width and thus the minimum width is ignored when a fixed width is set.
Type
number
Access
IconPath
The icon of the push button.
Type
string
Access
ItemHeight
The height of the item in pixels.
Type
number
Access
ItemWidth
The width of the item in pixels.
Type
number
Access
Label
The label of the push button.
Type
string
Access
MinimumHeight
The minimum height of the item in pixels. When the height is dynamically determined, it will not be less than the minimum height setting. The minimum height value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum height to zero or a negative value will restore the default/auto setting where no minimum height is enforced.
Type
number
Access
MinimumWidth
The minimum width of the item in pixels. When the width is dynamically determined, it will not be less than the minimum width setting. The minimum width value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum width to zero or a negative value will restore the default/auto setting where no minimum width is enforced.
Type
number
Access
Type
The object type string.
Type
string
Access
Visible
Controls the item visibility. Setting the visibility of an item to false will also hide items or their contents.
Type
boolean
Access

## Method Details

ClearCallBack ()
Clear the function that will be called when the button is pressed.
SetCallBack (callback function)
Set the function that will be called when the button is pressed.
Input Parameters
callback(function)
The function call back.

## Static Function Details

New (callBack function, label string, path string)
Create a new push button item with an icon.
Input Parameters
callBack(function)
The function call back.
label(string)
The item label.
path(string)
The file path of the icon image.
Return
FormPushButton
The newly created push button item.
New (callBack function, label string)
Create a new push button item.
Input Parameters
callBack(function)
The function call back.
label(string)
The item label.
Return
FormPushButton
The newly created push button item.