[Commits] (john) - Selections being eliminated sends selection
changed. Also refactored some table code
commits at osafoundation.org
commits at osafoundation.org
Fri Aug 6 17:08:14 PDT 2004
Commit by: john
Modified files:
chandler/parcels/osaf/framework/blocks/ControlBlocks.py 1.94 1.95
chandler/parcels/osaf/framework/blocks/parcel.xml 1.104 1.105
chandler/parcels/osaf/framework/blocks/detail/Detail.py 1.18 1.19
chandler/parcels/osaf/views/content/parcel.xml 1.56 1.57
Log message:
- Selections being eliminated sends selection changed. Also refactored some table code
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/ControlBlocks.py.diff?r1=text&tr1=1.94&r2=text&tr2=1.95
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/parcel.xml.diff?r1=text&tr1=1.104&r2=text&tr2=1.105
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/detail/Detail.py.diff?r1=text&tr1=1.18&r2=text&tr2=1.19
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/views/content/parcel.xml.diff?r1=text&tr1=1.56&r2=text&tr2=1.57
Index: chandler/parcels/osaf/framework/blocks/parcel.xml
diff -u chandler/parcels/osaf/framework/blocks/parcel.xml:1.104 chandler/parcels/osaf/framework/blocks/parcel.xml:1.105
--- chandler/parcels/osaf/framework/blocks/parcel.xml:1.104 Tue Aug 3 12:53:03 2004
+++ chandler/parcels/osaf/framework/blocks/parcel.xml Fri Aug 6 17:08:11 2004
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.104 $ -->
-<!-- $Date: 2004/08/03 19:53:03 $ -->
+<!-- $Revision: 1.105 $ -->
+<!-- $Date: 2004/08/07 00:08:11 $ -->
<!-- Copyright (c) 2003 Open Source Applications Foundation -->
<!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
@@ -120,6 +120,7 @@
<Attribute itsName="selection">
<type itemref="SingleRef"/>
+ <initialValue itemref="None"/>
</Attribute>
<!--
Index: chandler/parcels/osaf/framework/blocks/detail/Detail.py
diff -u chandler/parcels/osaf/framework/blocks/detail/Detail.py:1.18 chandler/parcels/osaf/framework/blocks/detail/Detail.py:1.19
--- chandler/parcels/osaf/framework/blocks/detail/Detail.py:1.18 Tue Jul 20 15:22:53 2004
+++ chandler/parcels/osaf/framework/blocks/detail/Detail.py Fri Aug 6 17:08:12 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.18 $"
-__date__ = "$Date: 2004/07/20 22:22:53 $"
+__version__ = "$Revision: 1.19 $"
+__date__ = "$Date: 2004/08/07 00:08:12 $"
__copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -73,6 +73,7 @@
if notifyParent:
block.synchronizeWidget()
return notifyParent
+
children = self.childrenBlocks
for child in children:
child.isShown = item is not None
Index: chandler/parcels/osaf/framework/blocks/ControlBlocks.py
diff -u chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.94 chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.95
--- chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.94 Thu Aug 5 17:41:44 2004
+++ chandler/parcels/osaf/framework/blocks/ControlBlocks.py Fri Aug 6 17:08:11 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.94 $"
-__date__ = "$Date: 2004/08/06 00:41:44 $"
+__version__ = "$Revision: 1.95 $"
+__date__ = "$Date: 2004/08/07 00:08:11 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -505,31 +505,28 @@
def wxSynchronizeWidget(self):
self.blockItem.contents.resultsStale = True
self.Reset()
- if self.blockItem.selection:
- try:
- self.GoToItem (self.blockItem.selection)
- except ValueError: # item no longer in
- self.blockItem.selection = None
+ selection = self.blockItem.selection
+ self.GoToItem (self.blockItem.selection)
def GoToItem(self, item):
- try:
- row = self.blockItem.contents.index (item)
- except ValueError:
- self.ClearSelection()
- else:
- cursorColumn = 0
+ if item:
try:
- selectedColumn = self.blockItem.selectedColumn
- except AttributeError:
- pass
- else:
- for columnIndex in xrange (self.GetTable().GetNumberCols()):
- if self.blockItem.columnAttributeNames [columnIndex] == selectedColumn:
- cursorColumn = columnIndex
- break
-
+ row = self.blockItem.contents.index (item)
+ except ValueError:
+ item = None
+ if item:
+ cursorColumn = 0
+ selectedColumn = self.blockItem.selectedColumn
+ for columnIndex in xrange (self.GetTable().GetNumberCols()):
+ if self.blockItem.columnAttributeNames [columnIndex] == selectedColumn:
+ cursorColumn = columnIndex
+ break
self.SelectRow (row)
self.SetGridCursor (row, cursorColumn)
+ else:
+ self.ClearSelection()
+ self.blockItem.Post (Globals.repository.findPath ('//parcels/osaf/framework/blocks/Events/SelectionChanged'),
+ {'item':item})
class AttributeRenderer (wx.grid.PyGridCellRenderer):
Index: chandler/parcels/osaf/views/content/parcel.xml
diff -u chandler/parcels/osaf/views/content/parcel.xml:1.56 chandler/parcels/osaf/views/content/parcel.xml:1.57
--- chandler/parcels/osaf/views/content/parcel.xml:1.56 Thu Aug 5 14:14:27 2004
+++ chandler/parcels/osaf/views/content/parcel.xml Fri Aug 6 17:08:12 2004
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.56 $ -->
-<!-- $Date: 2004/08/05 21:14:27 $ -->
+<!-- $Revision: 1.57 $ -->
+<!-- $Date: 2004/08/07 00:08:12 $ -->
<!-- Copyright (c) 2004 Open Source Applications Foundation -->
<!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
@@ -841,7 +841,7 @@
<contents itemref="view:mixedItemCollection"/>
<childrenBlocks itemref="view:MixedList"/>
- <childrenBlocks itemref="detail:DetailRoot"/>
+ <childrenBlocks itemref="detail:DetailRoot" copy="DetailRoot"/>
<eventBoundary>True</eventBoundary>
<border>1.0, 1.0, 1.0, 1.0</border>
More information about the Commits
mailing list