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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 374 - (show annotations)
Mon Jan 27 14:20:02 2003 UTC (22 years, 1 month ago) by jan
Original Path: trunk/thuban/Thuban/UI/identifyview.py
File MIME type: text/x-python
File size: 1772 byte(s)
Replace user string by _() for i18n.

1 # Copyright (c) 2001, 2002 by Intevation GmbH
2 # 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 from Thuban import _
14
15 import view
16 from dialogs import NonModalDialog
17 from controls import RecordListCtrl, RecordGridCtrl
18 from messages import SELECTED_SHAPE
19
20 class IdentifyListCtrl(RecordListCtrl):
21
22 def selected_shape(self, layer, shape):
23 if layer is not None:
24 table = layer.shapetable
25 else:
26 table = None
27 self.fill_list(table, shape)
28
29 class IdentifyGridCtrl(RecordGridCtrl):
30
31 def selected_shape(self, layer, shape):
32 if layer is not None:
33 table = layer.shapetable
34 else:
35 table = None
36 self.SetTableRecord(table, shape)
37
38 class IdentifyView(NonModalDialog):
39
40 def __init__(self, parent, interactor, name):
41 NonModalDialog.__init__(self, parent, interactor, name,
42 _("Identify Shape"))
43 self.interactor.Subscribe(SELECTED_SHAPE, self.selected_shape)
44
45 panel = wxPanel(self, -1, style = wxWANTS_CHARS)
46 #self.list = IdentifyListCtrl(panel, -1)
47 self.list = IdentifyGridCtrl(panel)
48
49 sizer = wxBoxSizer(wxVERTICAL)
50 sizer.Add(self.list, 1, wx.wxEXPAND| wx.wxALL, 0)
51
52 panel.SetAutoLayout(true)
53 panel.SetSizer(sizer)
54 sizer.Fit(panel)
55
56 def OnClose(self, event):
57 self.interactor.Unsubscribe(SELECTED_SHAPE, self.selected_shape)
58 NonModalDialog.OnClose(self, event)
59
60 def selected_shape(self, layer, shape):
61 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