1 |
# Copyright (c) 2001 by Intevation GmbH |
# Copyright (c) 2001, 2002 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> |
4 |
# |
# |
12 |
|
|
13 |
import view |
import view |
14 |
from dialogs import NonModalDialog |
from dialogs import NonModalDialog |
15 |
from controls import RecordListCtrl |
from controls import RecordListCtrl, RecordGridCtrl |
16 |
from messages import SELECTED_SHAPE |
from messages import SELECTED_SHAPE |
17 |
|
|
18 |
class IdentifyListCtrl(RecordListCtrl): |
class IdentifyListCtrl(RecordListCtrl): |
24 |
table = None |
table = None |
25 |
self.fill_list(table, shape) |
self.fill_list(table, shape) |
26 |
|
|
27 |
|
class IdentifyGridCtrl(RecordGridCtrl): |
28 |
|
|
29 |
|
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 |
class IdentifyView(NonModalDialog): |
class IdentifyView(NonModalDialog): |
37 |
|
|
41 |
self.interactor.Subscribe(SELECTED_SHAPE, self.selected_shape) |
self.interactor.Subscribe(SELECTED_SHAPE, self.selected_shape) |
42 |
|
|
43 |
panel = wxPanel(self, -1, style = wxWANTS_CHARS) |
panel = wxPanel(self, -1, style = wxWANTS_CHARS) |
44 |
self.list = IdentifyListCtrl(panel, -1) |
#self.list = IdentifyListCtrl(panel, -1) |
45 |
|
self.list = IdentifyGridCtrl(panel) |
46 |
|
|
47 |
sizer = wxBoxSizer(wxVERTICAL) |
sizer = wxBoxSizer(wxVERTICAL) |
48 |
sizer.Add(self.list, 1, wx.wxEXPAND| wx.wxALL, 0) |
sizer.Add(self.list, 1, wx.wxEXPAND| wx.wxALL, 0) |