I attach the patches for centerToBrowser move from QxWindow to QxPopup
Kent
On Thu, 2006-03-02 at 09:24 +0100, Sebastian Werner wrote:
> Kent Olsson schrieb:
> > In addition to the other changes, I propose to move the centerToBrowser
> > method from QxWindow to QxUtil.js It is more logical and can be reused
> > in different frameworks. Then it becomes more universal, because it is
> > not a method including the property which is unique for QxWindow. You
> > could also imagine that the QxPopup could be centered too.
>
> I don't like QxUtil for this, because QxUtil currently only contains
> stuff which is completely independent and doesn't have any reference to
> widgets.
>
> What's about to move this method to QxPopup. I think this would be a
> good place, because I could imagine the only things you would to center
> to the screen are popups the the child-classes like QxWindow.
>
> Could you submit a patch for this if you like it?
>
> Sebastian
>
> >
> > Kent
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> > that extends applications into web and mobile media. Attend the live webcast
> > and join the prime developer group breaking into this new coding territory!
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> > _______________________________________________
> > Qooxdoo-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Index: QxPopup.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/widgets/QxPopup.js,v
retrieving revision 1.6
diff -u -r1.6 QxPopup.js
--- QxPopup.js 17 Feb 2006 20:42:45 -0000 1.6
+++ QxPopup.js 2 Mar 2006 23:21:44 -0000
@@ -50,6 +50,12 @@
*/
QxPopup.changeProperty({ name : "display", type : QxConst.TYPEOF_BOOLEAN, defaultValue : false });
+/*!
+ Center the popup on open
+*/
+QxPopup.addProperty({ name : "centered", type : QxConst.TYPEOF_BOOLEAN, defaultValue : false });
+
+
proto._showTimeStamp = (new Date(0)).valueOf();
proto._hideTimeStamp = (new Date(0)).valueOf();
@@ -178,8 +184,19 @@
return this._hideTimeStamp;
};
+/*
+---------------------------------------------------------------------------
+ UTILITIES
+---------------------------------------------------------------------------
+*/
+proto.centerToBrowser = function()
+{
+ var d = window.application.getClientWindow().getClientDocument();
+ this.setLeft((d.getClientWidth() / 2) - (this.getBoxWidth() / 2));
+ this.setTop((d.getClientHeight() / 2) - (this.getBoxHeight() / 2));
+};
Index: QxWindow.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/widgets/QxWindow.js,v
retrieving revision 1.29
diff -u -r1.29 QxWindow.js
--- QxWindow.js 17 Feb 2006 20:42:45 -0000 1.29
+++ QxWindow.js 2 Mar 2006 23:21:26 -0000
@@ -343,11 +343,6 @@
*/
QxWindow.addProperty({ name : "moveMethod", type : QxConst.TYPEOF_STRING, defaultValue : "opaque", possibleValues : [ "opaque", "frame", "translucent" ] });
-/*!
- Center the window on open
-*/
-QxWindow.addProperty({ name : "centered", type : QxConst.TYPEOF_BOOLEAN, defaultValue : false });
-
@@ -391,14 +386,6 @@
this.hide();
};
-proto.centerToBrowser = function()
-{
- var d = window.application.getClientWindow().getClientDocument();
-
- this.setLeft((d.getClientWidth() / 2) - (this.getBoxWidth() / 2));
- this.setTop((d.getClientHeight() / 2) - (this.getBoxHeight() / 2));
-};
-
proto.open = function(vOpener)
{
if (QxUtil.isValid(vOpener)) {
@@ -1417,4 +1404,4 @@
};
return QxPopup.prototype.dispose.call(this);
-};
\ No newline at end of file
+};