Skip to content

Checkbox

Anthony Ma edited this page May 26, 2015 · 3 revisions

A Checkbox component lets users make a boolean choice. #Fields

  • x default: 1 - x value of the component
  • y default: 1 - y value of the component
  • h default: 1 - height of the component
  • w default: 16 - width of the component
  • z default: 0 - z value of the component
  • parent - parent window object of the component
  • removed - whether the component has been queued for removal - should only be modified by the library itself
  • visible default: true - whether the component is visible
  • bgColor default: colors.lightGray - color of the background of the text
  • boxColor default: colors.white - color of the background of the checkbox
  • textColor default: colors.black - color of the text
  • checkedChar default: "X" - character displayed in the box when it is checked
  • checked default: "false" - whether the checkbox has been checked
  • text default: "txUI Checkbox" - text displayed next to the checkbox
  • textPosition default: "right" - which side the text is relative to the checkbox

#Functions

  • function draw(self) - draws the checkbox and text
  • function click(self, x, y) called by the library to see if the checkbox has been clicked
  • function update(self) called every update cycle
  • function termX(self) - returns the x position on the terminal
  • function termY(self) - returns the y position on the terminal
  • function setPos(self, x, y) - sets the position of the component
  • function setSize(self, w, h) - sets the size of the component