Abstract Class P4A_Widget

Description

Base class for objects that permit user interation with the application.

Every P4A objects thats can be rendered should use WIDGET as base class. This class have all the basic methods to build complex widgets that must be P4A compatible.

Located in /p4a/objects/widget.php (line 44)

P4A_Object
   |
   --P4A_Widget
Direct descendents
Class Description
 class P4A_DB_Navigator This widget allows a tree navigation within a P4A_DB_Source.
 class P4A_Link "A" HTML tag
 class P4A_Frame A frame is a panel where you anchor widgets.
 class P4A_Line
 class P4A_Label The label is associated to an input field, do not use it otherwise
 class P4A_Box The box: renders raw HTML
 class P4A_Field A fields is a GUI element that shows its value, and this value can be changed.
 class P4A_Message
 class P4A_Image
 class P4A_Table Tabular rapresentation of a data source.
 class P4A_Table_Col Keeps the data for a single table column
 class P4A_Table_Rows Keeps all the data for all the rows.
 class P4A_Menu p4a menu system As in every big IDE such as Sun ONE or Microsoft Visual Studio you have the possibility to add the top menu for simple organization of masks.
 class P4A_Menu_Item Rapresents every menu item
 class P4A_Tab_Pane The tab pane widget A tab pane is a set of pages.
 class P4A_Toolbar A toolbar is a buttons/images set.
 class P4A_Sheet The sheet widget A canvas is a panel where you anchor widgets in a grid way.
 class P4A_Canvas A canvas is a panel where you anchor widgets with absolute positions
 class P4A_Button HTML "button".
Variable Summary
 array $actions
 boolean $enabled
 array $properties
 array $style
 boolean $use_template
 boolean $visible
 array $_temp_vars
 array $_tpl_vars
Method Summary
 P4A_Widget __construct ([string $name = null], [string $prefix = 'obj'], [string $id = null])
 P4A_Widget addAction (string $action, [string $event = null], [string|boolean $confirmation_text = null], [boolean $ajax = false])
 P4A_Widget addAjaxAction (string $action, [string $event = null], [string|boolean $confirmation_text = null])
 P4A_Widget addCSSClass (string $class)
 P4A_Widget addTempVar (string $name, string $value)
 P4A_Widget changeEvent (string $action, [string $event = null])
 string composeStringActions ([array $params = null], [boolean $check_enabled_state = true])
 string composeStringClass ([array $additional_classes = array()])
 string composeStringStyle ()
 P4A_Widget display (string $var_name, string $var_value)
 P4A_Widget dropAction (string $action)
 P4A_Widget dropTempVar (string $name)
 P4A_Widget enable ([boolean $enabled = true])
 string fetchTemplate ()
 string getAccessKey ()
 void getAsString ()
 array getCSSClasses ()
 void getHeight ()
 string getLabel ()
 string getProperty (string $property)
 string getStyleProperty (string $property)
 string getWidth ()
 void isEnabled ()
 boolean isVisible ()
 unknown onBlur ([ $params = null])
 unknown onChange ([ $params = null])
 unknown onClick ([ $params = null])
 unknown onDblClick ([ $params = null])
 unknown onFocus ([ $params = null])
 unknown onKeyDown ([ $params = null])
 unknown onKeyPress ([ $params = null])
 unknown onKeyUp ([ $params = null])
 unknown onMouseDown ([ $params = null])
 unknown onMouseMove ([ $params = null])
 unknown onMouseOver ([ $params = null])
 unknown onMouseUp ([ $params = null])
 unknown onReturnPress ([ $params = null])
 unknown onSelect ([ $params = null])
 P4A_Widget removeCSSClass (string $class)
 P4A_Widget requireConfirmation ([string $action = 'onclick'], [string|boolean $confirmation_text = true])
 P4A_Widget setAccessKey (string $key)
 P4A_Widget setBgcolor (string $value)
 P4A_Widget setBgimage (string $value)
 P4A_Widget setFontColor (string $value)
 P4A_Widget setFontWeight (string $value)
 P4A_Widget setHeight ([integer $value = null], [string $unit = 'px'])
 P4A_Widget setLabel (string $label)
 P4A_Widget setProperty (string $property, string $value)
 P4A_Widget setStyleProperty (string $property, string $value)
 P4A_Widget setVisible ([boolean $visible = true])
 P4A_Widget setWidth ([integer $value = null], [string $unit = 'px'])
 P4A_Widget unrequireConfirmation (string $action)
 P4A_Widget unsetProperty (string $property)
 P4A_Widget unsetStyleProperty (string $property)
 P4A_Widget useTemplate (string $template_name)
Variables
array $actions = array() (line 61)

Keeps all the actions implemented by the widget

  • access: protected
boolean $enabled = true (line 50)

Object's enabled status. If the widget is visible but not enable it won't be clickable.

  • access: protected
P4A_Label $label = null (line 68)

Keeps the label associated with the widget

The label will be displayed on the left of the widget

  • access: public
array $properties = array() (line 74)

Keeps all the HTML properties for the widget

  • access: protected
array $style = array() (line 80)

Keeps all the CSS properties for the widget

  • access: protected
string $template_name = null (line 94)

Defines the name of the widget if you set it to 'menu' P4A will search for "menu/menu.tpl" in the "themes/CURRENT_THEME/widgets/" directory.

  • access: protected
boolean $use_template = false (line 86)

Defines if we are going to use a template for the widget

  • access: protected
boolean $visible = true (line 55)
  • access: protected
mixed $_css_classes = array() (line 108)
  • access: protected
array $_temp_vars = array() (line 106)

Temporary variables (destroyed after rendering)

  • access: protected
array $_tpl_vars = array() (line 100)

variables used for templates

  • access: protected

Inherited Variables

Inherited from P4A_Object

P4A_Object::$_helpers
P4A_Object::$_id
P4A_Object::$_map_actions
P4A_Object::$_name
P4A_Object::$_objects
P4A_Object::$_parent_id
Methods
Constructor __construct (line 115)
  • access: public
P4A_Widget __construct ([string $name = null], [string $prefix = 'obj'], [string $id = null])
  • string $name: Object identifier, when you add an object to another object (such as $p4a) you can access to it by $p4a->object_name
  • string $prefix: Prefix string for ID generation
  • string $id: Object ID identifies an object in the $p4a's object collection. You can set a static ID if you want that all clients uses the same ID (tipically for web sites).

Redefinition of:
P4A_Object::__construct()

Redefined in descendants as:
addAction (line 424)

Adds an action to the implemented actions stack for the widget

  • access: public
P4A_Widget addAction (string $action, [string $event = null], [string|boolean $confirmation_text = null], [boolean $ajax = false])
  • string $action
  • string $event: The JavaScript event that triggers
  • string|boolean $confirmation_text: If the action requires user confirmation, type here the confirmation message (use boolean true for a general message)
  • boolean $ajax: is an ajax action?
addAjaxAction (line 454)

Adds an ajax action to the implemented actions stack for the widget

  • access: public
P4A_Widget addAjaxAction (string $action, [string $event = null], [string|boolean $confirmation_text = null])
  • string $action
  • string $event: The JavaScript event that triggers
  • string|boolean $confirmation_text: If the action requires user confirmation, type here the confirmation message (use boolean true for a general message)
addCSSClass (line 913)
  • access: public
P4A_Widget addCSSClass (string $class)
  • string $class
addTempVar (line 880)

Add a temporary variable

  • access: public
P4A_Widget addTempVar (string $name, string $value)
  • string $name
  • string $value
changeEvent (line 498)

Changes the event associated to an action.

If no event is given, here we set event=action.

  • access: public
P4A_Widget changeEvent (string $action, [string $event = null])
  • string $action
  • string $event: The JavaScript event that triggers
clearTemplateVars (line 678)

Empties the template engine variables' stack

  • access: public
P4A_Widget clearTemplateVars ()
clearTempVars (line 903)

Clear temporary vars list

  • access: public
P4A_Widget clearTempVars ()
composeStringActions (line 549)

Composes a string containing all the actions implemented by the widget.

Note: it will also contain the name and the value.

  • access: public
string composeStringActions ([array $params = null], [boolean $check_enabled_state = true])
  • array $params
  • boolean $check_enabled_state
composeStringClass (line 626)

Composes a string contaning the class property for the widget

  • access: protected
string composeStringClass ([array $additional_classes = array()])
  • array $additional_classes
composeStringProperties (line 531)

Composes a string containing all the HTML properties of the widget.

Note: it will also contain the name and the value.

  • access: protected
string composeStringProperties ()

Redefined in descendants as:
composeStringStyle (line 608)

Composes a string containing the CSS properties for the widget

  • access: protected
string composeStringStyle ()
disable (line 136)
P4A_Widget disable ()

Redefined in descendants as:
display (line 657)

Adds this variable (name and value) to the template engine variables' stack.

  • access: public
P4A_Widget display (string $var_name, string $var_value)
  • string $var_name
  • string $var_value
dropAction (line 519)

Removes an action from the implemented actions stack for the widget

  • access: public
P4A_Widget dropAction (string $action)
  • string $action
dropTempVar (line 891)

Drop a temporary variable

  • access: public
P4A_Widget dropTempVar (string $name)
  • string $name
enable (line 126)
P4A_Widget enable ([boolean $enabled = true])
  • boolean $enabled

Redefined in descendants as:
fetchTemplate (line 688)

Returns the HTML rendered template

  • access: public
string fetchTemplate ()
getAccessKey (line 301)
  • access: public
string getAccessKey ()
getAsString (line 728)

Returns the HTML rendered widget.

This method MUST be overridden by every widget that extends P4A_this class.

  • access: public
void getAsString ()

Redefined in descendants as:
getCSSClasses (line 935)
  • access: public
array getCSSClasses ()
getHeight (line 359)

Returns the height for the widget.

It's a wrapper for getStyleProperty().

void getHeight ()
getLabel (line 211)

Returns the label for the widget

  • access: public
string getLabel ()

Redefined in descendants as:
getProperty (line 244)

Returns the value of a property

  • access: public
string getProperty (string $property)
  • string $property
getStyleProperty (line 281)

Returns the value of a CSS property

  • access: public
string getStyleProperty (string $property)
  • string $property
getWidth (line 330)

Returns the width for the widget.

It's a wrapper for getStyleProperty().

string getWidth ()
isEnabled (line 146)

Returns true if the widget is enabled

  • see: $enable
  • access: public
void isEnabled ()
isVisible (line 175)

Returns true if the widget is visible

  • access: public
boolean isVisible ()
onBlur (line 737)

Wrapper used to add the handling of onBlur action

unknown onBlur ([ $params = null])
  • $params
onChange (line 757)

Wrapper used to add the handling of onChange action

unknown onChange ([ $params = null])
  • $params
onClick (line 747)

Wrapper used to add the handling of onClick action

unknown onClick ([ $params = null])
  • $params

Redefined in descendants as:
onDblClick (line 767)

Wrapper used to add the handling of onDblClick action

unknown onDblClick ([ $params = null])
  • $params
onFocus (line 777)

Wrapper used to add the handling of onFocus action

unknown onFocus ([ $params = null])
  • $params
onKeyDown (line 847)

Wrapper used to add the handling of onKeyDown action

unknown onKeyDown ([ $params = null])
  • $params
onKeyPress (line 827)

Wrapper used to add the handling of onKeyPress action

unknown onKeyPress ([ $params = null])
  • $params
onKeyUp (line 837)

Wrapper used to add the handling of onKeyUp action

unknown onKeyUp ([ $params = null])
  • $params
onMouseDown (line 787)

Wrapper used to add the handling of onMouseDown action

unknown onMouseDown ([ $params = null])
  • $params
onMouseMove (line 797)

Wrapper used to add the handling of onMouseMove action

unknown onMouseMove ([ $params = null])
  • $params
onMouseOver (line 807)

Wrapper used to add the handling of onMouseOver action

unknown onMouseOver ([ $params = null])
  • $params
onMouseUp (line 817)

Wrapper used to add the handling of onMouseUp action

unknown onMouseUp ([ $params = null])
  • $params
onReturnPress (line 859)

Wrapper used to add the handling of onReturnPress action.

The onReturnPress action is an onKeyPress with checking if the pressed key is return.

unknown onReturnPress ([ $params = null])
  • $params
onSelect (line 869)

Wrapper used to add the handling of onSelect action

unknown onSelect ([ $params = null])
  • $params
redesign (line 943)
  • access: public
P4A_Widget redesign ()
removeCSSClass (line 923)
  • access: public
P4A_Widget removeCSSClass (string $class)
  • string $class
requireConfirmation (line 465)

Requires confirmation for an action

  • access: public
P4A_Widget requireConfirmation ([string $action = 'onclick'], [string|boolean $confirmation_text = true])
  • string $action
  • string|boolean $confirmation_text: The confirmation message (default is boolean true for a general message)
setAccessKey (line 293)
  • access: public
P4A_Widget setAccessKey (string $key)
  • string $key
setBgcolor (line 371)

Sets the background color for the widget.

It's a wrapper for setStyleProperty().

P4A_Widget setBgcolor (string $value)
  • string $value: The value to be used as color
setBgimage (line 384)

Sets the background image for the widget.

It's a wrapper for setStyleProperty().

P4A_Widget setBgimage (string $value)
  • string $value: The url of the image
setDefaultLabel (line 201)

Create from name a default label for the widget In rendering phase it will be added with ': '.

P4A_Widget setDefaultLabel ()
setFontColor (line 410)

Sets the font color for the widget It's a wrapper for setStyleProperty().

P4A_Widget setFontColor (string $value)
  • string $value: The url of the image
setFontWeight (line 397)

Sets the font weight for the widget.

It's a wrapper for setStyleProperty().

P4A_Widget setFontWeight (string $value)
  • string $value: The url of the image
setHeight (line 343)

Sets the height for the widget.

It's a wrapper for setStyleProperty().

P4A_Widget setHeight ([integer $value = null], [string $unit = 'px'])
  • integer $value: The value to be used as height.
  • string $unit: The measure unit (px|pt|%) etc...
setInvisible (line 165)

Sets the widget invisible

  • access: public
P4A_Widget setInvisible ()
setLabel (line 187)

Sets the label for the widget.

In rendering phase it will be added with ': '.

P4A_Widget setLabel (string $label)
  • string $label

Redefined in descendants as:
  • P4A_Field::setLabel() : Sets the label for the field.
  • P4A_Button::setLabel() : Sets the label and its visibility When a label is visible it will be rendered next to the icon (if there's an icon), otherwise you'll see the lable as a tooltip.
setProperty (line 222)

Sets an HTML property for the widget

  • access: public
P4A_Widget setProperty (string $property, string $value)
  • string $property
  • string $value
setStyleProperty (line 259)

Sets a CSS property for the widget

  • access: public
P4A_Widget setStyleProperty (string $property, string $value)
  • string $property
  • string $value
setVisible (line 155)
  • access: public
P4A_Widget setVisible ([boolean $visible = true])
  • boolean $visible

Redefined in descendants as:
setWidth (line 313)

Sets the width for the widget.

It's a wrapper for setStyleProperty().

P4A_Widget setWidth ([integer $value = null], [string $unit = 'px'])
  • integer $value: The value to be used as width
  • string $unit: The measure unit (px|pt|%) etc...
unrequireConfirmation (line 483)

Removes confirmation for an action

  • access: public
P4A_Widget unrequireConfirmation (string $action)
  • string $action
unsetProperty (line 233)

Unsets an HTML property for the widget

  • access: public
P4A_Widget unsetProperty (string $property)
  • string $property
unsetStyleProperty (line 270)

Unset a CSS property for the widget

  • access: public
P4A_Widget unsetStyleProperty (string $property)
  • string $property
useTemplate (line 639)

Defines the template used by the widget

  • access: public
P4A_Widget useTemplate (string $template_name)
  • string $template_name

Inherited Methods

Inherited From P4A_Object

 P4A_Object::__construct()
 P4A_Object::actionHandler()
 P4A_Object::build()
 P4A_Object::destroy()
 P4A_Object::dropImplement()
 P4A_Object::dropMethod()
 P4A_Object::errorHandler()
 P4A_Object::getId()
 P4A_Object::getName()
 P4A_Object::getObjectType()
 P4A_Object::getParentID()
 P4A_Object::implement()
 P4A_Object::intercept()
 P4A_Object::isActionTriggered()
 P4A_Object::setName()
 P4A_Object::setParentID()
 P4A_Object::void()
 P4A_Object::_loadHelper()
 P4A_Object::__call()

Documentation generated on Tue, 02 Sep 2008 10:04:08 +0200 by phpDocumentor 1.4.2