]> dev.renevier.net Git - syp.git/blob - openlayers/lib/OpenLayers/Control/Button.js
initial commit
[syp.git] / openlayers / lib / OpenLayers / Control / Button.js
1 /* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
2  * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt 
3  * for the full text of the license. */
4
5 /**
6  * @requires OpenLayers/Control.js
7  */
8
9 /**
10  * Class: OpenLayers.Control.Button 
11  * The Button control is a very simple push-button, for use with 
12  * <OpenLayers.Control.Panel>.
13  * When clicked, the function trigger() is executed.
14  * 
15  * Inherits from:
16  *  - <OpenLayers.Control>
17  *
18  * Use:
19  * (code)
20  * var button = new OpenLayers.Control.Button({
21  *     displayClass: "MyButton", trigger: myFunction
22  * });
23  * panel.addControls([button]);
24  * (end)
25  * 
26  * Will create a button with CSS class MyButtonItemInactive, that
27  *     will call the function MyFunction() when clicked.
28  */
29 OpenLayers.Control.Button = OpenLayers.Class(OpenLayers.Control, {
30     /**
31      * Property: type
32      * {Integer} OpenLayers.Control.TYPE_BUTTON.
33      */
34     type: OpenLayers.Control.TYPE_BUTTON,
35     
36     /**
37      * Method: trigger
38      * Called by a control panel when the button is clicked.
39      */
40     trigger: function() {},
41
42     CLASS_NAME: "OpenLayers.Control.Button"
43 });