/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/classgen.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/classgen.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 654 by jonathan, Fri Apr 11 15:49:58 2003 UTC revision 677 by jonathan, Tue Apr 15 19:21:01 2003 UTC
# Line 5  Line 5 
5  # This program is free software under the GPL (>=v2)  # This program is free software under the GPL (>=v2)
6  # Read the file COPYING coming with Thuban for details.  # Read the file COPYING coming with Thuban for details.
7    
8    import sys
9    
10  from Thuban import _  from Thuban import _
11    
12  from wxPython.wx import *  from wxPython.wx import *
# Line 107  class ClassGenDialog(wxDialog): Line 109  class ClassGenDialog(wxDialog):
109          if self.type in (FIELDTYPE_INT, FIELDTYPE_DOUBLE):          if self.type in (FIELDTYPE_INT, FIELDTYPE_DOUBLE):
110              panel = GenUniformPanel(self, layer, fieldName, self.type)              panel = GenUniformPanel(self, layer, fieldName, self.type)
111              self.genCombo.Append(GENCOMBOSTR_UNIFORM, panel)              self.genCombo.Append(GENCOMBOSTR_UNIFORM, panel)
112              sizer.Add(panel, 0, wxGROW | wxALL, 4)              sizer.Add(panel, 1, wxGROW | wxALL, 4)
113              sizer.Show(panel, False)              sizer.Show(panel, False)
114    
115            self.genCombo.SetSelection(0)
116    
117          #############          #############
118    
119          psizer = wxBoxSizer(wxHORIZONTAL)          psizer = wxBoxSizer(wxHORIZONTAL)
120          psizer.Add(wxStaticText(self, -1, _("Color Schemes:")),          psizer.Add(wxStaticText(self, -1, _("Color Scheme:")),
121              0, wxALIGN_CENTER_VERTICAL, 0)              0, wxALIGN_CENTER_VERTICAL, 0)
122    
123          self.propCombo = wxComboBox(self,          self.propCombo = wxComboBox(self,
# Line 137  class ClassGenDialog(wxDialog): Line 141  class ClassGenDialog(wxDialog):
141          self.propCombo.Append(PROPCOMBOSTR_HOT2COLD,  HotToColdRamp())          self.propCombo.Append(PROPCOMBOSTR_HOT2COLD,  HotToColdRamp())
142          self.propCombo.Append(PROPCOMBOSTR_CUSTOM, panel)          self.propCombo.Append(PROPCOMBOSTR_CUSTOM, panel)
143    
144            self.propCombo.SetSelection(0)
145    
146    
147          #############          #############
# Line 287  class GenUniformPanel(wxPanel): Line 292  class GenUniformPanel(wxPanel):
292          sizer = wxBoxSizer(wxHORIZONTAL)          sizer = wxBoxSizer(wxHORIZONTAL)
293    
294          sizer.Add(wxStaticText(self, -1, _("Number of Groups:")), 0, wxALL, 4)          sizer.Add(wxStaticText(self, -1, _("Number of Groups:")), 0, wxALL, 4)
295          self.numGroupsCtrl = wxSpinCtrl(self, ID_UNIFORM_NGROUPS, style=wxTE_RIGHT)          self.numGroupsCtrl = wxSpinCtrl(self, ID_UNIFORM_NGROUPS,
296                                            style=wxTE_RIGHT)
297          EVT_TEXT(self, ID_UNIFORM_NGROUPS, self._OnNumGroupsChanged)          EVT_TEXT(self, ID_UNIFORM_NGROUPS, self._OnNumGroupsChanged)
298          EVT_SPINCTRL(self, ID_UNIFORM_NGROUPS, self._OnNumGroupsChanged)          EVT_SPINCTRL(self, ID_UNIFORM_NGROUPS, self._OnNumGroupsChanged)
299          sizer.Add(self.numGroupsCtrl, 1, wxALL, 4)          sizer.Add(self.numGroupsCtrl, 1, wxALL, 4)
# Line 308  class GenUniformPanel(wxPanel): Line 314  class GenUniformPanel(wxPanel):
314          self.numGroupsChanging = False          self.numGroupsChanging = False
315          self.steppingChanging = False          self.steppingChanging = False
316    
317          self.numGroupsCtrl.SetRange(1, 100)          self.numGroupsCtrl.SetRange(1, sys.maxint)
318    
319          self.numGroupsCtrl.SetValue(1)          self.numGroupsCtrl.SetValue(1)
320          self.stepCtrl.SetValue("1")          self.stepCtrl.SetValue("1")
# Line 358  class GenUniformPanel(wxPanel): Line 364  class GenUniformPanel(wxPanel):
364          self.numGroupsCtrl.Enable(on)          self.numGroupsCtrl.Enable(on)
365          self.stepCtrl.Enable(on)          self.stepCtrl.Enable(on)
366    
         if on:  
             self.numGroupsCtrl.SetRange(1, abs(max - min) / 0.001)  
   
367          ngroups = self.GetNumGroups()          ngroups = self.GetNumGroups()
368    
369          if ngroups is not None  \          if ngroups is not None  \
# Line 391  class GenUniformPanel(wxPanel): Line 394  class GenUniformPanel(wxPanel):
394          min = self.GetMin()          min = self.GetMin()
395          max = self.GetMax()          max = self.GetMax()
396    
         if ngroups >= self.numGroupsCtrl.GetMax():  
             self.numGroupsCtrl.SetRange(1, ngroups + 1)  
   
397          if ngroups is not None  \          if ngroups is not None  \
398              and min is not None \              and min is not None \
399              and max is not None \              and max is not None \

Legend:
Removed from v.654  
changed lines
  Added in v.677

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26