Structures_Form
[ class tree: Structures_Form ] [ index: Structures_Form ] [ all elements ]

Class: Structures_Form_Group_Gtk2_Frame

Source Location: /Structures_Form_Gtk2-0.8.0devel/Group/Gtk2/Frame.php

Class Overview

GtkFrame
   |
   --Structures_Form_Group_Gtk2_Frame



Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 18]


[ Top ]


Class Variables

$elements = array()

[line 34]

Elements that are members of this group.
  • Access: public

Type:   array


[ Top ]

$form =

[line 26]

The Structures_Form object.
  • Access: public

Type:   object


[ Top ]

$renderer =

[line 42]

The renderer for the element.
  • Access: public

Type:   object


[ Top ]



Method Detail

__construct (Constructor)   [line 56]

void __construct( object $form, [string $label = ''], [array $size = null], [object $style = null], [object $renderer = null])

Constructor.
  • Access: public

Parameters:

object   $form   —  The form.
string   $label   —  The string to be used as the label (optional).
array   $size   —  The height and width of the entry (optional).
object   $style   —  The GtkStyle to apply to the entry (optional).
object   $renderer   —  A Structures_Form renderer for the frame contents (optional).

[ Top ]

addElement   [line 310]

boolean addElement( object $element)

Adds an element to the group.
  • Return: true if the element was added.
  • Access: public

Parameters:

object   $element   —  An element object.

[ Top ]

clearValue   [line 423]

boolean clearValue( )

Clears the current values of the group elements.

This method should clear the current value of each element in the group. If not all values can be cleared, this method should return false. To clear the elements' values, clearValue() should be called on each element.

  • Return: true if the value was cleared.
  • Access: public

[ Top ]

elementExists   [line 298]

boolean elementExists( string $name)

Returns whether or not an element with the given name exists in the group.
  • Return: true if the element is a member of the group.
  • Access: public

Parameters:

string   $name   —  The name of the element.

[ Top ]

freeze   [line 449]

void freeze( )

Freezes the elements in the group so that its value may not be changed.

This method should call freeze() on every member of the group.

To make life easier down the road this method should also call set_data('frozen', true);

  • Access: public

[ Top ]

getAllElements   [line 285]

array getAllElements( )

Returns an array containing all elements in the group.

The array should be of the form: array(<name> => <element>)

  • Access: public

[ Top ]

getElement   [line 267]

object The getElement( string $name)

Returns an element from a group.

This method should return the element with the given name. If there is no element with the given name, this method should return false.

  • Return: element object.
  • Access: public

Parameters:

string   $name   —  The element name.

[ Top ]

getLabel   [line 517]

string getLabel( )

Returns the label that identifies the group.

This group does not return an identifying label even if one is set. This is because the label is automatically added as part of the frame. If you want to get the label that is part of the frame use GtkFrame::get_label.

  • Access: public

[ Top ]

getName   [line 128]

string getName( )

Returns the element's name.

This method exists to maintain consistency in the interface. It should simply call get_name which is a GtkWidget method and should be available to all elements.

  • Access: public

[ Top ]

getType   [line 97]

string getType( )

Returns the element type.

This method must return a string identifying the element type, such as text, password, submit, etc.

  • Return: The element type.
  • Access: public

[ Top ]

getValue   [line 401]

array getValue( )

Returns an array of the group elements' values.

This method should return an array of the form: array(<name> => <value>) The name and value should be obtained by calling getName() and getValue() respectively for each member of the group.

  • Access: public

[ Top ]

isFrozen   [line 490]

boolean isFrozen( )

Returns whether or not the group is currently frozen.

This method should just return the value from get_data('frozen')

  • Access: public

[ Top ]

removeElement   [line 343]

void removeElement( object $element)

Removes an element from the group.

This method should fail gracefully (no errors or notices) if the element is not part of the group.

  • Access: public

Parameters:

object   $element   —  The element object to remove.

[ Top ]

render   [line 214]

object A render( )

Renders the contents of the frame.

Passes the elements, required note and required symbol to the renderer and then calls renderer().

Pulling elements out of a renderer is a pain in the ass. Trying to find the correct widget (or parent widget) can be nearly impossible. Therefore, even if you remove a widget from the form, it will still appear if the widget was removed after the form was rendered.

  • Return: container widget holding the form.
  • Throws: Structures_Form_Gtk2_Exception
  • Access: public

[ Top ]

setDefaultRenderer   [line 187]

void setDefaultRenderer( )

Creates a default renderer and sets it as the current renderer.

An exception may be thrown by setRenderer. It will pass through to the calling function.

  • Access: protected

[ Top ]

setLabel   [line 502]

void setLabel( string $label)

Sets the label that identifies the group.
  • Access: public

Parameters:

string   $label   —  A label identifying the group.

[ Top ]

setName   [line 113]

void setName( string $name)

Sets the element name.

This method exists to maintain consistency in the interface. It should simply call set_name which is a GtkWidget method and should be avialable to all elements.

  • Access: public

Parameters:

string   $name   — 

[ Top ]

setRenderer   [line 156]

void setRenderer( object $renderer)

Sets a renderer object.

Renderers must implement Structures_Form_RendererInterface. This helps to ensure consistency among the API and avoid any fatal errors. A renderer is used to position and display the form elements within a container widget.

Unlike rules and elements, renderers are created on their own (not through a form method). This is because they do not need to know thing about the form at construction time and the form does not need to know anything about the renderer until the form is to be displayed.

A form may only have one renderer at a time. Setting a second renderer will overwrite the first. If no renderer is set, the default renderer will be used.

  • Throws: Structures_Form_Gtk2_Exception
  • Access: public

Parameters:

object   $renderer   —  An object that implements Structures_Form::RENDERER_INTERFACE

[ Top ]

setValue   [line 371]

boolean setValue( array $values)

Sets the values of the group elements.

This method should set the value of each element in the group. This should be done by calling the element's setValue() method.

  • Return: true if the value was changed.
  • Access: public

Parameters:

array   $values   —  The values to set for the group elements.

[ Top ]

unfreeze   [line 471]

void unfreeze( )

Unfreezes the element so that its value may not be changed.

This method should call unfreeze() on every member of the group.

To make life easier down the road this method should also call set_data('frozen', false);

  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:44:12 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.