/[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 1526 by jonathan, Wed Jul 30 15:43:06 2003 UTC revision 2527 by bernhard, Thu Jan 20 11:45:15 2005 UTC
# Line 1  Line 1 
1  # Copyright (c) 2003 by Intevation GmbH  # Copyright (c) 2003, 2004 by Intevation GmbH
2  # Authors:  # Authors:
3  # Jonathan Coles <[email protected]>  # Jonathan Coles <[email protected]>
4  #  #
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  """The Classification Generator Dialog"""
9    
10  from Thuban import _  __version__ = "$Revision$"
11    # $Source$
12    # $Id$
13    
14    
15    import sys
16    
17  from wxPython.wx import *  from wxPython.wx import *
18    
19    from Thuban import _
20    
21  from Thuban.Model.classification import ClassGroupProperties  from Thuban.Model.classification import ClassGroupProperties
22    
23  from Thuban.Model.table import FIELDTYPE_INT, FIELDTYPE_DOUBLE, \  from Thuban.Model.table import FIELDTYPE_INT, FIELDTYPE_DOUBLE, \
# Line 264  class ClassGenDialog(wxDialog): Line 271  class ClassGenDialog(wxDialog):
271    
272                  if adjusted:                  if adjusted:
273                      dlg = wxMessageDialog(self,                      dlg = wxMessageDialog(self,
274                          _("Based on the data from the table and the input\n" +                          _("Based on the data from the table and the input\n"
275                            "values, the exact quantiles could not be generated.\n\n" +                       "values, the exact quantiles could not be generated.\n\n"
276                            "Accept a close estimate?"),                            "Accept a close estimate?"),
277                          _("Problem with Quantiles"),                          _("Problem with Quantiles"),
278    
# Line 637  class GenUniquePanel(wxPanel): Line 644  class GenUniquePanel(wxPanel):
644          psizer = wxBoxSizer(wxVERTICAL)          psizer = wxBoxSizer(wxVERTICAL)
645          self.list_avail = wxListCtrl(self, -1,          self.list_avail = wxListCtrl(self, -1,
646                          style=wxLC_REPORT | wxLC_SINGLE_SEL)                          style=wxLC_REPORT | wxLC_SINGLE_SEL)
647          self.list_avail.InsertColumn(0, "Available")          self.list_avail.InsertColumn(0, _("Available"))
648          self.list_avail_data = []          self.list_avail_data = []
649          psizer.Add(self.list_avail, 1, wxGROW, 0)          psizer.Add(self.list_avail, 1, wxGROW, 0)
650    
# Line 677  class GenUniquePanel(wxPanel): Line 684  class GenUniquePanel(wxPanel):
684          psizer = wxBoxSizer(wxVERTICAL)          psizer = wxBoxSizer(wxVERTICAL)
685          self.list_use = wxListCtrl(self, -1,          self.list_use = wxListCtrl(self, -1,
686                          style=wxLC_REPORT | wxLC_SINGLE_SEL)                          style=wxLC_REPORT | wxLC_SINGLE_SEL)
687          self.list_use.InsertColumn(0, "Use")          self.list_use.InsertColumn(0, _("Use"))
688          self.list_use_data = []          self.list_use_data = []
689          psizer.Add(self.list_use, 1, wxGROW, 0)          psizer.Add(self.list_use, 1, wxGROW, 0)
690    
# Line 825  class GenQuantilesPanel(wxPanel): Line 832  class GenQuantilesPanel(wxPanel):
832                                          _("Retrieve from Table"))                                          _("Retrieve from Table"))
833    
834          self.spin_numClasses = wxSpinCtrl(self, -1, style=wxTE_RIGHT)          self.spin_numClasses = wxSpinCtrl(self, -1, style=wxTE_RIGHT)
835          self.spin_numClasses.SetRange(1, sys.maxint)          self.spin_numClasses.SetRange(2, sys.maxint)
836          self.spin_numClasses.SetValue(1)          self.spin_numClasses.SetValue(2)
837    
838    
839          sizer = wxBoxSizer(wxHORIZONTAL)          sizer = wxBoxSizer(wxHORIZONTAL)
# Line 871  class GenQuantilesPanel(wxPanel): Line 878  class GenQuantilesPanel(wxPanel):
878                  # has been written to get all the values                  # has been written to get all the values
879                  #                  #
880                  for i in range(table.NumRows()):                  for i in range(table.NumRows()):
881                      _list.append(table.ReadValue(i, self.fieldName))                      _list.append(table.ReadValue(i, self.fieldName,
882                                                     row_is_ordinal = True))
883              finally:              finally:
884                  ThubanEndBusyCursor()                  ThubanEndBusyCursor()
885    
# Line 896  class GenQuantilesPanel(wxPanel): Line 904  class GenQuantilesPanel(wxPanel):
904              try:              try:
905                  min, max = table.ValueRange(self.fieldName)                  min, max = table.ValueRange(self.fieldName)
906                  self.text_range.SetValue("[" + str(min) + ";" + str(max) + "]")                  self.text_range.SetValue("[" + str(min) + ";" + str(max) + "]")
907                    # This is a workaround, which will result in OnRangeText
908                    # being called twice on some platforms.
909                    # Testing showed this is needed with current wx 2.4. versions
910                    # on MacOSX to guarantee that it is called at all.
911                    self.OnRangeText(None)
912              finally:              finally:
913                  ThubanEndBusyCursor()                  ThubanEndBusyCursor()
914    

Legend:
Removed from v.1526  
changed lines
  Added in v.2527

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26