thyButton

Button Widget

The button can be toggle or normal one.  The available component user events are onbuttondown, onbuttonup for toggle button and onclick for non-toggle button.

CSS classes

  • .thyButton,
  • .thyButton_pushed,
  • .<object name>,
  • .<object name>_pushed,

Events

  • onclick
  • onbuttondown
  • onbuttonup

Author

Raphael Derosso Pereira

Summary
Button Widget
Calls all required initialization procedures.
Update the button caption
Returns the current caption of this button
Sets the type of button to toggle or to conventional
Has the same effect as pushing the button with the mouse
Has the same effect as releasing the button with the mouse
Overwritten method that puts button back to it initial state
Overwritten method that puts button back to it initial state
This invokes the function associated with the onbuttondown event and garantees that the button has the right CSS class
This invokes the function associated with the onbuttonup event and garantees that the button has the right CSS class
Returns a function that will be called when ‘onmouseover’ event occurs.
Returns a function that will be called when ‘onmouseout’ event occurs.
Checks on every mouseup event if the event was done out of the button and in that case, changes the toggle status of the button to 0

initThyButton

p.initThyButton = function ()

Calls all required initialization procedures.  This will be called just before creating the object.

populate

p.populate = function(data)

Update the button caption

sweepOut

p.sweepOut = function()

Returns the current caption of this button

setToggle

p.setToggle = function(bool)

Sets the type of button to toggle or to conventional

Parameters

boolTrue -> toggle button, false -> normal button

pressButton

p.pressButton = function (event)

Has the same effect as pushing the button with the mouse

Parameter

event(boolean) Call event?

releaseButton

p.releaseButton = function (event)

Has the same effect as releasing the button with the mouse

Parameter

event(boolean) Call event?

_cleanUp

p._cleanUp = function ()

Overwritten method that puts button back to it initial state

_reset

Overwritten method that puts button back to it initial state

_getOnButtonDown

p._getOnButtonDown = function()

This invokes the function associated with the onbuttondown event and garantees that the button has the right CSS class

_getOnButtonUp

p._getOnButtonUp = function()

This invokes the function associated with the onbuttonup event and garantees that the button has the right CSS class

_getOnMouseOver

p._getOnMouseOver = function ()

Returns a function that will be called when ‘onmouseover’ event occurs.

This function specifically handles the insertion of the pushed CSS class when the button has been pushed down and the mouse has gone out without the user releasing the mouse button.  If the user gets back with the mouse holding pressed over the button, the button must appear as pushed.

_getOnMouseOut

p._getOnMouseOut = function ()

Returns a function that will be called when ‘onmouseout’ event occurs.

This function specifically handles the removal of the pushed CSS class when the button is not a toggle button

_getDocMouseUp

p._getDocMouseUp = function ()

Checks on every mouseup event if the event was done out of the button and in that case, changes the toggle status of the button to 0

p.initThyButton = function ()
Calls all required initialization procedures.
p.populate = function(data)
Update the button caption
p.sweepOut = function()
Returns the current caption of this button
p.setToggle = function(bool)
Sets the type of button to toggle or to conventional
p.pressButton = function (event)
Has the same effect as pushing the button with the mouse
p.releaseButton = function (event)
Has the same effect as releasing the button with the mouse
p._cleanUp = function ()
Overwritten method that puts button back to it initial state
p._getOnButtonDown = function()
This invokes the function associated with the onbuttondown event and garantees that the button has the right CSS class
p._getOnButtonUp = function()
This invokes the function associated with the onbuttonup event and garantees that the button has the right CSS class
p._getOnMouseOver = function ()
Returns a function that will be called when ‘onmouseover’ event occurs.
p._getOnMouseOut = function ()
Returns a function that will be called when ‘onmouseout’ event occurs.
p._getDocMouseUp = function ()
Checks on every mouseup event if the event was done out of the button and in that case, changes the toggle status of the button to 0