[Commits] (donn) Renamed some events whose names were confusing

commits at osafoundation.org commits at osafoundation.org
Tue Aug 24 16:06:19 PDT 2004


Commit by: donn
Modified files:
chandler/parcels/osaf/framework/blocks/ContainerBlocks.py 1.126 1.127
chandler/parcels/osaf/framework/blocks/ControlBlocks.py 1.106 1.107
chandler/parcels/osaf/framework/blocks/Events/parcel.xml 1.47 1.48
chandler/parcels/osaf/views/main/Main.py 1.42 1.43
chandler/parcels/osaf/views/main/parcel.xml 1.91 1.92

Log message:
Renamed some events whose names were confusing
-------------------------------------
   * onChangeLayoutEvent now used for LayoutSelector bar
   * other new names include onRequestSelectItemEvent and onRequestSelectSidebarItemEvent
   * added stubbed out code for scrolling Detail View so Jed can help

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/ContainerBlocks.py.diff?r1=text&tr1=1.126&r2=text&tr2=1.127
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/ControlBlocks.py.diff?r1=text&tr1=1.106&r2=text&tr2=1.107
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/Events/parcel.xml.diff?r1=text&tr1=1.47&r2=text&tr2=1.48
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/views/main/Main.py.diff?r1=text&tr1=1.42&r2=text&tr2=1.43
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/views/main/parcel.xml.diff?r1=text&tr1=1.91&r2=text&tr2=1.92

Index: chandler/parcels/osaf/framework/blocks/Events/parcel.xml
diff -u chandler/parcels/osaf/framework/blocks/Events/parcel.xml:1.47 chandler/parcels/osaf/framework/blocks/Events/parcel.xml:1.48
--- chandler/parcels/osaf/framework/blocks/Events/parcel.xml:1.47	Thu Aug 19 11:27:55 2004
+++ chandler/parcels/osaf/framework/blocks/Events/parcel.xml	Tue Aug 24 16:06:16 2004
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.47 $ -->
-<!-- $Date: 2004/08/19 18:27:55 $ -->
+<!-- $Revision: 1.48 $ -->
+<!-- $Date: 2004/08/24 23:06:16 $ -->
 <!-- Copyright (c) 2003 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -33,8 +33,8 @@
     <subscribeAlwaysEvents itemref="events:EditAccountPreferences"/>
     <subscribeAlwaysEvents itemref="events:GetNewMail"/>
     <subscribeAlwaysEvents itemref="events:SelectionChanged"/>
-    <subscribeAlwaysEvents itemref="events:SelectionChangedSentToSidebar"/>
-    <subscribeAlwaysEvents itemref="events:SelectionChangedBroadcastEverywhere"/>
+    <subscribeAlwaysEvents itemref="events:RequestSelectSidebarItem"/>
+    <subscribeAlwaysEvents itemref="events:RequestSelectItem"/>
     <subscribeAlwaysEvents itemref="events:EnterPressed"/>
     <subscribeAlwaysEvents itemref="events:GenerateContentItems"/>
     <subscribeAlwaysEvents itemref="events:GenerateContacts"/>
@@ -116,12 +116,12 @@
     <dispatchEnum>BroadcastInsideMyEventBoundary</dispatchEnum>
   </BlockEvent>
 
-  <BlockEvent itsName="SelectionChangedSentToSidebar">
+  <BlockEvent itsName="RequestSelectSidebarItem">
     <dispatchEnum>SendToBlock</dispatchEnum>
     <dispatchToBlock itemref="doc:Sidebar"/>
   </BlockEvent>
 
-  <BlockEvent itsName="SelectionChangedBroadcastEverywhere">
+  <BlockEvent itsName="RequestSelectItem">
     <dispatchEnum>BroadcastEverywhere</dispatchEnum>
   </BlockEvent>
 

Index: chandler/parcels/osaf/framework/blocks/ControlBlocks.py
diff -u chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.106 chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.107
--- chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.106	Tue Aug 24 10:00:37 2004
+++ chandler/parcels/osaf/framework/blocks/ControlBlocks.py	Tue Aug 24 16:06:16 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.106 $"
-__date__ = "$Date: 2004/08/24 17:00:37 $"
+__version__ = "$Revision: 1.107 $"
+__date__ = "$Date: 2004/08/24 23:06:16 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -681,7 +681,7 @@
         self.selection = notification.data['item']
         self.widget.GoToItem (self.selection)
 
-    def onSelectionChangedSentToSidebarEvent (self, notification):
+    def onRequestSelectSidebarItemEvent (self, notification):
         # Request the sidebar to change selection
         # Item specified is usually by name
         try:
@@ -704,7 +704,7 @@
                    ('//parcels/osaf/framework/blocks/Events/SelectionChanged'),
                    {'item':item})
 
-    def onSelectionChangedBroadcastEverywhereEvent (self, notification):
+    def onRequestSelectItemEvent (self, notification):
         # request the Table part of the Active View to change selection
         newSelection = notification.data['item']
         if newSelection in self.contents:
@@ -1046,7 +1046,10 @@
         """
         self.selection = notification.data['item']
         self.synchronizeWidget ()
-        
+
+class wxScrolledWindow (wx.ScrolledWindow):
+    pass
+
 class SelectionContainer(BoxContainer):
     """
     SelectionContainer
@@ -1056,6 +1059,28 @@
         super (SelectionContainer, self).__init__ (*arguments, **keywords)
         self.selection = None
 
+    def xinstantiateWidget (self):
+        # DLDTBD - figure out how to share this code with BoxContainer
+        if self.orientationEnum == 'Horizontal':
+            orientation = wx.HORIZONTAL
+        else:
+            orientation = wx.VERTICAL
+
+        sizer = wx.BoxSizer(orientation)
+        sizer.SetMinSize((200,200))
+
+        if self.parentBlock:
+            parentWidget = self.parentBlock.widget
+        else:
+            parentWidget = Globals.wxApplication.mainFrame
+ 
+        widget = wxScrolledWindow (parentWidget, Block.getWidgetID(self), \
+                                   size=(300,300), style=wx.VSCROLL)
+        widget.SetSizerAndFit (sizer)
+
+        widget.Show (self.isShown)
+        return widget
+
     def onSelectionChangedEvent (self, notification):
         """
           just remember the new selected ContentItem.
@@ -1067,7 +1092,7 @@
         # return the item being viewed
         return self.selection
     
-class ContentItemDetail(SelectionContainer):
+class ContentItemDetail(BoxContainer):
     """
     ContentItemDetail
     Any container block in the Content Item's Detail View hierarchy.

Index: chandler/parcels/osaf/framework/blocks/ContainerBlocks.py
diff -u chandler/parcels/osaf/framework/blocks/ContainerBlocks.py:1.126 chandler/parcels/osaf/framework/blocks/ContainerBlocks.py:1.127
--- chandler/parcels/osaf/framework/blocks/ContainerBlocks.py:1.126	Thu Aug 19 16:09:43 2004
+++ chandler/parcels/osaf/framework/blocks/ContainerBlocks.py	Tue Aug 24 16:06:16 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.126 $"
-__date__ = "$Date: 2004/08/19 23:09:43 $"
+__version__ = "$Revision: 1.127 $"
+__date__ = "$Date: 2004/08/24 23:06:16 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -136,7 +136,7 @@
         self.widget.setSelectedChoice(selectionIndex)
         self.synchronizeWidget()
 
-    def onSelectionChanged(self, notification):
+    def onChangeLayoutEvent(self, notification):
         # @@@ On the Mac, radio buttons do not work as radio
         # buttons, but rather they behave as individual toggle
         # buttons.  As a workaround, we deselect the other 

Index: chandler/parcels/osaf/views/main/parcel.xml
diff -u chandler/parcels/osaf/views/main/parcel.xml:1.91 chandler/parcels/osaf/views/main/parcel.xml:1.92
--- chandler/parcels/osaf/views/main/parcel.xml:1.91	Mon Aug 23 16:28:03 2004
+++ chandler/parcels/osaf/views/main/parcel.xml	Tue Aug 24 16:06:17 2004
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.91 $ -->
-<!-- $Date: 2004/08/23 23:28:03 $ -->
+<!-- $Revision: 1.92 $ -->
+<!-- $Date: 2004/08/24 23:06:17 $ -->
 <!-- Copyright (c) 2003 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -1348,12 +1348,12 @@
     <toolSize>16,16</toolSize>
     <separatorWidth>100</separatorWidth>
     <stretchFactor>0.0</stretchFactor>
-    <subscribeWhenVisibleEvents itemref="doc:SelectionChanged"/>
+    <subscribeWhenVisibleEvents itemref="doc:ChangeLayout"/>
   </Toolbar>
 
-  <BlockEvent itemName="SelectionChanged">
-    <methodName>onSelectionChanged</methodName>
-    <dispatchEnum>BroadcastEverywhere</dispatchEnum>
+  <BlockEvent itemName="ChangeLayout">
+    <methodName>onChangeLayoutEvent</methodName>
+    <dispatchEnum>BroadcastInsideMyEventBoundary</dispatchEnum>
   </BlockEvent>
 
   <!--
@@ -1366,7 +1366,7 @@
     <selectedBitmap></selectedBitmap>
     <toolbarItemKind>Radio</toolbarItemKind>
     <helpString>Display the view in list mode</helpString>
-    <event itemref="doc:SelectionChanged"/>
+    <event itemref="doc:ChangeLayout"/>
   </ToolbarItem>
 
   <ToolbarItem itsName="MonthViewButton">
@@ -1376,7 +1376,7 @@
     <selectedBitmap></selectedBitmap>
     <toolbarItemKind>Radio</toolbarItemKind>
     <helpString>Display the view in month mode</helpString>
-    <event itemref="doc:SelectionChanged"/>
+    <event itemref="doc:ChangeLayout"/>
   </ToolbarItem>
 
   <ToolbarItem itsName="WeekViewButton">
@@ -1386,7 +1386,7 @@
     <selectedBitmap></selectedBitmap>
     <toolbarItemKind>Radio</toolbarItemKind>
     <helpString>Display the view in week mode</helpString>
-    <event itemref="doc:SelectionChanged"/>
+    <event itemref="doc:ChangeLayout"/>
   </ToolbarItem>
 
   <ToolbarItem itsName="DayViewButton">
@@ -1396,7 +1396,7 @@
     <selectedBitmap></selectedBitmap>
     <toolbarItemKind>Radio</toolbarItemKind>
     <helpString>Display the view in day mode</helpString>
-    <event itemref="doc:SelectionChanged"/>
+    <event itemref="doc:ChangeLayout"/>
   </ToolbarItem>
 
 

Index: chandler/parcels/osaf/views/main/Main.py
diff -u chandler/parcels/osaf/views/main/Main.py:1.42 chandler/parcels/osaf/views/main/Main.py:1.43
--- chandler/parcels/osaf/views/main/Main.py:1.42	Mon Aug 23 16:50:42 2004
+++ chandler/parcels/osaf/views/main/Main.py	Tue Aug 24 16:06:16 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.42 $"
-__date__ = "$Date: 2004/08/23 23:50:42 $"
+__version__ = "$Revision: 1.43 $"
+__date__ = "$Date: 2004/08/24 23:06:16 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -125,22 +125,22 @@
         newItem.InitOutgoingAttributes ()
         Globals.repository.commit()
 
-        # lookup our selectionChangedEvents
+        # lookup our Request Select Events
         rootPath = '//parcels/osaf/framework/blocks/Events/'
-        sidebarSelectionChanged = Globals.repository.findPath \
-                                (rootPath + 'SelectionChangedSentToSidebar')
-        activeViewSelectionChanged = Globals.repository.findPath \
-                                   (rootPath + 'SelectionChangedBroadcastEverywhere')
+        requestSelectSidebarItem = Globals.repository.findPath \
+                                (rootPath + 'RequestSelectSidebarItem')
+        requestSelectItem = Globals.repository.findPath \
+                                   (rootPath + 'RequestSelectItem')
 
         # Tell the sidebar we want to go to the 'All' box
         args = {}
         args['itemName'] = 'AllTableView'
-        self.Post(sidebarSelectionChanged, args)
+        self.Post(requestSelectSidebarItem, args)
 
         # Tell the ActiveView to select our new item
         args = {}
         args['item'] = newItem
-        self.Post(activeViewSelectionChanged, args)
+        self.Post(requestSelectItem, args)
 
     def onNewEventUpdateUI (self, notification):
         notification.data ['Enable'] = True



More information about the Commits mailing list