/***************************************************************\
| |\  /|                                                We Put  |
| | >< Hypercosm           toolbar_button.js            3d      |
| |/  \|                                                To Work |
|***************************************************************|
|                                                               |
|        This file defines the Javascript behaviors of an       |
|        abstract, generalized SketchUp interface button.       |
|                                                               |
|***************************************************************|
|                Copyright (c) 2007 Hypercosm, LLC.             |
\***************************************************************/


//
// "class" constructor
//


function toolbarButton(element, parent) {
	
  // call superclass constructor
  //
  button.call(this, element, parent);
  
  // set attributes
  //
  this.helpMessage = "";
  
  return this;
}    // toolbarButton


// inherit prototype from "superclass"
//
toolbarButton.prototype = new button();


//
// mouse event handling methods
//


toolbarButton.prototype.onMouseOver = function() {
  if (this.parent.parent.standardToolbar)
    if (this.parent.parent.standardToolbar.helpButton)
      if (this.parent.parent.standardToolbar.helpButton.selected)
        return;
  button.prototype.onMouseOver.call(this);
};    // onMouseOver


toolbarButton.prototype.onMouseOut = function() {
  if (this.parent.parent.standardToolbar)
    if (this.parent.parent.standardToolbar.helpButton)
      if (this.parent.parent.standardToolbar.helpButton.selected)
        return;
  button.prototype.onMouseOut.call(this);
};    // onMouseOut


toolbarButton.prototype.onMouseDown = function() {
  if (this.parent.parent.standardToolbar)
    if (this.parent.parent.standardToolbar.helpButton)
      if (this.parent.parent.standardToolbar.helpButton.selected) {
        this.parent.parent.standardToolbar.helpButton.showHelp(this.helpMessage);
		return;
	  }
  button.prototype.onMouseDown.call(this);
};    // onMouseDown


toolbarButton.prototype.onMouseUp = function() {
  if (this.parent.parent.standardToolbar)
    if (this.parent.parent.standardToolbar.helpButton)
      if (this.parent.parent.standardToolbar.helpButton.selected)
        return;
  button.prototype.onMouseUp.call(this);
};    // onMouseUp

