[Commits] r1685 - in sandbox/cmoullet/ux/Toolbar: examples ux/widgets
commits at geoext.org
commits at geoext.org
Sat Jan 9 05:46:14 CET 2010
Author: cmoullet
Date: 2010-01-09 05:46:14 +0100 (Sat, 09 Jan 2010)
New Revision: 1685
Modified:
sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.html
sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.js
sandbox/cmoullet/ux/Toolbar/ux/widgets/LoadingStatusBar.js
sandbox/cmoullet/ux/Toolbar/ux/widgets/MousePositionItem.js
Log:
Extend config options and add xtype
Modified: sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.html
===================================================================
--- sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.html 2010-01-09 04:45:46 UTC (rev 1684)
+++ sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.html 2010-01-09 04:46:14 UTC (rev 1685)
@@ -1,24 +1,35 @@
<html>
- <head>
- <title>Toolbar Example</title>
+<head>
+ <title>Toolbar Example</title>
- <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script>
- <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css" />
- <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/examples/shared/examples.css" />
- <script type="text/javascript" src="http://openlayers.org/api/2.8/OpenLayers.js"></script>
- <script type="text/javascript" src="../../../trunk/geoext/lib/GeoExt.js"></script>
- <script type="text/javascript" src="../ux/widgets/LoadingStatusBar.js"></script>
- <script type="text/javascript" src="../ux/widgets/MousePositionItem.js"></script>
- <script type="text/javascript" src="ToolbarExample.js"></script>
+ <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script>
+ <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css"/>
+ <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/examples/shared/examples.css"/>
+ <script type="text/javascript" src="http://openlayers.org/api/2.8/OpenLayers.js"></script>
+ <script type="text/javascript" src="../../../trunk/geoext/lib/GeoExt.js"></script>
+ <script type="text/javascript" src="../ux/widgets/LoadingStatusBar.js"></script>
+ <script type="text/javascript" src="../ux/widgets/MousePositionItem.js"></script>
+ <script type="text/javascript" src="ToolbarExample.js"></script>
- </head>
- <body>
- <h1>Toolbar</h1>
- <p>This example demonstrates the following toolbar components:<p>
- <p>- mouse position<p>
- <p>- loading status<p>
- <p>The js is not minified so it is readable. See <a href="ToolbarExample.js">ToolbarExample.js</a>.</p>
- <div id="mappanel"></div>
- </body>
+</head>
+<body>
+<h1>Toolbar</h1>
+
+<p>This example demonstrates the following toolbar components:
+
+<p>
+
+<p>- mouse position
+
+<p>
+
+<p>- loading status
+
+<p>
+
+<p>The js is not minified so it is readable. See <a href="ToolbarExample.js">ToolbarExample.js</a>.</p>
+
+<div id="mappanel"></div>
+</body>
</html>
Modified: sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.js
===================================================================
--- sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.js 2010-01-09 04:45:46 UTC (rev 1684)
+++ sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.js 2010-01-09 04:46:14 UTC (rev 1685)
@@ -26,14 +26,6 @@
}
});
- var mousePositionItem2 = new GeoExt.ux.Toolbar.MousePositionItem({
- map: map,
- controlOptions: {
- prefix: 'Coordinates: ',
- numDigits: 1
- }
- });
-
var loadingStatusBar = new GeoExt.ux.LoadingStatusBar({
map: map,
statusAlign: 'right',
@@ -50,7 +42,14 @@
height: 400,
width: 600,
map: map,
- tbar: [mousePositionItem2],
+ tbar: [
+ {
+ xtype: 'tbfill'
+ },
+ {
+ xtype: 'gxux_mouseposition'
+ }
+ ],
bbar: loadingStatusBar
});
});
\ No newline at end of file
Modified: sandbox/cmoullet/ux/Toolbar/ux/widgets/LoadingStatusBar.js
===================================================================
--- sandbox/cmoullet/ux/Toolbar/ux/widgets/LoadingStatusBar.js 2010-01-09 04:45:46 UTC (rev 1684)
+++ sandbox/cmoullet/ux/Toolbar/ux/widgets/LoadingStatusBar.js 2010-01-09 04:46:14 UTC (rev 1685)
@@ -33,6 +33,9 @@
if (config.map && config.map instanceof GeoExt.MapPanel) {
config.map = config.map.map;
}
+ if (!config.map) {
+ config.map = GeoExt.MapPanel.guess().map;
+ }
GeoExt.ux.LoadingStatusBar.superclass.constructor.call(this, config);
},
@@ -76,6 +79,7 @@
},
/** private: method[increaseCounter]
+ * :param evt: ``Event`` Event
*/
increaseCounter: function(evt) {
this.counter++;
@@ -83,6 +87,7 @@
},
/** private: method[decreaseCounter]
+ * :param evt: ``Event`` Event
*/
decreaseCounter: function(evt) {
this.counter--;
Modified: sandbox/cmoullet/ux/Toolbar/ux/widgets/MousePositionItem.js
===================================================================
--- sandbox/cmoullet/ux/Toolbar/ux/widgets/MousePositionItem.js 2010-01-09 04:45:46 UTC (rev 1684)
+++ sandbox/cmoullet/ux/Toolbar/ux/widgets/MousePositionItem.js 2010-01-09 04:46:14 UTC (rev 1685)
@@ -26,15 +26,26 @@
*/
mousePositionControl: null,
+ /** private: method[constructor]
+ * Construct the component.
+ */
constructor: function(config) {
if (config.map && config.map instanceof GeoExt.MapPanel) {
config.map = config.map.map;
}
- this.map = config.map || null;
+ if (config.map) {
+ this.map = config.map
+ } else {
+ this.map = GeoExt.MapPanel.guess().map;
+ }
this.controlOptions = config.controlOptions || {};
GeoExt.ux.Toolbar.MousePositionItem.superclass.constructor.call(this, this.text || "");
},
+ /** private: method[render]
+ * Render the component.
+ * :param td: ``Element/HTMLElement/String`` Container
+ */
render: function(td) {
var config = OpenLayers.Util.extend(this.controlOptions, {
div:this.el
@@ -49,3 +60,8 @@
}
});
+/** api: xtype = gxux_mouseposition */
+
+Ext.reg('gxux_mouseposition', GeoExt.ux.Toolbar.MousePositionItem);
+
+
More information about the Commits
mailing list