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

Class: Structures_Form_Element_Gtk2_DateTime

Source Location: /Structures_Form_Gtk2-0.8.0devel/Element/Gtk2/DateTime.php

Class Overview

GtkHBox
   |
   --Structures_Form_Element_Gtk2_DateTime

A Structures_Form element for a set of date and time dropdown boxes.


Author(s):

  • Scott Mattocks

Version:

  • 0.8.0devel

Copyright:

  • Copyright 2006 Scott Mattocks

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 15]
A Structures_Form element for a set of date and time dropdown boxes.

This element is a composite element made of several Gtk2TextSelect elements.

This class implement Structures_Form_ElementInterface.

  • Author: Scott Mattocks
  • Version: 0.8.0devel
  • Copyright: Copyright 2006 Scott Mattocks
  • License: PHP


[ Top ]


Class Variables

$ampm =

[line 99]

The AM/PM element.
  • Access: public

Type:   object


[ Top ]

$day =

[line 60]

The day element.
  • Access: public

Type:   object


[ Top ]

$form =

[line 44]

The Structures_Form object.
  • Access: public

Type:   object


[ Top ]

$hour =

[line 75]

The hour element.
  • Access: public

Type:   object


[ Top ]

$minute =

[line 83]

The minute element.
  • Access: public

Type:   object


[ Top ]

$minuteIncrements =

[line 107]

The increments to display for minutes.
  • Access: public

Type:   integer


[ Top ]

$month =

[line 52]

The month element.
  • Access: public

Type:   object


[ Top ]

$second =

[line 91]

The second element.
  • Access: public

Type:   object


[ Top ]

$year =

[line 68]

The year element.
  • Access: public

Type:   object


[ Top ]



Method Detail

__construct (Constructor)   [line 126]

void __construct( Structures_Form $form, string $label, [string $date = null], [array $order = null], [integer $yearStart = null], [integer $duration = null], [ $minuteIncrements = null], [array $size = null], [object $style = null])

Constructor.
  • Access: public

Parameters:

object   $form   —  The Structures_Form.
string   $label   —  The string to be used as the label.
string   $date   —  The default date (optional).
array   $order   —  The elements to display and the order to display them. (optional).
integer   $yearStart   —  The first year for the year element (optional).
integer   $duration   —  The number of years to show (optional).
array   $size   —  The height and width of the entry (optional).
object   $style   —  The GtkStyle to apply to the elements (optional).
   $minuteIncrements   — 

[ Top ]

addEventHandler   [line 517]

array addEventHandler( string $eventName, mixed $callback)

Adds an event handler for the element.
  • Return: An array of identifiers, one for each piece.
  • Access: public

Parameters:

string   $eventName   —  The name of the event.
mixed   $callback   —  The callback to call when the event occurs.

[ Top ]

clearValue   [line 376]

boolean clearValue( )

Clears the current value of the element.

This method should clear the current value if possible. For example, if the widget is a GtkEntry, this method should pass null to set_text(). If the value could not be cleared for some reason (the item is frozen or it is not possible to clear the value (selection type = browse)) this method should return false.

It may not be possible to clear this element type. If the children cannot be cleared, this element cannot be cleared.

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

[ Top ]

createElements   [line 202]

void createElements( integer $yearStart, integer $duration, [boolean $twelveHour = false])

Creates the individual date elements.

This element is made up of month, day and year elements.

  • Access: protected

Parameters:

integer   $yearStart   —  The first year to show.
integer   $duration   —  The number of years to show.
boolean   $twelveHour   —  true to use 12 hour format.

[ Top ]

freeze   [line 444]

void freeze( )

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

Again this method exists only to maintain consistency in the interface. It should just pass false to set_sensitive().

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

  • Access: public

[ Top ]

getLabel   [line 504]

string getLabel( )

Returns the GtkLabel that identifies the element.
  • Access: public

[ Top ]

getName   [line 427]

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 396]

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 350]

integer getValue( )

Returns element's value.

This method should return the widget's value not just some data from the widget (i.e. set with set_data()). For example if the widget is a GtkEntry, this method should call get_text(). If the widget is a GtkComboBox, this method should return the value of the column identified when the element was constructed for the given row.

  • Access: public

[ Top ]

isFrozen   [line 481]

boolean isFrozen( )

Returns whether or not the element is currently frozen.

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

  • Access: public

[ Top ]

setLabel   [line 493]

void setLabel( string $label)

Sets the GtkLabel that identifies the element.
  • Access: public

Parameters:

string   $label   — 

[ Top ]

setName   [line 412]

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 ]

setValue   [line 303]

boolean setValue( string $value)

Sets an element's value.

This method should set the value of the widget not just set some data that is retrieved later. If the widget is a GtkEntry, this method should call set_text(). If the widget is a GtkComboBox, this method should set the active row.

To set the value of this element, we must set the value of the three composite elements. To do this, we first turn the timestamp into a date string and then explode on '-'. This is faster than calling date() three different times.

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

Parameters:

string   $value   —  The text to put in the entry.

[ Top ]

unfreeze   [line 465]

void unfreeze( )

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

Again this method exists only to maintain consistency in the interface. It should just pass true to set_sensitive().

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.