[Chandler-dev] Re: [commits] (jeffrey) [11119] - Remove the expensive selection changed event implemented in r10868 for bug 5140,

Jeffrey Harris jeffrey at osafoundation.org
Tue Jul 11 11:34:48 PDT 2006


Whoops, checkin 11119 accidentally included my fix for bug 6213, allDay
event created on wrong day, r=grant

commits at osafoundation.org wrote:
> Revision
>     11119 <http://viewcvs.osafoundation.org/chandler?view=rev&rev=11119>
> Author
>     jeffrey
> Date
>     2006-07-11 11:32:36 -0700 (Tue, 11 Jul 2006)
> 
> 
>       Log Message
> 
> - Remove the expensive selection changed event implemented in r10868 for
> bug 5140 <http://bugzilla.osafoundation.org/show_bug.cgi?id=5140>,
> because in r11039 Mimi disabled display of selected items in the preview
> area.
> 
> 
>       Modified Paths
> 
>     * trunk/chandler/parcels/osaf/framework/blocks/BranchPoint.py
>       <#trunkchandlerparcelsosafframeworkblocksBranchPointpy>
>     * trunk/chandler/parcels/osaf/framework/blocks/calendar/AllDayCanvas.py
>       <#trunkchandlerparcelsosafframeworkblockscalendarAllDayCanvaspy>
>     * trunk/chandler/parcels/osaf/framework/blocks/calendar/CalendarBlocks.py
>       <#trunkchandlerparcelsosafframeworkblockscalendarCalendarBlockspy>
> 
> 
>       Diff
> 
> 
>         Modified:
>         trunk/chandler/parcels/osaf/framework/blocks/BranchPoint.py
>         (11118 => 11119)
> 
> --- trunk/chandler/parcels/osaf/framework/blocks/BranchPoint.py	2006-07-11 17:57:02 UTC (rev 11118)
> +++ trunk/chandler/parcels/osaf/framework/blocks/BranchPoint.py	2006-07-11 18:32:36 UTC (rev 11119)
> @@ -98,15 +98,10 @@
>          # eventually we might want selectedItem to be an iterable
>          # of some kind
>          items = event.arguments['items']
> -        changeEvent = schema.ns(__parcel__, self.itsView).SelectedItemChanged
>          if len(items)==1:
> -            if self.selectedItem != items[0]:
> -                self.post(changeEvent, {'item' : items[0] })
> -                self.selectedItem = items[0]
> +            self.selectedItem = items[0]
>          else:
> -            if self.selectedItem is not None:
> -                self.post(changeEvent, {'item' : None })
> -                self.selectedItem = None
> +            self.selectedItem = None
>              
>          self.detailItemCollection = \
>              self.delegate.getContentsCollection(self.selectedItem,
> 
> 
>         Modified:
>         trunk/chandler/parcels/osaf/framework/blocks/calendar/AllDayCanvas.py
>         (11118 => 11119)
> 
> --- trunk/chandler/parcels/osaf/framework/blocks/calendar/AllDayCanvas.py	2006-07-11 17:57:02 UTC (rev 11118)
> +++ trunk/chandler/parcels/osaf/framework/blocks/calendar/AllDayCanvas.py	2006-07-11 18:32:36 UTC (rev 11119)
> @@ -414,10 +414,10 @@
>                              newTime = self.blockItem.rangeStart - item.duration
>      
>                          start = newTime
> -                        end   = start + item.duration
>                      else:
> -                        start, end = item.startTime, item.endTime
> +                        start = item.effectiveStartTime
>                      
> +                    end  = start + item.duration
>                      addCanvasItem(item, start, end)
>  
>              self.numEventRows = numEventRows
> 
> 
>         Modified:
>         trunk/chandler/parcels/osaf/framework/blocks/calendar/CalendarBlocks.py
>         (11118 => 11119)
> 
> --- trunk/chandler/parcels/osaf/framework/blocks/calendar/CalendarBlocks.py	2006-07-11 17:57:02 UTC (rev 11118)
> +++ trunk/chandler/parcels/osaf/framework/blocks/calendar/CalendarBlocks.py	2006-07-11 18:32:36 UTC (rev 11119)
> @@ -401,17 +401,6 @@
>      def onSelectAllEventUpdateUI(self, event):
>          event.arguments['Enable'] = False
>      
> -    def onSelectedItemChangedEvent(self, event):
> -        """Called directly by the detail view when the item it displays changes.
> -        
> -        Really this would make sense to be a BroadcastEverywhere block command,
> -        but this is slow.
> -        """
> -        item = event.arguments['item']
> -        if item != self.widget.selectedItem:
> -            self.widget.selectedItem = item
> -            self.synchronizeWidget()
> -    
>      def instantiateWidget(self):
>          if not self.getHasBeenRendered():
>              self.setRange( datetime.now().date() )
> @@ -436,7 +425,6 @@
>                   *arguments, **keywords):
>          super(wxPreviewArea, self).__init__(parent, id, *arguments, **keywords)
>          self.currentDaysItems = []
> -        self.selectedItem = None
>          self._avoidDrawing = False
>          self.Bind(wx.EVT_PAINT, self.OnPaint)
>          self.Bind(wx.EVT_LEFT_DCLICK, self.OnDClick)
> @@ -471,24 +459,14 @@
>          self.blockItem.post(goto, {'item': item})
>  
>          self._avoidDrawing = False
> -        
> -        # after switching to the calendar view the current day often changes
> -        if item in self.currentDaysItems:
> -            self.selectedItem = item
> -            self.Refresh()
>  
> -        
> -
>      def OnClick(self, event):
>          item = self._getItem(event)
> -        if self.selectedItem != item:
> -            self.selectedItem = item
> -            
> -            sidebarBPB = Block.Block.findBlockByName("SidebarBranchPointBlock")
> -            sidebarBPB.childrenBlocks.first().postEventByName (
> -               'SelectItemsBroadcast', {'items':[item]}
> -                )
> -            self.Refresh()
> +        sidebarBPB = Block.Block.findBlockByName("SidebarBranchPointBlock")
> +        sidebarBPB.childrenBlocks.first().postEventByName (
> +           'SelectItemsBroadcast', {'items':[item]}
> +            )
> +        self.Refresh()
>  
>      def Draw(self, dc):
>          """
> @@ -573,15 +551,6 @@
>                      y += self.lineHeight  #For end calculation
>                      break
>  
> -            if item == self.selectedItem:
> -                dc.DestroyClippingRegion()                
> -                dc.SetBrush(wx.Brush(selectedBackground, wx.SOLID))
> -                dc.DrawRectangle(r.x, y, r.width, self.lineHeight + 2)
> -                setClipping()
> -                
> -                dc.SetTextBackground( selectedBackground )
> -                dc.SetTextForeground( selectedColor )
> -
>              if not (item.allDay or item.anyTime):
>                  # Draw the time
>                  dc.SetFont(self.timeFont)
> @@ -601,10 +570,6 @@
>              dc.DrawText(item.displayName, x, y + self.eventFontOffset)
>  
>              y += self.lineHeight
> -
> -            if item == self.selectedItem:
> -                dc.SetTextBackground( unselectedBackground )
> -                dc.SetTextForeground( unselectedColor )
>              
>          dc.DestroyClippingRegion()
>          return y - self.vMargin
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Commits mailing list
> Commits at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/commits


More information about the chandler-dev mailing list