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


//
// "class" constructor
//


function toolbarRadioButton(element, buttonGroup, parent, deselectable) {
	
  // call superclass constructor
  //
  radioButton.call(this, element, buttonGroup, parent, deselectable);
  
  // set attributes
  //
  this.helpMessage = "";
  
  return this;
}    // toolbarRadioButton


// inherit prototype from "superclass"
//
toolbarRadioButton.prototype = new radioButton();


//
// mouse event handling methods
//


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


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


toolbarRadioButton.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;
	  }
  radioButton.prototype.onMouseDown.call(this);
};    // onMouseDown


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

