Class: Button

Button

represents button

new Button(params)

Button [TextBox]
This:
Parameters:
Name Type Argument Description
params Object <optional>
Properties
Name Type Argument Description
str string <optional>
="str"] displayed string of button
x number <optional>
=100.] x coordinate of left upper end
y number <optional>
=100.] y coordinate of left upper end
width number <optional>
=100.] button width [pixels]
height number <optional>
=30.] button height [pixels]
r number <optional>
=4.] radius of button corners camber
bgColor string <optional>
="#bbb"] background color of button
bgColorWhenClicked string <optional>
="#aaa"] background color of button when clicked
Properties:
Name Type Description
x number x coordinate of left upper end
y number y coordinate of left upper end
width number width of button [pixels]
height number height of button [pixels]
bgColor color background color of button
bgColorWhenClicked color background color of button when clicked
text Raphael.text object of receiver
cover Raphael.rect transparent rectangle responsible for clicking events
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 1334

Extends

Methods

onClick()

What to do when clicked. Initially empty function, overwrite it by desired actions
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 1353

setStr(str)

Sets new text of receiver
Parameters:
Name Type Description
str string new string
Inherited From:
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 1290

setX(x)

Sets new x position of receiver (this.x = x)
Parameters:
Name Type Description
x number new x coordinate [pixel]
Inherited From:
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 1274

setXY(x, y)

Sets new x and y position of receiver (this.x = x; this.y = y)
Parameters:
Name Type Description
x number new x coordinate [pixel]
y number new y coordinate [pixel]
Inherited From:
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 1265

setY(y)

Sets new y position of receiver (this.y = y)
Parameters:
Name Type Description
y number new y coordinate [pixel]
Inherited From:
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 1282

update()

Update receiver
Inherited From:
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 1256