/[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 1706 by jan, Wed Sep 3 08:31:26 2003 UTC revision 2700 by dpinte, Mon Sep 18 14:27:02 2006 UTC
# Line 8  Line 8 
8    
9  __version__ = "$Revision$"  __version__ = "$Revision$"
10    
11  from wxPython.wx import *  import wx
12  from wxPython.grid import *  from wx import grid
13    
14  from Thuban import _  from Thuban import _
15    
16  from dialogs import NonModalDialog  from dialogs import NonModalDialog
17  from controls import RecordListCtrl, RecordGridCtrl  from controls import RecordListCtrl, RecordGridCtrl
18  from messages import SHAPES_SELECTED  from messages import SHAPES_SELECTED
19    import main
20    
21  class IdentifyListCtrl(RecordListCtrl):  class IdentifyListCtrl(RecordListCtrl):
22    
# Line 43  class IdentifyView(NonModalDialog): Line 44  class IdentifyView(NonModalDialog):
44          NonModalDialog.__init__(self, parent, name, _("Identify Shape"))          NonModalDialog.__init__(self, parent, name, _("Identify Shape"))
45          parent.Subscribe(SHAPES_SELECTED, self.selected_shape)          parent.Subscribe(SHAPES_SELECTED, self.selected_shape)
46    
47          top_box = wxBoxSizer(wxVERTICAL)          top_box = wx.BoxSizer(wx.VERTICAL)
48          #self.list = IdentifyGridCtrl(panel)          if main.options.attribute_editing_enabled:
49          self.list = IdentifyListCtrl(self, -1)              self.list = IdentifyGridCtrl(self)
50          self.list.SetSize(wxSize(305,200))          else:
51          top_box.Add(self.list, 1, wxEXPAND|wxALL, 4)              self.list = IdentifyListCtrl(self, -1)
52            self.list.SetSize(wx.Size(305,200))
53          box = wxBoxSizer(wxHORIZONTAL)          top_box.Add(self.list, 1, wx.EXPAND|wx.ALL, 4)
54          box.Add(wxButton(self, wxID_CLOSE, _("Close Window")), 0, wxALL, 4)  
55          box.Add(wxButton(self, self.ID_STOP, _("Stop Identify Mode")),          box = wx.BoxSizer(wx.HORIZONTAL)
56                           0, wxALL, 4)          box.Add(wx.Button(self, wx.ID_CLOSE, _("Close Window")), 0, wx.ALL, 4)
57          top_box.Add(box, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 4)          box.Add(wx.Button(self, self.ID_STOP, _("Stop Identify Mode")),
58                             0, wx.ALL, 4)
59            top_box.Add(box, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 4)
60    
61          EVT_BUTTON(self, wxID_CLOSE, self.OnClose)          self.Bind(wx.EVT_BUTTON, self.OnClose, id=wx.ID_CLOSE)
62          EVT_BUTTON(self, self.ID_STOP, self.OnStop)          self.Bind(wx.EVT_BUTTON, self.OnStop, id=self.ID_STOP)
63    
64          self.SetAutoLayout(True)          self.SetAutoLayout(True)
65          self.SetSizer(top_box)          self.SetSizer(top_box)
# Line 78  class IdentifyView(NonModalDialog): Line 81  class IdentifyView(NonModalDialog):
81      def selected_shape(self, layer, shapes):      def selected_shape(self, layer, shapes):
82          """Subscribed to the SHAPES_SELECTED messages.          """Subscribed to the SHAPES_SELECTED messages.
83    
84          If exatly one shape is selected, pass that shape id to the          If exactly one shape is selected, pass that shape id to the
85          list's selected_shape method. Otherwise pass None as the shape          list's selected_shape method. Otherwise pass None as the shape
86          id.          id.
87          """          """

Legend:
Removed from v.1706  
changed lines
  Added in v.2700

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26