13 |
|
|
14 |
from Thuban import _ |
from Thuban import _ |
15 |
|
|
16 |
from wxPython.wx import * |
import wx |
17 |
from Thuban.Model.messages import MAP_LAYERS_REMOVED, LAYER_SHAPESTORE_REPLACED |
from Thuban.Model.messages import MAP_LAYERS_REMOVED, LAYER_SHAPESTORE_REPLACED |
18 |
from dialogs import NonModalNonParentDialog |
from dialogs import NonModalNonParentDialog |
19 |
from messages import MAP_REPLACED |
from messages import MAP_REPLACED |
43 |
if self.layout_recurse: return |
if self.layout_recurse: return |
44 |
self.layout_recurse = True |
self.layout_recurse = True |
45 |
|
|
46 |
panel = wxPanel(self, -1) |
panel = wx.Panel(self, -1) |
47 |
|
|
48 |
topBox = wxBoxSizer(wxVERTICAL) |
topBox = wx.BoxSizer(wx.VERTICAL) |
49 |
panelBox = wxBoxSizer(wxVERTICAL) |
panelBox = wx.BoxSizer(wx.VERTICAL) |
50 |
|
|
51 |
# Title |
# Title |
52 |
|
|
53 |
sizer = wxBoxSizer(wxHORIZONTAL) |
sizer = wx.BoxSizer(wx.HORIZONTAL) |
54 |
sizer.Add(wxStaticText(panel, -1, _("Title: ")), |
sizer.Add(wx.StaticText(panel, -1, _("Title: ")), |
55 |
0, wxALIGN_LEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 4) |
0, wx.ALIGN_LEFT | wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 4) |
56 |
|
|
57 |
text_title = wxTextCtrl(panel, ID_PROPERTY_TITLE, self.layer.Title()) |
text_title = wx.TextCtrl(panel, ID_PROPERTY_TITLE, self.layer.Title()) |
58 |
text_title.SetInsertionPointEnd() |
text_title.SetInsertionPointEnd() |
59 |
sizer.Add(text_title, 1, wxGROW | wxRIGHT, 0) |
sizer.Add(text_title, 1, wx.GROW | wx.RIGHT, 0) |
60 |
|
|
61 |
panelBox.Add(sizer, 0, wxGROW | wxALL, 4) |
panelBox.Add(sizer, 0, wx.GROW | wx.ALL, 4) |
62 |
|
|
63 |
# Type |
# Type |
64 |
panelBox.Add(wxStaticText(panel, -1, |
panelBox.Add(wx.StaticText(panel, -1, |
65 |
_("Layer Type: %s") % self.layer.Type()), |
_("Layer Type: %s") % self.layer.Type()), |
66 |
0, wxALIGN_LEFT | wxALL, 4) |
0, wx.ALIGN_LEFT | wx.ALL, 4) |
67 |
|
|
68 |
# Projection |
# Projection |
69 |
proj = self.layer.GetProjection() |
proj = self.layer.GetProjection() |
71 |
text = _("Projection: None") |
text = _("Projection: None") |
72 |
else: |
else: |
73 |
text = _("Projection: %s") % proj.Label() |
text = _("Projection: %s") % proj.Label() |
74 |
|
|
75 |
panelBox.Add(wxStaticText(panel, -1, text), 0, wxALIGN_LEFT | wxALL, 4) |
panelBox.Add(wx.StaticText(panel, -1, text), 0, wx.ALIGN_LEFT | wx.ALL, 4) |
76 |
|
|
77 |
self.dialog_layout(panel, panelBox) |
self.dialog_layout(panel, panelBox) |
78 |
|
|
79 |
button_try = wxButton(self, ID_PROPERTY_TRY, _("Try")) |
button_try = wx.Button(self, ID_PROPERTY_TRY, _("Try")) |
80 |
button_revert = wxButton(self, ID_PROPERTY_REVERT, _("Revert")) |
button_revert = wx.Button(self, ID_PROPERTY_REVERT, _("Revert")) |
81 |
button_ok = wxButton(self, wxID_OK, _("OK")) |
button_ok = wx.Button(self, wx.ID_OK, _("OK")) |
82 |
button_close = wxButton(self, wxID_CANCEL, _("Close")) |
button_close = wx.Button(self, wx.ID_CANCEL, _("Close")) |
83 |
button_ok.SetDefault() |
button_ok.SetDefault() |
84 |
|
|
85 |
buttonBox = wxBoxSizer(wxHORIZONTAL) |
buttonBox = wx.BoxSizer(wx.HORIZONTAL) |
86 |
buttonBox.Add(button_try, 0, wxRIGHT|wxEXPAND, 10) |
buttonBox.Add(button_try, 0, wx.RIGHT|wx.EXPAND, 10) |
87 |
buttonBox.Add(button_revert, 0, wxRIGHT|wxEXPAND, 10) |
buttonBox.Add(button_revert, 0, wx.RIGHT|wx.EXPAND, 10) |
88 |
buttonBox.Add(button_ok, 0, wxRIGHT|wxEXPAND, 10) |
buttonBox.Add(button_ok, 0, wx.RIGHT|wx.EXPAND, 10) |
89 |
buttonBox.Add(button_close, 0, wxRIGHT|wxEXPAND, 0) |
buttonBox.Add(button_close, 0, wx.RIGHT|wx.EXPAND, 0) |
90 |
|
|
91 |
panel.SetAutoLayout(True) |
panel.SetAutoLayout(True) |
92 |
panel.SetSizer(panelBox) |
panel.SetSizer(panelBox) |
93 |
panelBox.Fit(panel) |
panelBox.Fit(panel) |
94 |
panelBox.SetSizeHints(panel) |
panelBox.SetSizeHints(panel) |
95 |
|
|
96 |
topBox.Add(panel, 1, wxGROW | wxALL, 4) |
topBox.Add(panel, 1, wx.GROW | wx.ALL, 4) |
97 |
topBox.Add(buttonBox, 0, wxALIGN_RIGHT|wxALL, 10) |
topBox.Add(buttonBox, 0, wx.ALIGN_RIGHT|wx.ALL, 10) |
98 |
|
|
99 |
self.SetAutoLayout(True) |
self.SetAutoLayout(True) |
100 |
self.SetSizer(topBox) |
self.SetSizer(topBox) |
104 |
|
|
105 |
########### |
########### |
106 |
|
|
107 |
EVT_TEXT(self, ID_PROPERTY_TITLE, self.OnTitleChanged) |
self.Bind(wx.EVT_TEXT, self.OnTitleChanged, id=ID_PROPERTY_TITLE) |
108 |
EVT_BUTTON(self, wxID_OK, self.OnOK) |
self.Bind(wx.EVT_BUTTON, self.OnOK, id=wx.ID_OK) |
109 |
EVT_BUTTON(self, ID_PROPERTY_TRY, self.OnTry) |
self.Bind(wx.EVT_BUTTON, self.OnTry, id=ID_PROPERTY_TRY) |
110 |
EVT_BUTTON(self, wxID_CANCEL, self.OnCloseBtn) |
self.Bind(wx.EVT_BUTTON, self.OnCloseBtn, id=wx.ID_CANCEL) |
111 |
EVT_BUTTON(self, ID_PROPERTY_REVERT, self.OnRevert) |
self.Bind(wx.EVT_BUTTON, self.OnRevert, id=ID_PROPERTY_REVERT) |
112 |
|
|
113 |
###################### |
###################### |
114 |
|
|