/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/tree.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/tree.py

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

revision 6 by bh, Tue Aug 28 15:41:52 2001 UTC revision 14 by bh, Fri Aug 31 15:34:33 2001 UTC
# Line 31  class myTreeCtrlPanel(wxPanel): Line 31  class myTreeCtrlPanel(wxPanel):
31          wxPanel.__init__(self, parent, -1, style=wxWANTS_CHARS)          wxPanel.__init__(self, parent, -1, style=wxWANTS_CHARS)
32          self.app = app          self.app = app
33    
34            # boolean to indicate that we manipulate the selection ourselves
35            # so that we can ignore the selection events generated
36            self.changing_selection = 0
37    
38          EVT_SIZE(self, self.OnSize)          EVT_SIZE(self, self.OnSize)
39          self.tree = wxTreeCtrl(self, -1)          self.tree = wxTreeCtrl(self, -1)
40    
# Line 111  class myTreeCtrlPanel(wxPanel): Line 115  class myTreeCtrlPanel(wxPanel):
115                  break                  break
116              item = tree.GetItemParent(item)              item = tree.GetItemParent(item)
117    
118          self.tree.SelectItem(item)          self.changing_selection = 1
119            try:
120                self.tree.SelectItem(item)
121            finally:
122                self.changing_selection = 0
123    
124      def SelectedLayer(self):      def SelectedLayer(self):
125          """Return the layer object currently selected in the tree.          """Return the layer object currently selected in the tree.
# Line 123  class myTreeCtrlPanel(wxPanel): Line 131  class myTreeCtrlPanel(wxPanel):
131          return None          return None
132    
133      def OnSelChanged(self, event):      def OnSelChanged(self, event):
134            if self.changing_selection:
135                # we're changing the selection ourselves (probably through
136                # self.normalize_selection(). ignore the event.
137                return
138          self.normalize_selection()          self.normalize_selection()
139          layer = self.SelectedLayer()          layer = self.SelectedLayer()
140          if layer is not None:          if layer is not None:

Legend:
Removed from v.6  
changed lines
  Added in v.14

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26