CVS: anygui/lib/anygui/backends javagui.py,1.57,1.58
Samuele Pedroni <[email protected]> Sun, 13 Oct 2002 18:20:40 -0700
| Newsgroups | gmane.comp.python.anygui.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/anygui/anygui/lib/anygui/backends
In directory usw-pr-cvs1:/tmp/cvs-serv6746
Modified Files:
javagui.py
Log Message:
now both ComponentWrapper and WindowWrapper implement (correctly) the mandatory setXxx methods. test_shake passes.
Index: javagui.py
===================================================================
RCS file: /cvsroot/anygui/anygui/lib/anygui/backends/javagui.py,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -r1.57 -r1.58
*** javagui.py 11 Sep 2002 12:50:20 -0000 1.57
--- javagui.py 14 Oct 2002 01:20:38 -0000 1.58
***************
*** 27,36 ****
#from synchronize import apply_synchronized
! def _r(obj): # @@@ for debug
! cl = obj.__class__.__name__
! p = cl.rfind('.')
! cl = cl[p+1:]
! return "%s@%s" % (cl,id(obj))
!
# Set the "look-and-feel":
--- 27,31 ----
#from synchronize import apply_synchronized
! from anygui.Utils import objDescr as _r # @@@ debug
# Set the "look-and-feel":
***************
*** 80,83 ****
--- 75,79 ----
if not self.widget:
self.widget = self.widgetFactory(*args, **kwds)
+ self.widget.visible = self.proxy.state['visible'] # @@@ Experimental
self.widgetSetUp()
***************
*** 88,120 ****
class ComponentWrapper(Wrapper):
def setX(self, x):
if not self.widget: return
! self.widget.x = x
! if self.widget.layout:
! self.widget.validate()
def setY(self, y):
if not self.widget: return
! self.widget.y = y
! if self.widget.layout:
! self.widget.validate()
def setWidth(self, width):
if not self.widget: return
! self.widget.width = width
if self.widget.layout:
self.widget.validate()
! def setHeight(self, height):
if not self.widget: return
! self.widget.height = height
if self.widget.layout:
self.widget.validate()
def setPosition(self, x, y):
if not self.widget: return
! self.widget.position = x, y
! if self.widget.layout:
! self.widget.validate()
def setSize(self, width, height):
--- 84,113 ----
class ComponentWrapper(Wrapper):
+ # mandatory setXxx
def setX(self, x):
if not self.widget: return
! self.widget.setLocation(x,self.widget.y)
def setY(self, y):
if not self.widget: return
! self.widget.setLocation(self.widget.x,y)
def setWidth(self, width):
if not self.widget: return
! self.widget.size = width, self.widget.height
if self.widget.layout:
self.widget.validate()
! def setHeigth(self, height):
if not self.widget: return
! self.widget.size = self.widget.width, height
if self.widget.layout:
self.widget.validate()
+ # opt setXxx
+
def setPosition(self, x, y):
if not self.widget: return
! self.widget.setLocation(x,y)
def setSize(self, width, height):
***************
*** 126,130 ****
def setGeometry(self, x, y, width, height):
if not self.widget: return
-
self.widget.bounds = x, y, width, height
if self.widget.layout:
--- 119,122 ----
***************
*** 408,411 ****
--- 400,431 ----
return widget
+ # mandatory setXxx
+ def setWidth(self,width):
+ if not self.widget: return
+ insets = self.widget.insets
+ width += insets.left + insets.right
+ self.widget.size = width, self.widget.height
+ if self.widget.layout:
+ self.widget.validate()
+
+ def setHeight(self,height):
+ if not self.widget: return
+ insets = self.widget.insets
+ height += insets.top + insets.bottom
+ self.widget.size = self.widget.width, height
+ if self.widget.layout:
+ self.widget.validate()
+
+ # /mandatory
+
+ def setSize(self, width, height):
+ if not self.widget: return
+ insets = self.widget.insets
+ width += insets.left + insets.right
+ height += insets.top + insets.bottom
+ self.widget.size = width,height
+ if self.widget.layout:
+ self.widget.validate()
+
def setGeometry(self, x, y, width, height):
if not self.widget: return
***************
*** 413,417 ****
width += insets.left + insets.right
height += insets.top + insets.bottom
! ComponentWrapper.setGeometry(self, x, y, width, height)
def getGeometry(self):
--- 433,439 ----
width += insets.left + insets.right
height += insets.top + insets.bottom
! self.widget.bounds = x, y, width, height
! if self.widget.layout:
! self.widget.validate()
def getGeometry(self):
***************
*** 468,469 ****
--- 490,492 ----
self.destroy()
application().remove(self.proxy) # @@@ Hm...
+
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf