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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 80 - (hide annotations)
Mon Feb 4 19:53:01 2002 UTC (23 years, 1 month ago) by bh
Original Path: trunk/thuban/Thuban/UI/identifyview.py
File MIME type: text/x-python
File size: 1747 byte(s)
	* Thuban/UI/identifyview.py (IdentifyGridCtrl): New class to use a
	RecordGrid in the identifyview.
	(IdentifyView.__init__): Use IdentifyGridCtrl instead of
	IdentifyListCtrl. The grid allows editing of the values.

1 bh 80 # Copyright (c) 2001, 2002 by Intevation GmbH
2 bh 6 # Authors:
3     # Bernhard Herzog <[email protected]>
4     #
5     # This program is free software under the GPL (>=v2)
6     # Read the file COPYING coming with Thuban for details.
7    
8     __version__ = "$Revision$"
9    
10     from wxPython.wx import *
11     from wxPython.grid import *
12    
13     import view
14 bh 29 from dialogs import NonModalDialog
15 bh 80 from controls import RecordListCtrl, RecordGridCtrl
16 bh 6 from messages import SELECTED_SHAPE
17    
18 bh 51 class IdentifyListCtrl(RecordListCtrl):
19 bh 6
20     def selected_shape(self, layer, shape):
21 bh 66 if layer is not None:
22     table = layer.shapetable
23     else:
24     table = None
25     self.fill_list(table, shape)
26 bh 6
27 bh 80 class IdentifyGridCtrl(RecordGridCtrl):
28 bh 6
29 bh 80 def selected_shape(self, layer, shape):
30     if layer is not None:
31     table = layer.shapetable
32     else:
33     table = None
34     self.SetTableRecord(table, shape)
35    
36 bh 29 class IdentifyView(NonModalDialog):
37 bh 6
38 bh 29 def __init__(self, parent, interactor, name):
39     NonModalDialog.__init__(self, parent, interactor, name,
40     "Identify Shape")
41     self.interactor.Subscribe(SELECTED_SHAPE, self.selected_shape)
42    
43 bh 6 panel = wxPanel(self, -1, style = wxWANTS_CHARS)
44 bh 80 #self.list = IdentifyListCtrl(panel, -1)
45     self.list = IdentifyGridCtrl(panel)
46 bh 6
47     sizer = wxBoxSizer(wxVERTICAL)
48     sizer.Add(self.list, 1, wx.wxEXPAND| wx.wxALL, 0)
49    
50     panel.SetAutoLayout(true)
51     panel.SetSizer(sizer)
52     sizer.Fit(panel)
53 bh 29
54     def OnClose(self, event):
55     self.interactor.Unsubscribe(SELECTED_SHAPE, self.selected_shape)
56     NonModalDialog.OnClose(self, event)
57    
58     def selected_shape(self, layer, shape):
59     self.list.selected_shape(layer, shape)

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26