Exactly!

 I had the following situation: I had a small browser window where the QxWindow was opened by user interaction. The user now clicked on the maximize button of the browser to get a greater view of the application but this did not help because the QxWindow still was drawn outside the visible area. There was no possibility to click on the closer button of the window.

Now it should work!


Kent Olsson schrieb:
Hej Dietrich!

Just so I understand you correctly. If you create a popup or a subclass
of it bigger (wider or higher) than the browser window, it is drawn
outside the visible area.

But if you set the left an top values, you will still exceed the visible
area, but you will be able to access any decorations of the window.

I have made the change.

Sebastian, can you upload it to cvs?

Kent

On Fri, 2006-03-03 at 08:35 +0100, Dietrich Streifert wrote:
  
@Kent:

I originally wrote the "center" method for QxWindow and had recently
the problem that if for some reason the QxPopup size exceeds the
visible window size top and left are
 set to negative values. The result is that the top of the window is
drawn outside the visible area..

Maybe there has to be an additional test if top and left get negative
and if yes set them to 0.



Kent Olsson schrieb: 
    
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
+};
    
        
-- 
Mit freundlichen Grüßen
Dietrich Streifert
Visionet GmbH
    

Index: QxPopup.js =================================================================== RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/widgets/QxPopup.js,v retrieving revision 1.7 diff -u -r1.7 QxPopup.js --- QxPopup.js 3 Mar 2006 07:38:15 -0000 1.7 +++ QxPopup.js 3 Mar 2006 08:55:53 -0000 @@ -194,8 +194,11 @@ { var d = window.application.getClientWindow().getClientDocument(); - this.setLeft((d.getClientWidth() / 2) - (this.getBoxWidth() / 2)); - this.setTop((d.getClientHeight() / 2) - (this.getBoxHeight() / 2)); + var left = (d.getClientWidth() / 2) - (this.getBoxWidth() / 2); + var top = (d.getClientHeight() / 2) - (this.getBoxHeight() / 2); + + this.setLeft(left < 0 ? 0 : left); + this.setTop(top < 0 ? 0 : top); };

-- 
Mit freundlichen Grüßen
Dietrich Streifert
Visionet GmbH

Reply via email to