1 |
# Copyright (c) 2001, 2003 by Intevation GmbH |
# Copyright (c) 2003-2004 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Jonathan Coles <[email protected]> |
# Jan-Oliver Wagner <[email protected]> (2003-2004) |
4 |
|
# Martin Schulze <[email protected]> (2004) |
5 |
|
# Frank Koormann <[email protected]> (2003) |
6 |
|
# Bernhard Herzog <[email protected]> (2003) |
7 |
|
# Jonathan Coles <[email protected]> (2003) |
8 |
# |
# |
9 |
# This program is free software under the GPL (>=v2) |
# This program is free software under the GPL (>=v2) |
10 |
# Read the file COPYING coming with Thuban for details. |
# Read the file COPYING coming with Thuban for details. |
12 |
"""Dialog for classifying how layers are displayed""" |
"""Dialog for classifying how layers are displayed""" |
13 |
|
|
14 |
__version__ = "$Revision$" |
__version__ = "$Revision$" |
15 |
|
# $Source$ |
16 |
|
# $Id$ |
17 |
|
|
18 |
import copy |
import copy |
19 |
|
|
1176 |
if win: |
if win: |
1177 |
win.Enable(enable) |
win.Enable(enable) |
1178 |
|
|
1179 |
ID_SELPROP_SPINCTRL = 4002 |
ID_SELPROP_SPINCTRL_LINEWIDTH = 4002 |
1180 |
ID_SELPROP_PREVIEW = 4003 |
ID_SELPROP_PREVIEW = 4003 |
1181 |
ID_SELPROP_STROKECLR = 4004 |
ID_SELPROP_STROKECLR = 4004 |
1182 |
ID_SELPROP_FILLCLR = 4005 |
ID_SELPROP_FILLCLR = 4005 |
1183 |
ID_SELPROP_STROKECLRTRANS = 4006 |
ID_SELPROP_STROKECLRTRANS = 4006 |
1184 |
ID_SELPROP_FILLCLRTRANS = 4007 |
ID_SELPROP_FILLCLRTRANS = 4007 |
1185 |
|
ID_SELPROP_SPINCTRL_SIZE = 4008 |
1186 |
|
|
1187 |
class SelectPropertiesDialog(wxDialog): |
class SelectPropertiesDialog(wxDialog): |
1188 |
"""Dialog that allows the user to select group properties.""" |
"""Dialog that allows the user to select group properties.""" |
1246 |
ctrlBox.Add(fillColorBox, 0, |
ctrlBox.Add(fillColorBox, 0, |
1247 |
wxALIGN_CENTER_HORIZONTAL | wxALL | wxGROW, 4) |
wxALIGN_CENTER_HORIZONTAL | wxALL | wxGROW, 4) |
1248 |
|
|
1249 |
|
# Line width selection |
1250 |
spinBox = wxBoxSizer(wxHORIZONTAL) |
spinBox = wxBoxSizer(wxHORIZONTAL) |
1251 |
spinBox.Add(wxStaticText(self, -1, _("Line Width: ")), |
spinBox.Add(wxStaticText(self, -1, _("Line Width: ")), |
1252 |
0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 4) |
0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 4) |
1253 |
self.spinCtrl = wxSpinCtrl(self, ID_SELPROP_SPINCTRL, |
self.spinCtrl_linewidth = wxSpinCtrl(self, |
1254 |
min=1, max=10, |
ID_SELPROP_SPINCTRL_LINEWIDTH, |
1255 |
value=str(prop.GetLineWidth()), |
min=1, max=10, |
1256 |
initial=prop.GetLineWidth()) |
value=str(prop.GetLineWidth()), |
1257 |
|
initial=prop.GetLineWidth()) |
1258 |
|
|
1259 |
EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL, self._OnSpin) |
EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL_LINEWIDTH, |
1260 |
|
self._OnSpinLineWidth) |
|
spinBox.Add(self.spinCtrl, 0, wxALIGN_LEFT | wxALL, 4) |
|
1261 |
|
|
1262 |
|
spinBox.Add(self.spinCtrl_linewidth, 0, wxALIGN_LEFT | wxALL, 4) |
1263 |
ctrlBox.Add(spinBox, 0, wxALIGN_RIGHT | wxALL, 0) |
ctrlBox.Add(spinBox, 0, wxALIGN_RIGHT | wxALL, 0) |
1264 |
|
|
1265 |
|
# Size selection |
1266 |
|
if shapeType == SHAPETYPE_POINT: |
1267 |
|
spinBox = wxBoxSizer(wxHORIZONTAL) |
1268 |
|
spinBox.Add(wxStaticText(self, -1, _("Size: ")), |
1269 |
|
0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 4) |
1270 |
|
self.spinCtrl_size = wxSpinCtrl(self, ID_SELPROP_SPINCTRL_SIZE, |
1271 |
|
min=1, max=100, |
1272 |
|
value=str(prop.GetSize()), |
1273 |
|
initial=prop.GetSize()) |
1274 |
|
|
1275 |
|
EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL_SIZE, self._OnSpinSize) |
1276 |
|
|
1277 |
|
spinBox.Add(self.spinCtrl_size, 0, wxALIGN_LEFT | wxALL, 4) |
1278 |
|
ctrlBox.Add(spinBox, 0, wxALIGN_RIGHT | wxALL, 0) |
1279 |
|
|
1280 |
|
|
1281 |
itemBox.Add(ctrlBox, 0, wxALIGN_RIGHT | wxALL | wxGROW, 0) |
itemBox.Add(ctrlBox, 0, wxALIGN_RIGHT | wxALL | wxGROW, 0) |
1282 |
topBox.Add(itemBox, 1, wxALIGN_LEFT | wxALL | wxGROW, 0) |
topBox.Add(itemBox, 1, wxALIGN_LEFT | wxALL | wxGROW, 0) |
1283 |
|
|
1307 |
def OnCancel(self, event): |
def OnCancel(self, event): |
1308 |
self.EndModal(wxID_CANCEL) |
self.EndModal(wxID_CANCEL) |
1309 |
|
|
1310 |
def _OnSpin(self, event): |
def _OnSpinLineWidth(self, event): |
1311 |
self.prop.SetLineWidth(self.spinCtrl.GetValue()) |
self.prop.SetLineWidth(self.spinCtrl_linewidth.GetValue()) |
1312 |
|
self.previewWin.Refresh() |
1313 |
|
|
1314 |
|
def _OnSpinSize(self, event): |
1315 |
|
self.prop.SetSize(self.spinCtrl_size.GetValue()) |
1316 |
self.previewWin.Refresh() |
self.previewWin.Refresh() |
1317 |
|
|
1318 |
def __GetColor(self, cur): |
def __GetColor(self, cur): |