1 |
bh |
6 |
# Copyright (c) 2001 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 |
|
|
import view |
14 |
bh |
29 |
from dialogs import NonModalDialog |
15 |
bh |
51 |
from controls import RecordListCtrl |
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 |
51 |
self.fill_list(layer.shapetable, shape) |
22 |
bh |
6 |
|
23 |
|
|
|
24 |
bh |
29 |
class IdentifyView(NonModalDialog): |
25 |
bh |
6 |
|
26 |
bh |
29 |
def __init__(self, parent, interactor, name): |
27 |
|
|
NonModalDialog.__init__(self, parent, interactor, name, |
28 |
|
|
"Identify Shape") |
29 |
|
|
self.interactor.Subscribe(SELECTED_SHAPE, self.selected_shape) |
30 |
|
|
|
31 |
bh |
6 |
panel = wxPanel(self, -1, style = wxWANTS_CHARS) |
32 |
bh |
29 |
self.list = IdentifyListCtrl(panel, -1) |
33 |
bh |
6 |
|
34 |
|
|
sizer = wxBoxSizer(wxVERTICAL) |
35 |
|
|
sizer.Add(self.list, 1, wx.wxEXPAND| wx.wxALL, 0) |
36 |
|
|
|
37 |
|
|
panel.SetAutoLayout(true) |
38 |
|
|
panel.SetSizer(sizer) |
39 |
|
|
sizer.Fit(panel) |
40 |
bh |
29 |
|
41 |
|
|
def OnClose(self, event): |
42 |
|
|
self.interactor.Unsubscribe(SELECTED_SHAPE, self.selected_shape) |
43 |
|
|
NonModalDialog.OnClose(self, event) |
44 |
|
|
|
45 |
|
|
def selected_shape(self, layer, shape): |
46 |
|
|
self.list.selected_shape(layer, shape) |