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

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

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

revision 28 by bh, Tue Aug 28 15:41:52 2001 UTC revision 29 by bh, Thu Sep 6 13:30:59 2001 UTC
# Line 11  from wxPython.wx import * Line 11  from wxPython.wx import *
11  from wxPython.grid import *  from wxPython.grid import *
12    
13  import view  import view
14    from dialogs import NonModalDialog
15  from messages import SELECTED_SHAPE  from messages import SELECTED_SHAPE
16    
17  class IdentifyListCtrl(wxListCtrl):  class IdentifyListCtrl(wxListCtrl):
18    
19      def __init__(self, parent, id, interactor):      def __init__(self, parent, id):
20          wxListCtrl.__init__(self, parent, id, style = wxLC_REPORT)          wxListCtrl.__init__(self, parent, id, style = wxLC_REPORT)
         self.interactor = interactor  
         self.interactor.Subscribe(SELECTED_SHAPE, self.selected_shape)  
21    
22          self.InsertColumn(0, "Field")          self.InsertColumn(0, "Field")
23          self.SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER)          self.SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER)
# Line 49  class IdentifyListCtrl(wxListCtrl): Line 48  class IdentifyListCtrl(wxListCtrl):
48                            
49    
50    
51  class IdentifyView(wxFrame):  class IdentifyView(NonModalDialog):
52    
53      def __init__(self, parent, app):      def __init__(self, parent, interactor, name):
54          # assume parent is Thuban's main window python object          NonModalDialog.__init__(self, parent, interactor, name,
55          wxFrame.__init__(self, parent, -1, "Identify Shape")                                  "Identify Shape")
56            self.interactor.Subscribe(SELECTED_SHAPE, self.selected_shape)
57            
58          panel = wxPanel(self, -1, style = wxWANTS_CHARS)          panel = wxPanel(self, -1, style = wxWANTS_CHARS)
59          self.list = IdentifyListCtrl(panel, -1, app.interactor)          self.list = IdentifyListCtrl(panel, -1)
60    
61          sizer = wxBoxSizer(wxVERTICAL)          sizer = wxBoxSizer(wxVERTICAL)
62          sizer.Add(self.list, 1, wx.wxEXPAND| wx.wxALL, 0)          sizer.Add(self.list, 1, wx.wxEXPAND| wx.wxALL, 0)
# Line 63  class IdentifyView(wxFrame): Line 64  class IdentifyView(wxFrame):
64          panel.SetAutoLayout(true)          panel.SetAutoLayout(true)
65          panel.SetSizer(sizer)          panel.SetSizer(sizer)
66          sizer.Fit(panel)          sizer.Fit(panel)
67    
68        def OnClose(self, event):
69            self.interactor.Unsubscribe(SELECTED_SHAPE, self.selected_shape)
70            NonModalDialog.OnClose(self, event)
71    
72        def selected_shape(self, layer, shape):
73            self.list.selected_shape(layer, shape)

Legend:
Removed from v.28  
changed lines
  Added in v.29

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26