[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/Web/UI/WebControls/ -> TDatePicker.php (sommaire)

TDatePicker class file.

Author: Wei Zhuo
Copyright: Copyright © 2005 PradoSoft
License: http://www.pradosoft.com/license/
Version: $Id: TDatePicker.php 1412 2006-09-14 00:47:58Z wei $
Poids: 891 lignes (27 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 4 classes

TDatePicker:: (57 méthodes):
  setAutoPostBack()
  getDateFormat()
  setDateFormat()
  getShowCalendar()
  setShowCalendar()
  getCulture()
  setCulture()
  setInputMode()
  getInputMode()
  setMode()
  getMode()
  setButtonImageUrl()
  getButtonImageUrl()
  setCalendarStyle()
  getCalendarStyle()
  setFirstDayOfWeek()
  getFirstDayOfWeek()
  getButtonText()
  setButtonText()
  setFromYear()
  getFromYear()
  setUpToYear()
  getUpToYear()
  getTimeStamp()
  setTimeStamp()
  getDate()
  setDate()
  getClientSide()
  createClientScript()
  getValidationPropertyValue()
  onPreRender()
  render()
  renderDatePickerButtons()
  loadPostData()
  getDateFromPostData()
  getDatePickerOptions()
  getCulturalOptions()
  getCurrentCulture()
  getLocalizedCalendarInfo()
  renderDropDownListCalendar()
  hasDayPattern()
  renderCalendarSelections()
  getTimeStampFromText()
  renderDropDownListOptions()
  renderCalendarDayOptions()
  getDropDownDayOptions()
  renderCalendarMonthOptions()
  getLocalizedMonthNames()
  renderCalendarYearOptions()
  getDatePickerButtonID()
  renderButtonDatePicker()
  renderImageButtonDatePicker()
  publishDefaultButtonImage()
  publishCalendarStyle()
  publishIFrameSpacer()
  addAttributesToRender()
  registerCalendarClientScript()

TDatePickerClientScript:: (2 méthodes):
  setOnDateChanged()
  getOnDateChanged()

TDatePickerInputMode:: (0 méthodes):

TDatePickerMode:: (0 méthodes):


Classe: TDatePicker  - X-Ref

TDatePicker class.

TDatePicker displays a text box for date input purpose.
When the text box receives focus, a calendar will pop up and users can
pick up from it a date that will be automatically entered into the text box.
The format of the date string displayed in the text box is determined by
the <b>DateFormat</b> property. Valid formats are the combination of the
following tokens,

<code>
Character Format Pattern (en-US)
-----------------------------------------
d          day digit
dd         padded day digit e.g. 01, 02
M          month digit
MM         padded month digit
MMMM       localized month name, e.g. March, April
yy         2 digit year
yyyy       4 digit year
-----------------------------------------
</code>

TDatePicker has three <b>Mode</b> to show the date picker popup.

# <b>Basic</b> -- Only shows a text input, focusing on the input shows the
date picker.
# <b>Button</b> -- Shows a button next to the text input, clicking on the
button shows the date, button text can be by the
<b>ButtonText</b> property
# <b>ImageButton</b> -- Shows an image next to the text input, clicking on
the image shows the date picker, image source can be
change through the <b>ButtonImageUrl</b> property.

The <b>CssClass</b> property can be used to override the css class name
for the date picker panel. <b>CalendarStyle</b> property sets the packages
styles available. E.g. <b>default</b>.

The <b>InputMode</b> property can be set to "TextBox" or "DropDownList" with
default as "TextBox".
In <tt>DropDownList</tt> mode, in addition to the popup date picker, three
drop down list (day, month and year) are presented to select the date .

setAutoPostBack($value)   X-Ref
AutoPostBack is not supported.


getDateFormat()   X-Ref

return: string the format of the date string

setDateFormat($value)   X-Ref
Sets the format of the date string.

param: string the format of the date string

getShowCalendar()   X-Ref

return: boolean whether the calendar window should pop up when the control receives focus

setShowCalendar($value)   X-Ref
Sets whether to pop up the calendar window when the control receives focus

param: boolean whether to show the calendar window

getCulture()   X-Ref
Gets the current culture.

return: string current culture, e.g. en_AU.

setCulture($value)   X-Ref
Sets the culture/language for the date picker.

param: string a culture string, e.g. en_AU.

setInputMode($value)   X-Ref

param: TDatePickerInputMode input method of date values

getInputMode()   X-Ref

return: TDatePickerInputMode input method of date values. Defaults to TDatePickerInputMode::TextBox.

setMode($value)   X-Ref

param: TDatePickerMode calendar UI mode

getMode()   X-Ref

return: TDatePickerMode current calendar UI mode.

setButtonImageUrl($value)   X-Ref

param: string the image url for "Image" UI mode.

getButtonImageUrl()   X-Ref

return: string the image url for "Image" UI mode.

setCalendarStyle($value)   X-Ref

param: string set the calendar style

getCalendarStyle()   X-Ref

return: string current calendar style

setFirstDayOfWeek($value)   X-Ref
Set the first day of week, with 0 as Sunday, 1 as Monday, etc.

param: integer 0 for Sunday, 1 for Monday, 2 for Tuesday, etc.

getFirstDayOfWeek()   X-Ref

return: integer first day of the week

getButtonText()   X-Ref

return: string text for the date picker button. Default is "...".

setButtonText($value)   X-Ref

param: string text for the date picker button

setFromYear($value)   X-Ref

param: integer date picker starting year, default is 2000.

getFromYear()   X-Ref

return: integer date picker starting year, default is -5 years

setUpToYear($value)   X-Ref

param: integer date picker ending year, default +10 years

getUpToYear()   X-Ref

return: integer date picker ending year, default +10 years

getTimeStamp()   X-Ref

return: integer current selected date from the date picker as timestamp.

setTimeStamp($value)   X-Ref
Sets the date for the date picker using timestamp.

param: float time stamp for the date picker

getDate()   X-Ref

return: string the date string.

setDate($value)   X-Ref

param: string date string

getClientSide()   X-Ref
Gets the TDatePickerClientScript to set the TDatePicker event handlers.

The date picker on the client-side supports the following events.
# <tt>OnDateChanged</tt> -- raised when the date is changed.

You can attach custom javascript code to each of these events

return: TDatePickerClientScript javascript validator event options.

createClientScript()   X-Ref

return: TDatePickerClientScript javascript validator event options.

getValidationPropertyValue()   X-Ref
Returns the value to be validated.
This methid is required by IValidatable interface.

return: integer the interger timestamp if valid, otherwise the original text.

onPreRender($param)   X-Ref
Publish the date picker Css asset files.


render($writer)   X-Ref
Renders body content.
This method overrides parent implementation by adding
additional date picker button if Mode is Button or ImageButton.

param: THtmlWriter writer

renderDatePickerButtons($writer)   X-Ref
Renders the date picker popup buttons.


loadPostData($key,$values)   X-Ref
Loads user input data. Override parent implementation, when InputMode
is DropDownList call getDateFromPostData to get date data.
This method is primarly used by framework developers.

param: string the key that can be used to retrieve data from the input data collection
param: array the input data collection
return: boolean whether the data of the component has been changed

getDateFromPostData($key, $values)   X-Ref
Loads date from drop down list data.

param: string the key that can be used to retrieve data from the input data collection
param: array the input data collection
return: array the date selected

getDatePickerOptions()   X-Ref
Get javascript date picker options.

return: array date picker client-side options

getCulturalOptions()   X-Ref
Get javascript localization options, e.g. month and weekday names.

return: array localization options.

getCurrentCulture()   X-Ref

return: string the current culture, falls back to application if culture is not set.

getLocalizedCalendarInfo()   X-Ref

return: DateTimeFormatInfo date time format information for the current culture.

renderDropDownListCalendar($writer)   X-Ref
Renders the drop down list date picker.


hasDayPattern()   X-Ref
Pas de description

renderCalendarSelections($writer, $date)   X-Ref
Renders the calendar drop down list depending on the DateFormat pattern.

param: THtmlWriter the Html writer to render the drop down lists.
param: array the current selected date

getTimeStampFromText()   X-Ref
Gets the date from the text input using TSimpleDateFormatter

return: integer current selected date timestamp

renderDropDownListOptions($writer,$options,$selected=null)   X-Ref
Renders a drop down lists.

param: THtmlWriter the writer used for the rendering purpose
param: array list of selection options
param: mixed selected key.

renderCalendarDayOptions($writer, $selected=null)   X-Ref
Renders the day drop down list options.

param: THtmlWriter the writer used for the rendering purpose
param: mixed selected day.

getDropDownDayOptions()   X-Ref

return: array list of day options for a drop down list.

renderCalendarMonthOptions($writer, $selected=null)   X-Ref
Renders the month drop down list options.

param: THtmlWriter the writer used for the rendering purpose
param: mixed selected month.

getLocalizedMonthNames($info)   X-Ref
Returns the localized month names that depends on the month format pattern.
"MMMM" will return the month names, "MM" or "MMM" return abbr. month names
and "M" return month digits.

param: DateTimeFormatInfo localized date format information.
return: array localized month names.

renderCalendarYearOptions($writer, $selected=null)   X-Ref
Renders the year drop down list options.

param: THtmlWriter the writer used for the rendering purpose
param: mixed selected year.

getDatePickerButtonID()   X-Ref
Gets the ID for the date picker trigger button.

return: string unique button ID

renderButtonDatePicker($writer)   X-Ref
Adds an additional button such that when clicked it shows the date picker.

return: THtmlWriter writer

renderImageButtonDatePicker($writer)   X-Ref
Adds an additional image button such that when clicked it shows the date picker.

return: THtmlWriter writer

publishDefaultButtonImage()   X-Ref
Publish the default button image asset file.

return: string image file url.

publishCalendarStyle()   X-Ref
Publish the calendar style Css asset file.

return: string Css file url.

publishIFrameSpacer()   X-Ref
Publish the spacer.gif for IE iframe source.

return: string the URL for the spacer.gif.

addAttributesToRender($writer)   X-Ref
Add the client id to the input textbox, and register the client scripts.

param: THtmlWriter writer

registerCalendarClientScript()   X-Ref
Registers the javascript code to initialize the date picker.


Classe: TDatePickerClientScript  - X-Ref

TDatePickerClientScript class.

Client-side date picker event {@link setOnDateChanged OnDateChanged}
can be modified through the {@link TDatePicker:: getClientSide ClientSide}
property of a date picker.

The <tt>OnDateChanged</tt> event is raise when the date picker's date
is changed.

setOnDateChanged($javascript)   X-Ref
Javascript code to execute when the date picker's date is changed.

param: string javascript code

getOnDateChanged()   X-Ref

return: string javascript code to execute when the date picker's date is changed.

Classe: TDatePickerInputMode  - X-Ref

TDatePickerInputMode class.
TDatePickerInputMode defines the enumerable type for the possible datepicker input methods.

The following enumerable values are defined:
- TextBox: text boxes are used to input date values
- DropDownList: dropdown lists are used to pick up date values

Classe: TDatePickerMode  - X-Ref

TDatePickerMode class.
TDatePickerMode defines the enumerable type for the possible UI mode
that a {@link TDatePicker} control can take.

The following enumerable values are defined:
- Basic: Only shows a text input, focusing on the input shows the date picker
- Button: Shows a button next to the text input, clicking on the button shows the date, button text can be by the
- ImageButton: Shows an image next to the text input, clicking on the image shows the date picker,



Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7