strongwind r17 - in trunk: . strongwind



Author: jtai
Date: Fri Jul 11 05:52:30 2008
New Revision: 17
URL: http://svn.gnome.org/viewvc/strongwind?rev=17&view=rev

Log:
2008-07-10  Jonathan Tai  <jon tgpsolutions com>

	* strongwind/accessibles.py: Override select() and activate() in
	  TreeTable class to handle lazy loaded cells.  Also add an
	  expandOrContract() convenience method to the TableCell class.
	  (#542479, CÃsar Octavio LÃpez NatarÃn)


Modified:
   trunk/ChangeLog
   trunk/strongwind/accessibles.py

Modified: trunk/strongwind/accessibles.py
==============================================================================
--- trunk/strongwind/accessibles.py	(original)
+++ trunk/strongwind/accessibles.py	Fri Jul 11 05:52:30 2008
@@ -916,6 +916,33 @@
 
         self.__getattr__('assertNoTableCell')(name, checkShowing=checkShowing, retry=retry, recursive=recursive, breadthFirst=breadthFirst, raiseException=raiseException)
 
+class TreeTable(Table):
+    def select(self, path):
+        '''
+        Select a table cell
+
+        Path must be an array of strings, regular expressions are not supported.
+        '''
+
+        for row in path[0:-1]:
+            sleep(config.MEDIUM_DELAY)
+            super(TreeTable, self).select(row).expandOrContract()
+
+        return super(TreeTable, self).select(path[-1])
+
+    def activate(self, path):
+        '''
+        Activate a table cell
+
+        Path must be an array of strings, regular expressions are not supported.
+        '''
+
+        for row in path[0:-1]:
+            sleep(config.MEDIUM_DELAY)
+            super(TreeTable, self).select(row).expandOrContract()
+
+        return super(TreeTable, self).activate(path[-1])
+
 class TableCell(Accessible):
     def select(self, log=True):
         'Select the table cell'
@@ -970,8 +997,8 @@
 
         super(TableCell, self).mouseClick(button=button, xOffset=xOffset, yOffset=yOffset)
 
-class TreeTable(Table):
-    pass
+    def expandOrContract(self):
+        self._doAction('expand or contract')
 
 class Button(Accessible): # ROLE_BUTTON doesn't actually exist, this is just used as a base class for the following classes
     def click(self, log=True):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]