/***************************************************************\
| |\  /|                                                We Put  |
| | >< Hypercosm        zoom_extents_button.js          3d      |
| |/  \|                                                To Work |
|***************************************************************|
|                                                               |
|        This file defines the Javascript behaviors of a        |
|        specific type of SketchUp user interface button.       |
|                                                               |
|***************************************************************|
|                Copyright (c) 2007 Hypercosm, LLC.             |
\***************************************************************/


//
// "class" constructor
//


function zoomExtentsButton(element, parent) {

  // call superclass constructor
  //
  toolbarButton.call(this, element, parent);
  
  // set attributes
  //
  this.status = "Zoom to extents";
  this.helpMessage = "This button zooms the view to fit the extents of the window.";
  
  return this;
}    // zoomExtentsButton


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


//
// click event handling methods
//


zoomExtentsButton.prototype.onClick = function() {
  this.parent.parent.applet.setView("auto");
  
  // enable previous button
  //
  if (this.parent.parent.cameraToolbar)
    if (this.parent.parent.cameraToolbar.previousButton)
      if (this.parent.parent.cameraToolbar.previousButton != null)
        this.parent.parent.cameraToolbar.previousButton.setEnabled(true);
};    // onClick

