summaryrefslogtreecommitdiffstats
path: root/qx08/source/class/tr/ui/CopyBuffer.js
diff options
context:
space:
mode:
Diffstat (limited to 'qx08/source/class/tr/ui/CopyBuffer.js')
-rw-r--r--qx08/source/class/tr/ui/CopyBuffer.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/qx08/source/class/tr/ui/CopyBuffer.js b/qx08/source/class/tr/ui/CopyBuffer.js
new file mode 100644
index 0000000..a48fee2
--- /dev/null
+++ b/qx08/source/class/tr/ui/CopyBuffer.js
@@ -0,0 +1,45 @@
+/* ************************************************************************
+ Copyright: 2008, OETIKER+PARTNER AG
+ License: GPL
+ Authors: Tobias Oetiker
+ $Id: $
+* ************************************************************************ */
+
+/**
+ * Place an instance of this widget into the application root. It will remain
+ * invisible. I will listen on the 'copy' bus for data to get ready for copying with
+ * [ctrl]+[c]
+ */
+qx.Class.define('tr.ui.CopyBuffer', {
+ extend : qx.ui.form.TextArea,
+
+ construct : function() {
+ this.base(arguments);
+
+ this.set({
+ width : 0,
+ height : 0,
+ allowGrowX : false,
+ allowGrowY : false,
+ decorator : null
+ });
+
+ qx.event.message.Bus.subscribe('copy', this.__copy, this);
+ },
+
+ members : {
+ /**
+ * TODOC
+ *
+ * @type member
+ * @param m {var} TODOC
+ * @return {void}
+ */
+ __copy : function(m) {
+ var data = m.getData();
+ this.info('set: ' + data);
+ this.setValue(data);
+ this.selectAll();
+ }
+ }
+}); \ No newline at end of file