/[thuban]/trunk/thuban/Thuban/UI/projlist.py
ViewVC logotype

Diff of /trunk/thuban/Thuban/UI/projlist.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1852 by bh, Tue Oct 21 14:13:41 2003 UTC revision 1853 by bh, Wed Oct 22 09:38:20 2003 UTC
# Line 71  class ProjectionList(wxListCtrl, Publish Line 71  class ProjectionList(wxListCtrl, Publish
71          Publisher.__del__()          Publisher.__del__()
72    
73      def Destroy(self):      def Destroy(self):
74          wxListCtrl.Destroy()          for pf in (self.system_projs, self.user_projs):
75          Publisher.Destroy()              pf.Unsubscribe(PROJECTION_ADDED, self.pf_projection_added)
76                pf.Unsubscribe(PROJECTION_REMOVED, self.pf_projection_removed)
77                pf.Unsubscribe(PROJECTION_REPLACED, self.pf_projection_replaced)
78    
79            # Call wxListCtrl's method last because afterwards self is not
80            # an instance of ProjectionList anymore as wxPython replaces
81            # self.__class__ with its dead object class
82            Publisher.Destroy(self)
83            wxListCtrl.Destroy(self)
84    
85      def update_on_idle(self):      def update_on_idle(self):
86          self.needs_update = True          self.needs_update = True
# Line 158  class ProjectionList(wxListCtrl, Publish Line 166  class ProjectionList(wxListCtrl, Publish
166    
167      def SelectProjection(self, proj):      def SelectProjection(self, proj):
168          """Select the projection and deselect all others."""          """Select the projection and deselect all others."""
169            # Set both the wxLIST_STATE_SELECTED and wxLIST_STATE_FOCUSED
170            # flags on the newly selected item. If only
171            # wxLIST_STATE_SELECTED is set, some other item is focused and
172            # the first time the focus is moved with the keyboard the
173            # selection moves in unexpected ways.
174            state = wxLIST_STATE_SELECTED|wxLIST_STATE_FOCUSED
175          for i in range(len(self.projections)):          for i in range(len(self.projections)):
176              p = self.projections[i][1]              p = self.projections[i][1]
177              self.SetItemState(i, p is proj and wxLIST_STATE_SELECTED or 0,              self.SetItemState(i, p is proj and state or 0, state)
                               wxLIST_STATE_SELECTED)  
178    
179      def ClearSelection(self):      def ClearSelection(self):
180          """Deselect all projections."""          """Deselect all projections."""

Legend:
Removed from v.1852  
changed lines
  Added in v.1853

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26