jan: thuban/Thuban/UI classifier.py,1.68,1.69
cvs@intevation.de
cvs at intevation.de
Thu Oct 7 16:43:47 CEST 2004
Author: jan
Update of /thubanrepository/thuban/Thuban/UI
In directory doto:/tmp/cvs-serv15286
Modified Files:
classifier.py
Log Message:
(ID_SELPROP_SPINCTRL): Renamed to ID_SELPROP_SPINCTRL_LINEWIDTH.
(ID_SELPROP_SPINCTRL_LINEWIDTH): New Id replaces ID_SELPROP_SPINCTRL.
(ID_SELPROP_SPINCTRL_SIZE): New Id.
(SelectPropertiesDialog.__init__): Added a second spin control
for the size in case the corresponding layer is of point type.
(SelectPropertiesDialog._OnSpin): Renamed to _OnSpinLineWidth.
(SelectPropertiesDialog._OnSpinLineWidth): New. Former _OnSpin.
(SelectPropertiesDialog._OnSpinSize): New. Set size of property
and refresh preview.
Index: classifier.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/UI/classifier.py,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- classifier.py 3 Oct 2004 21:23:25 -0000 1.68
+++ classifier.py 7 Oct 2004 14:43:45 -0000 1.69
@@ -1,6 +1,10 @@
-# Copyright (c) 2001, 2003 by Intevation GmbH
+# Copyright (c) 2003-2004 by Intevation GmbH
# Authors:
-# Jonathan Coles <jonathan at intevation.de>
+# Jan-Oliver Wagner <jan at intevation.de> (2003-2004)
+# Martin Schulze <joey at infodrom.org> (2004)
+# Frank Koormann <frank at intevation.de> (2003)
+# Bernhard Herzog <bh at intevation.de> (2003)
+# Jonathan Coles <jonathan at intevation.de> (2003)
#
# This program is free software under the GPL (>=v2)
# Read the file COPYING coming with Thuban for details.
@@ -8,6 +12,8 @@
"""Dialog for classifying how layers are displayed"""
__version__ = "$Revision$"
+# $Source$
+# $Id$
import copy
@@ -1170,12 +1176,13 @@
if win:
win.Enable(enable)
-ID_SELPROP_SPINCTRL = 4002
+ID_SELPROP_SPINCTRL_LINEWIDTH = 4002
ID_SELPROP_PREVIEW = 4003
ID_SELPROP_STROKECLR = 4004
ID_SELPROP_FILLCLR = 4005
ID_SELPROP_STROKECLRTRANS = 4006
ID_SELPROP_FILLCLRTRANS = 4007
+ID_SELPROP_SPINCTRL_SIZE = 4008
class SelectPropertiesDialog(wxDialog):
"""Dialog that allows the user to select group properties."""
@@ -1239,19 +1246,38 @@
ctrlBox.Add(fillColorBox, 0,
wxALIGN_CENTER_HORIZONTAL | wxALL | wxGROW, 4)
+ # Line width selection
spinBox = wxBoxSizer(wxHORIZONTAL)
spinBox.Add(wxStaticText(self, -1, _("Line Width: ")),
0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 4)
- self.spinCtrl = wxSpinCtrl(self, ID_SELPROP_SPINCTRL,
- min=1, max=10,
- value=str(prop.GetLineWidth()),
- initial=prop.GetLineWidth())
-
- EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL, self._OnSpin)
+ self.spinCtrl_linewidth = wxSpinCtrl(self,
+ ID_SELPROP_SPINCTRL_LINEWIDTH,
+ min=1, max=10,
+ value=str(prop.GetLineWidth()),
+ initial=prop.GetLineWidth())
- spinBox.Add(self.spinCtrl, 0, wxALIGN_LEFT | wxALL, 4)
+ EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL_LINEWIDTH,
+ self._OnSpinLineWidth)
+ spinBox.Add(self.spinCtrl_linewidth, 0, wxALIGN_LEFT | wxALL, 4)
ctrlBox.Add(spinBox, 0, wxALIGN_RIGHT | wxALL, 0)
+
+ # Size selection
+ if shapeType == SHAPETYPE_POINT:
+ spinBox = wxBoxSizer(wxHORIZONTAL)
+ spinBox.Add(wxStaticText(self, -1, _("Size: ")),
+ 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 4)
+ self.spinCtrl_size = wxSpinCtrl(self, ID_SELPROP_SPINCTRL_SIZE,
+ min=1, max=100,
+ value=str(prop.GetSize()),
+ initial=prop.GetSize())
+
+ EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL_SIZE, self._OnSpinSize)
+
+ spinBox.Add(self.spinCtrl_size, 0, wxALIGN_LEFT | wxALL, 4)
+ ctrlBox.Add(spinBox, 0, wxALIGN_RIGHT | wxALL, 0)
+
+
itemBox.Add(ctrlBox, 0, wxALIGN_RIGHT | wxALL | wxGROW, 0)
topBox.Add(itemBox, 1, wxALIGN_LEFT | wxALL | wxGROW, 0)
@@ -1281,8 +1307,12 @@
def OnCancel(self, event):
self.EndModal(wxID_CANCEL)
- def _OnSpin(self, event):
- self.prop.SetLineWidth(self.spinCtrl.GetValue())
+ def _OnSpinLineWidth(self, event):
+ self.prop.SetLineWidth(self.spinCtrl_linewidth.GetValue())
+ self.previewWin.Refresh()
+
+ def _OnSpinSize(self, event):
+ self.prop.SetSize(self.spinCtrl_size.GetValue())
self.previewWin.Refresh()
def __GetColor(self, cur):
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)