Author: ArcRiley
Date: 2007-07-06 21:14:38 -0400 (Fri, 06 Jul 2007)
New Revision: 392

Added:
   trunk/pysoy/src/widgets/StackX.pxi
Modified:
   trunk/pysoy/src/widgets/soy.widgets.pyx
Log:
adding StackX for ticket #270


Copied: trunk/pysoy/src/widgets/StackX.pxi (from rev 387, 
trunk/pysoy/src/widgets/StackZ.pxi)
===================================================================
--- trunk/pysoy/src/widgets/StackX.pxi                          (rev 0)
+++ trunk/pysoy/src/widgets/StackX.pxi  2007-07-07 01:14:38 UTC (rev 392)
@@ -0,0 +1,38 @@
+# PySoy widgets.StackX class
+#
+# Copyright (C) 2007 Team PySoy
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 3 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, see http://www.gnu.org/licenses
+#
+# $Id$
+
+cdef class StackX (StackZ) :
+  '''PySoy widgets.StackX Class
+
+     This stacking widget packs children horizontally without overlap.
+  '''
+  def __repr__(self) :
+    return '<StackX Widget in Window id %d>' % (self._window._windowID)
+
+
+  cdef void _resize(self, int _x, int _y, int _width, int _height) :
+    cdef int i, _part
+    Widget._resize(self, _x, _y, _width, _height)
+    self._widgets.lock()
+    _part = self._width / self._widgets.current
+    for i from 0 <= i < self._widgets.current :
+      (<Widget> self._widgets.list[i])._resize(self._xpos + (i * _part), 
+                                               self._ypos,
+                                               _part, self._height)
+    self._widgets.unlock()

Modified: trunk/pysoy/src/widgets/soy.widgets.pyx
===================================================================
--- trunk/pysoy/src/widgets/soy.widgets.pyx     2007-07-07 00:33:43 UTC (rev 
391)
+++ trunk/pysoy/src/widgets/soy.widgets.pyx     2007-07-07 01:14:38 UTC (rev 
392)
@@ -27,4 +27,5 @@
 include "Widget.pxi"
 include "Canvas.pxi"
 include "Projector.pxi"
+include "StackX.pxi"
 include "StackZ.pxi"

_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to