HTML::GUI::widget - Create and control GUI for web application
Version 0.01
base class for HTML widgets
Parameters : params : hash ref : Contains the properties of the widget : -type : text, select, checkbox -value : the value of the widget -id : the id of the widget (mandatory) -display : if false, the fied has the propertie style="display:none" -constraints : array ref of contraints names -label : text associated with the fiel -title : title to display when the mouse cursor is over the widget -class : css class to associate with the widget -disabled : the widget is disabled or not Return : Description : create a new html widget. It can be feed with data manually or automatically with a hash.
instantiante any widget previously serialized
Create widgets from the data structure $data This is a class method so it should be use like this : HTML::GUI::widget->instantiate($myString) Parameters : -$data : the data structure which describe the widgets -$path : the path (used to name the screen objects) Return : a widget or undef if the $data is not correct
Instantiante a widget from a yaml string This is a class method so it should be use like this : HTML::GUI::widget->instantiateFromYAML($myString) parameters : - $class : the className - $yamlString : the yaml string describing the widget - $path : the path (used to name the screen objects) returns : -the new widget or undef if the yaml does not describe a widget
Return : nothing Description : set the reference to the parent of the widget in the widget tree
Return : the root of the widget tree or itself if the widget doesn't belong to any container
Description : Define the root Directory of the screen definitions
Description : search the root of the current widget tree. Return : The root object of the current tree
Parameters : Return : string Description : Return the html of the widget.
Return : string Description : return the id of the widget.
Return : array Description : return an array of the ids of the widget. For simple widget, it's the same thing as getId but it's different for container which can have many widgets.
Return a new widget id who is unique for the current screen.
Parameters : id : string : id of the object to find. Description : return the widget whose id is $id or undef if no object has this id
Description : return the content of the html 'style' attribute Parameters : style : hashref : reference to a hash containing all styles attributs ; if not defined, the function use $self->style to generate a html content
Parameters : params : hash ref : defines params value Return : Description :
Parameters : $propName : the name of the property we want to read Return : - the value of the property if it exists - undef if the property doesn't exists
This method is the miror of the "new" method it generate a data structure that defines the widget, calling the "new" function with this hash ref will create the same widget. It is usefull for serialing a widget. With no parameters it works for a generic widget, but it is possible to specify paramters in order to specialise the behavior for a particular class. The expression "definition data" means the data that are specified when calling the 'new' function. Exemple :
my $definitionData = {id => "textObject", value=> '2'};
my $textInputWidget = HTML::GUI::text->new($definitionData);
Parameters : - $paramPublicProp : the hash to feed with the public properties, if undef a new hash is created - $paramDefaultValue : an ARRAY ref containing a list of the default values (if a propertie is set to a default value, il is not specified as a "definition data"), if undef the default values of generic widgets is used - $paramPublicPropList : the list of properties that can be "definition data", if undef the list of public properties of a generic widget is used Return : - a ref to the hash that define the public properties of the widget
return a string describing the current widget in YAML format
write the seralization of the current objet into the file $fileName. Currently, only the YAML is available, so $fileName MUST be like "*.yaml" Parameters : - $fileName : the name of the file to write into returns : - 1 if the operation terminates normally - 0 if a problem occurs
Instantiate widgets from a file Currently, only the YAML format is available, so $fileName MUST be like "*.yaml" Parameters : - $fileName : the name of the file to read - $baseDir (optional) : the base Directory (this path is added befaor $fileName to effectively locate the file on the filesystem) returns : - the widgets object newly created if the operation terminates normally - undef if a problem occurs
Parameters : params : hash ref : params to overload the params of the current objet (changing the id is a good idea) Return : widget Description :
Parameters : type : string : Visibility of the error (pub/priv) params : hashref : params of the error Description : record one error in the current objet
Parameters : $time : string : a value returned by the function time Description : return a human readable string of the date $time
Parameters : stackName : string : name of the stack to convert to string Description : return a human readable string of the stack $stackName
Description : return a array of the current stack
Description : store an alert message in the current objet
Parameters : message : string : message to debug Description : record one debug in the current objet
Description : return the label of the current obj
Description : return the html of the label of the current obj If the label is a void string, return ''
Returns : propHash : hash : a hash containing the value '1' pour each public propertie
Return : a string containing the actual path of the module
Description : All widgets are OK by default. The input widgets have custom validate function to implements constraints. Return : always 1
Description : Default method for all non-input and non-container widgets Return : undef
Parameters : $params : the hash ref containing the POST key-value pairs. Decription : this function aims to be specialized for buttons. Returns : - true if the current object was fired - false otherwise
Decription : return a hash ref to the session. This is a low level API to manage multiple user session in multiple windows. This function MUST be refined by the choosen engine. Returns : - a hash ref to the session corresponding to the user agent cookie - a void hash ref if no session can be found
Decription : return a hash ref to the session corresponding to one window of the browser. If a user opens two windows of the same brower, he will need to connect two times, getSession will return two different sessions. This method MUST be implemented by the engine Returns : - a hash ref to the session corresponding to the user agent cookie - a void hash ref if no session can be found
Description : Find the function whose name is $functionName If the module of the function not loaded, it will be loaded automatically. Returns : - a ref to the function whose name is $functionName if it exists - undef if no function of this name exists
Jean-Christian Hassler, <jhassler at free.fr>
<jhassler at free.fr>
Please report any bugs or feature requests to bug-gui-libhtml-screen at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-GUI. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-gui-libhtml-screen at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc HTML::GUI::widget
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/HTML-GUI
CPAN Ratings
http://cpanratings.perl.org/d/HTML-GUI
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTML-GUI
Search CPAN
http://search.cpan.org/dist/HTML-GUI
Copyright 2007 Jean-Christian Hassler, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install HTML::GUI::br, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::GUI::br
CPAN shell
perl -MCPAN -e shell install HTML::GUI::br
For more information on module installation, please visit the detailed CPAN module installation guide.