[Thuban-devel] Re: Experimental patch for sizeable point symbols
Jan-Oliver Wagner
jan at intevation.de
Tue Oct 5 01:00:57 CEST 2004
On Mon, Oct 04, 2004 at 12:47:58PM +0200, Jan-Oliver Wagner wrote:
> - Add the possibility to set the size in the symbol edit window
> - handle classification to have a size gradient
these two are addressed with the attached patch.
Seems the grid widget needs some further improvement
to better adjust itself to the sizes of the point symbols.
Best
Jan
--
Jan-Oliver Wagner http://intevation.de/~jan/
Intevation GmbH http://intevation.de/
FreeGIS http://freegis.org/
-------------- next part --------------
? build
? thubaninit.py
? test/temp
Index: Thuban/Model/classgen.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/Model/classgen.py,v
retrieving revision 1.18
diff -u -3 -p -r1.18 classgen.py
--- Thuban/Model/classgen.py 26 Sep 2003 18:36:01 -0000 1.18
+++ Thuban/Model/classgen.py 4 Oct 2004 22:56:46 -0000
@@ -345,6 +345,11 @@ class CustomRamp:
+ self.prop1.GetLineWidth()
newProps.SetLineWidth(int(round(w)))
+ s = (self.prop2.GetSize() - self.prop1.GetSize()) \
+ * index \
+ + self.prop1.GetSize()
+ newProps.SetSize(int(round(s)))
+
return newProps
def __SetProperty(self, color1, color2, index, setf):
Index: Thuban/UI/classifier.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/UI/classifier.py,v
retrieving revision 1.68
diff -u -3 -p -r1.68 classifier.py
--- Thuban/UI/classifier.py 3 Oct 2004 21:23:25 -0000 1.68
+++ Thuban/UI/classifier.py 4 Oct 2004 22:56:46 -0000
@@ -1170,12 +1170,13 @@ class Classifier(NonModalNonParentDialog
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 +1240,38 @@ class SelectPropertiesDialog(wxDialog):
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())
+ self.spinCtrl_linewidth = wxSpinCtrl(self,
+ ID_SELPROP_SPINCTRL_LINEWIDTH,
+ min=1, max=10,
+ value=str(prop.GetLineWidth()),
+ initial=prop.GetLineWidth())
- EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL, self._OnSpin)
-
- 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 +1301,12 @@ class SelectPropertiesDialog(wxDialog):
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)