[Commits] r1721 - sandbox/ahocevar/playground/ux/Printing/ux/widgets
commits at geoext.org
commits at geoext.org
Tue Jan 12 16:28:36 CET 2010
Author: ahocevar
Date: 2010-01-12 16:28:36 +0100 (Tue, 12 Jan 2010)
New Revision: 1721
Modified:
sandbox/ahocevar/playground/ux/Printing/ux/widgets/PrintMapPanel.js
sandbox/ahocevar/playground/ux/Printing/ux/widgets/PrintPreview.js
Log:
added api docs, fixed destroy sequence
Modified: sandbox/ahocevar/playground/ux/Printing/ux/widgets/PrintMapPanel.js
===================================================================
--- sandbox/ahocevar/playground/ux/Printing/ux/widgets/PrintMapPanel.js 2010-01-12 14:46:38 UTC (rev 1720)
+++ sandbox/ahocevar/playground/ux/Printing/ux/widgets/PrintMapPanel.js 2010-01-12 15:28:36 UTC (rev 1721)
@@ -185,6 +185,7 @@
*/
beforeDestroy: function() {
this.map.events.unregister("moveend", this, this.updatePage);
+ this.printPage.un("change", this.fitZoom, this);
this.printProvider.un("layoutchange", this.fitMap, this);
GeoExt.ux.PrintMapPanel.superclass.beforeDestroy.apply(this, arguments);
}
Modified: sandbox/ahocevar/playground/ux/Printing/ux/widgets/PrintPreview.js
===================================================================
--- sandbox/ahocevar/playground/ux/Printing/ux/widgets/PrintPreview.js 2010-01-12 14:46:38 UTC (rev 1720)
+++ sandbox/ahocevar/playground/ux/Printing/ux/widgets/PrintPreview.js 2010-01-12 15:28:36 UTC (rev 1721)
@@ -13,6 +13,19 @@
*/
Ext.namespace("GeoExt.ux");
+/** api: (define)
+ * module = GeoExt.ux
+ * class = PrintPreview
+ * base_link = `Ext.Panel <http://extjs.com/deploy/dev/docs/?class=Ext.Panel>`_
+ */
+
+/** api: constructor
+ * .. class:: PrintPreview
+ *
+ * A print preview with an interactive map. Requires a server-side print
+ * module configuration with two custom fields (by default ``mapTitle`` and
+ * ``comment``.
+ */
GeoExt.ux.PrintPreview = Ext.extend(Ext.Panel, {
/* begin i18n */
@@ -32,24 +45,70 @@
creatingPdfText: "Creating PDF...",
/* end i18n */
+ /** api: config[printProvider]
+ * :class:`GeoExt.ux.data.PrintProvider`|``Object`` Instance or
+ * configuration for the PrintProvider that this dialog will use.
+ */
+
+ /** private: property[printProvider]
+ * :class:`GeoExt.ux.data.PrintProvider`
+ */
printProvider: null,
+ /** api: config[sourceMap]
+ * :class:`GeoExt.MapPanel`|``OpenLayers.Map`` The map to copy layers and
+ * extent from for printing.
+ */
+
+ /** private: property[sourceMap]
+ * ``OpenLayers.Map`` The map to copy layers and extent from for printing.
+ */
+ sourceMap: null,
+
+ /** api: config[mapTitleField]
+ * ``String`` The custom field of the print service for the map title
+ */
mapTitleField: "mapTitle",
+ /** api: config[commentField]
+ * ``String`` The custom field of the print service for the comment
+ */
commentField: "comment",
- sourceMap: null,
-
+ /** api: config[legend]
+ * ref:`GeoExt.LegendPanel` The legend to include. If not provided, the
+ * dialog won't have an option to include the legend.
+ */
legend: null,
+ /** api: config[includeLegend]
+ * ``Boolean`` Initial status of the "Include legend?" checkbox. Will be
+ * ignored if :ref:`GeoExt.ux.PrintPreview.legend` is not provided.
+ */
includeLegend: false,
+ /** api: config[mapTitle]
+ * ``String`` An optional title to set for the mapTitle field when
+ * creating the dialog.
+ */
mapTitle: null,
+ /** api: config[comment]
+ * ``String`` An optional comment to set for the comment field when
+ * creating the dialog.
+ */
comment: null,
+ /** api: config[mapOptions]
+ * ``Object`` Configuration object for the preview map. Useful e.g. for
+ * configuring custom controls.
+ */
mapOptions: null,
+ /** api: config[addMapOverlay]
+ * ``Boolean`` Set to false if no map overlay with scale, scale selector
+ * and north arrow should be added. Default is true.
+ */
addMapOverlay: true,
/** api: config[busyMask]
@@ -63,11 +122,19 @@
*/
busyMask: null,
+ /** api: property[printMapPanel]
+ * class:`GeoExt.ux.PrintMapPanel` The print preview map.
+ */
printMapPanel: null,
+
+ /** private: property[form]
+ * ``Ext.form.FormPanel`` The form for this dialog.
+ */
form: null,
+ /** private: method[initComponent]
+ */
initComponent: function() {
-
this.bodyCfg = Ext.applyIf({
tag: "center",
cls: "x-panel-body"
@@ -82,6 +149,7 @@
scope: this
}
});
+ this.sourceMap = this.printProvider.sourceMap;
this.printProvider = this.printMapPanel.printProvider;
this.form = this.createForm();
@@ -110,6 +178,9 @@
});
},
+ /** private: method[createToolbar]
+ * :return: ``Ext.Toolbar``
+ */
createToolbar: function() {
return new Ext.Toolbar([this.paperSizeText, {
xtype: "combo",
@@ -153,6 +224,9 @@
}]);
},
+ /** private: method[createForm]
+ * :return: ``Ext.form.FormPanel``
+ */
createForm: function() {
var titleCfg = {
xtype: "textfield",
@@ -223,6 +297,9 @@
});
},
+ /** private: method[createMapOverlay]
+ * :return: ``Ext.Panel``
+ */
createMapOverlay: function() {
var scaleLine = new OpenLayers.Control.ScaleLine();
this.printMapPanel.map.addControl(scaleLine);
@@ -277,6 +354,10 @@
});
},
+ /** private: method[updateSize]
+ * sync the form's width with the map with, and make sure that the window
+ * shadow is updated if this dialog is added to an ``Ext.Window``
+ */
updateSize: function() {
this.suspendEvents();
var mapWidth = this.printMapPanel.getWidth();
@@ -291,6 +372,8 @@
this.resumeEvents();
},
+ /** private: method[beforeDestroy]
+ */
beforeDestroy: function() {
this.printProvider.un("beforeprint", this.busyMask.show, this.busyMask);
this.printProvider.un("print", this.busyMask.hide, this.busyMask);
More information about the Commits
mailing list