apwidgets
Class PButton

java.lang.Object
  extended by apwidgets.PWidget
      extended by apwidgets.PTextView
          extended by apwidgets.PButton
All Implemented Interfaces:
android.text.NoCopySpan, android.text.TextWatcher, android.view.View.OnClickListener
Direct Known Subclasses:
PCompoundButton, PRadioButton

public class PButton
extends PTextView

A button. Add instances to PWidgetContainer.

To capture onClick events, declare in sketch:

void onClickWidget(PWidget source)
{
// Your code here.
}

Author:
Rikard Lundstedt

Nested Class Summary
 
Nested classes/interfaces inherited from interface android.text.NoCopySpan
android.text.NoCopySpan.Concrete
 
Constructor Summary
PButton(int x, int y, int width, int height, java.lang.String text)
          Creates a button.
PButton(int x, int y, java.lang.String text)
          Creates a button.
 
Method Summary
 void init(processing.core.PApplet pApplet)
          Initializes the button.
 
Methods inherited from class apwidgets.PTextView
afterTextChanged, beforeTextChanged, getText, getTextColor, getTextSize, onTextChanged, setText, setTextColor, setTextSize
 
Methods inherited from class apwidgets.PWidget
addOnClickWidgetListener, getHeight, getPApplet, getWidth, getView, getX, getY, onClick, setPosition, setSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PButton

public PButton(int x,
               int y,
               java.lang.String text)
Creates a button.

Parameters:
x - The button's x position.
y - The button's y position.
text - The text on the button's label.

PButton

public PButton(int x,
               int y,
               int width,
               int height,
               java.lang.String text)
Creates a button.

Parameters:
x - The button's x position.
y - The button's y position.
width - The button's width.
height - The button's height.
text - The text on the button's label.
Method Detail

init

public void init(processing.core.PApplet pApplet)
Initializes the button. Is called by PWidgetContainer as it is added to it.

Overrides:
init in class PTextView