|
Class TSlider
TSlider class
TSlider displays a slider for numeric input purpose. A slider consists of a
'track', which define the range of possible value, and a 'handle' which can
slide on the track, to select a value in the range. The track can be either
Horizontal or Vertical, depending of the SetDirection Direction
property. By default, it's horizontal.
The range boundaries are defined by SetMinValue MinValue and SetMaxValue MaxValue properties. The default range is from 0 to 100. The SetStepSize StepSize property can be used to define the step between 2
values inside the range. Notice that this step will be recomputed if there is
more than 200 values between the range boundaries. You can also provide the
allowed values by setting the SetValues Values array.
A 'Progress Indicator' can be displayed within the track with the SetProgressIndicator ProgressIndicator property.
The TSlider control can be easily customized using CssClasses. You can
provide your own css file, using the SetCssUrl CssUrl property. The css
class for TSlider can be set by the setCssClass CssClass property.
Default value is "Slider HorizontalSlider" for an horizontal slider, and "Slider
VerticalSlider" for a vertical one.
If SetAutoPostBack AutoPostBack property is true, postback is sent as
soon as the value changed.
TSlider raises the TSlider::onValueChanged() event when the value of the slider
has changed during postback.
You can also attach ClientSide javascript events handler to the slider :
- ClientSide.onSlide is called when the handle is slided on the track. You can
get the current value in the value
javascript variable. You can use this event to update on client side a label
with the current value
- ClientSide.onChange is called when the slider value has changed (at the end
of a move).
-
TComponent
-
TApplicationComponent
-
TControl
implements
IRenderable,
IBindable
-
TWebControl
implements
IStyleable
-
TSlider
implements
IPostBackDataHandler,
IDataRenderer
Methods summary
public
TSliderDirection
|
#
getDirection( )
Returns
TSliderDirection
Direction of slider (Horizontal or Vertical). Defaults to Horizontal.
|
public
|
|
public
string
|
#
getCssUrl( )
Returns
string URL for the CSS file including all relevant CSS class definitions. Defaults to
'' (a default CSS file will be applied in this case.)
|
public
|
#
setCssUrl( string $value )
Parameters
- $value
string URL for the CSS file including all relevant CSS class definitions.
|
public
float
|
#
getMaxValue( )
Returns
float Maximum value for the slider. Defaults to 100.0.
|
public
|
#
setMaxValue( float $value )
Parameters
- $value
float Maximum value for slider
|
public
float
|
#
getMinValue( )
Returns
float Minimum value for slider. Defaults to 0.0.
|
public
|
#
setMinValue( float $value )
Parameters
- $value
float Minimum value for slider
|
public
float
|
#
getStepSize( )
Returns
float Step size. Defaults to 1.0.
|
public
|
#
setStepSize( float $value )
Sets the step size used to determine the places where the slider handle can
stop at. An evenly distributed stop marks will be generated according to getMinValue MinValue, getMaxValue MaxValue and StepSize. To use uneven
stop marks, set setValues Values.
Sets the step size used to determine the places where the slider handle can
stop at. An evenly distributed stop marks will be generated according to getMinValue MinValue, getMaxValue MaxValue and StepSize. To use uneven
stop marks, set setValues Values.
Parameters
|
public
boolean
|
#
getProgressIndicator( )
Returns
boolean wether to display a progress indicator or not. Defaults to true.
|
public
|
#
setProgressIndicator( boolean $value )
Parameters
- $value
boolean wether to display a progress indicator or not. Defaults to true.
|
public
float
|
#
getValue( )
Returns
float current value of slider
|
public
|
#
setValue( float $value )
Parameters
- $value
float current value of slider
|
public
string
|
#
getData( )
Returns the value of the TSlider control. This method is required by IDataRenderer . It is the same as TSlider::getValue() .
Returns
string the value of the TSlider control.
See
Implementation of
|
public
|
#
setData( string $value )
Sets the value of the TSlider control. This method is required by IDataRenderer . It is the same as TSlider::setValue() .
Parameters
- $value
string the value of the TSlider control.
See
Implementation of
|
public
array
|
#
getValues( )
Returns
array list of allowed values the slider can take. Defaults to an empty array.
|
public
|
#
setValues( array $value )
Sets the possible values that the slider can take. If this is set, setStepSize StepSize will be ignored. The latter generates a set of evenly
distributed candidate values.
Sets the possible values that the slider can take. If this is set, setStepSize StepSize will be ignored. The latter generates a set of evenly
distributed candidate values.
Parameters
- $value
array list of allowed values the slider can take
|
public
boolean
|
#
getAutoPostBack( )
Returns
boolean a value indicating whether an automatic postback to the server will occur
whenever the user modifies the slider value. Defaults to false.
|
public
|
#
setAutoPostBack( boolean $value )
Sets the value indicating if postback automatically. An automatic postback to
the server will occur whenever the user modifies the slider value.
Sets the value indicating if postback automatically. An automatic postback to
the server will occur whenever the user modifies the slider value.
Parameters
- $value
boolean the value indicating if postback automatically
|
protected
string
|
#
getClientClassName( )
Gets the name of the javascript class responsible for performing postback for
this control. This method overrides the parent implementation.
Gets the name of the javascript class responsible for performing postback for
this control. This method overrides the parent implementation.
Returns
string the javascript class name
|
public
boolean
|
#
getDataChanged( )
Returns a value indicating whether postback has caused the control data
change. This method is required by the IPostBackDataHandler interface.
Returns a value indicating whether postback has caused the control data
change. This method is required by the IPostBackDataHandler interface.
Returns
boolean whether postback has caused the control data change. False if the page is not in
postback mode.
Implementation of
|
public
|
#
raisePostDataChangedEvent( )
Raises postdata changed event. This method is required by IPostBackDataHandler interface. It is invoked by the framework when getValue Value property is changed on postback. This method is primarly used by
framework developers.
Raises postdata changed event. This method is required by IPostBackDataHandler interface. It is invoked by the framework when getValue Value property is changed on postback. This method is primarly used by
framework developers.
Implementation of
|
public
|
#
onValueChanged( TEventParameter $param )
Raises OnValueChanged event. This method is invoked when the getValue Value property changes on postback. If you override this method, be
sure to call the parent implementation to ensure the invocation of the attached
event handlers.
Raises OnValueChanged event. This method is invoked when the getValue Value property changes on postback. If you override this method, be
sure to call the parent implementation to ensure the invocation of the attached
event handlers.
Parameters
|
public
boolean
|
#
loadPostData( string $key, array $values )
Loads user input data. This method is primarly used by framework
developers.
Loads user input data. This method is primarly used by framework
developers.
Parameters
- $key
string the key that can be used to retrieve data from the input data collection
- $values
array the input data collection
Returns
boolean whether the data of the component has been changed
Implementation of
|
public
TSliderClientScript
|
#
getClientSide( )
Gets the TSliderClientScript to set the TSlider event handlers.
Gets the TSliderClientScript to set the TSlider event handlers.
The slider on the client-side supports the following events. #
OnSliderMove -- raised when the slider is moved. #
OnSliderChanged -- raised when the slider value is changed
You can attach custom javascript code to each of these events
Returns
|
protected
TSliderClientScript
|
|
public
string
|
#
getTagName( )
Returns
string the HTML tag name for slider. Defaults to div.
Overrides
|
protected
|
#
addAttributesToRender( THtmlWriter $writer )
Add the specified css classes to the track
Add the specified css classes to the track
Parameters
Overrides
|
public
|
#
renderContents( THtmlWriter $writer )
Render the body content
Parameters
- $writer
THtmlWriter
the writer used for the rendering purpose
Overrides
|
public
|
#
onPreRender( mixed $param )
Registers CSS and JS. This method is invoked right before the control
rendering, if the control is visible.
Registers CSS and JS. This method is invoked right before the control
rendering, if the control is visible.
Parameters
- $param
mixed event parameter
Overrides
|
protected
|
#
registerStyleSheet( )
Registers the CSS relevant to the TSlider. It will register the CSS file
specified by getCssUrl CssUrl. If that is not set, it will use the
default CSS.
Registers the CSS relevant to the TSlider. It will register the CSS file
specified by getCssUrl CssUrl. If that is not set, it will use the
default CSS.
|
protected
|
#
registerSliderClientScript( )
Registers the javascript code to initialize the slider.
Registers the javascript code to initialize the slider.
|
protected
array
|
#
getSliderOptions( )
Get javascript sliderr options.
Get javascript sliderr options.
Returns
array slider client-side options
|
Methods inherited from TWebControl
clearStyle(),
copyBaseAttributes(),
createStyle(),
getAccessKey(),
getBackColor(),
getBorderColor(),
getBorderStyle(),
getBorderWidth(),
getCssClass(),
getDecorator(),
getDisplay(),
getEnsureId(),
getFont(),
getForeColor(),
getHasStyle(),
getHeight(),
getStyle(),
getTabIndex(),
getToolTip(),
getWidth(),
render(),
renderBeginTag(),
renderEndTag(),
setAccessKey(),
setBackColor(),
setBorderColor(),
setBorderStyle(),
setBorderWidth(),
setCssClass(),
setDisplay(),
setEnsureId(),
setForeColor(),
setHeight(),
setStyle(),
setTabIndex(),
setToolTip(),
setWidth()
|
Methods inherited from TControl
__construct(),
__get(),
addParsedObject(),
addToPostDataLoader(),
addedControl(),
applyStyleSheetSkin(),
autoBindProperty(),
autoDataBindProperties(),
bindProperty(),
broadcastEvent(),
bubbleEvent(),
clearChildState(),
clearControlState(),
clearNamingContainer(),
clearViewState(),
convertUniqueIdToClientId(),
createChildControls(),
createControlCollection(),
dataBind(),
dataBindChildren(),
dataBindProperties(),
ensureChildControls(),
findControl(),
findControlsByID(),
findControlsByType(),
focus(),
getAdapter(),
getAllowChildControls(),
getAttribute(),
getAttributes(),
getChildControlsCreated(),
getClientID(),
getControlStage(),
getControlState(),
getControls(),
getCustomData(),
getEnableTheming(),
getEnableViewState(),
getEnabled(),
getHasAdapter(),
getHasAttributes(),
getHasChildInitialized(),
getHasControls(),
getHasInitialized(),
getHasLoaded(),
getHasLoadedPostData(),
getHasPreRendered(),
getID(),
getIsSkinApplied(),
getNamingContainer(),
getPage(),
getParent(),
getRegisteredObject(),
getSkinID(),
getSourceTemplateControl(),
getTemplateControl(),
getUniqueID(),
getViewState(),
getVisible(),
hasAttribute(),
initRecursive(),
isDescendentOf(),
isObjectRegistered(),
loadRecursive(),
loadState(),
loadStateRecursive(),
onDataBinding(),
onInit(),
onLoad(),
onUnload(),
preRenderRecursive(),
raiseBubbleEvent(),
registerObject(),
removeAttribute(),
removedControl(),
renderChildren(),
renderControl(),
saveState(),
saveStateRecursive(),
setAdapter(),
setAttribute(),
setChildControlsCreated(),
setControlStage(),
setControlState(),
setCustomData(),
setEnableTheming(),
setEnableViewState(),
setEnabled(),
setID(),
setPage(),
setSkinID(),
setTemplateControl(),
setViewState(),
setVisible(),
trackViewState(),
traverseChildControls(),
unbindProperty(),
unloadRecursive(),
unregisterObject()
|
Methods inherited from TComponent
__call(),
__destruct(),
__isset(),
__set(),
__sleep(),
__unset(),
__wakeup(),
asa(),
attachBehavior(),
attachBehaviors(),
attachClassBehavior(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
clearBehaviors(),
createdOnTemplate(),
detachBehavior(),
detachBehaviors(),
detachClassBehavior(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
evaluateStatements(),
fxAttachClassBehavior(),
fxDetachClassBehavior(),
getAutoGlobalListen(),
getBehaviorsEnabled(),
getClassHierarchy(),
getEventHandlers(),
getListeningToGlobalEvents(),
getSubProperty(),
hasEvent(),
hasEventHandler(),
hasProperty(),
isa(),
listen(),
raiseEvent(),
setSubProperty(),
unlisten()
|
Constants summary
integer |
MAX_STEPS |
200 |
|
Constants inherited from TControl
AUTOMATIC_ID_PREFIX,
CLIENT_ID_SEPARATOR,
CS_CHILD_INITIALIZED,
CS_CONSTRUCTED,
CS_INITIALIZED,
CS_LOADED,
CS_PRERENDERED,
CS_STATE_LOADED,
ID_FORMAT,
ID_SEPARATOR,
IS_CHILD_CREATED,
IS_CREATING_CHILD,
IS_DISABLE_THEMING,
IS_DISABLE_VIEWSTATE,
IS_ID_SET,
IS_SKIN_APPLIED,
IS_STYLESHEET_APPLIED,
RF_ADAPTER,
RF_AUTO_BINDINGS,
RF_CHILD_STATE,
RF_CONTROLS,
RF_CONTROLSTATE,
RF_DATA_BINDINGS,
RF_EVENTS,
RF_NAMED_CONTROLS,
RF_NAMED_CONTROLS_ID,
RF_NAMED_OBJECTS,
RF_SKIN_ID
|
|