NAME
Tk::FormUI::Field - A role common to all form fields
VERSION
Version 0.2
SYNOPSIS
ATTRIBUTES
- key
-
The hash key used when returning data from this field
- label
-
The label displayed for the field in the dialog
- type
-
The type of field
- default
-
The default or initial value of the field
- widget
-
The Tk widget associated with this field
- label_font
-
The font to use for the field's label DEFAULT: 'times 12 bold'
- font
-
The font to use for the field's widget DEFAULT: 'times 12 bold'
- readonly
-
Indicates if the field is read only DEFAULT: 0
- width
-
The width of the field DEFAULT: 40
- error
-
Error string associated with the field DEFAULT: ''
- validation
-
Optional code reference of function to call to verify the field data is valid. The field object will be passed as the only parameter to the function. The function should return the empty string if there is no error, or provide an error string if the data is not valid.
METHODS
is_type($type)
- Description
-
Returns 1 if the field is the specified type
- Parameters
-
BOOLEAN indicating if the field is the specified type
- Return
-
1 if the field is the specified type otherwise 0
build_label($parent)
- Description
-
Build the label widget for the field
- Parameters
-
$parent - Parent widget
- Return
-
widget object
build_widget($parent)
- Description
-
Build the widget associated with this field. NOTE: This method should be overridden in the class for the field!
- Parameters
-
$parent - Parent widget for this widget
- Return
-
Widget object
validate()
- Description
-
Validate the field data
- Parameters
-
NONE
- Return
AUTHOR
Paul Durden <alabamapaul AT gmail.com>
COPYRIGHT & LICENSE
Copyright (C) 2015 by Paul Durden.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.