42 |
PROPCOMBOSTR_HOT2COLD = _("Hot-to-Cold Ramp") |
PROPCOMBOSTR_HOT2COLD = _("Hot-to-Cold Ramp") |
43 |
|
|
44 |
class ClassGenDialog(wxDialog): |
class ClassGenDialog(wxDialog): |
45 |
|
|
46 |
def __init__(self, parent, layer, fieldName): |
def __init__(self, parent, layer, fieldName): |
47 |
"""Inialize the class generating dialog. |
"""Inialize the class generating dialog. |
48 |
|
|
51 |
|
|
52 |
wxDialog.__init__(self, parent, -1, _("Generate Classification"), |
wxDialog.__init__(self, parent, -1, _("Generate Classification"), |
53 |
style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) |
style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) |
54 |
|
|
55 |
self.parent = parent |
self.parent = parent |
56 |
self.clazz = None |
self.clazz = None |
57 |
|
|
58 |
self.type, name, width, prec = layer.table.field_info_by_name(fieldName) |
col = layer.table.Column(fieldName) |
59 |
|
self.type = col.type |
60 |
|
|
61 |
############# |
############# |
62 |
# we need to create genButton first because when we create the |
# we need to create genButton first because when we create the |
433 |
|
|
434 |
if self.layer.table is not None: |
if self.layer.table is not None: |
435 |
wxBeginBusyCursor() |
wxBeginBusyCursor() |
436 |
range = self.layer.table.field_range(self.fieldName) |
min, max = self.layer.table.ValueRange(self.fieldName) |
437 |
self.minCtrl.SetValue(str(range[0][0])) |
self.minCtrl.SetValue(str(min)) |
438 |
self.maxCtrl.SetValue(str(range[1][0])) |
self.maxCtrl.SetValue(str(max)) |
439 |
wxEndBusyCursor() |
wxEndBusyCursor() |
440 |
|
|
441 |
def __GetValidatedTypeEntry(self, win, value, type, badValue = None): |
def __GetValidatedTypeEntry(self, win, value, type, badValue = None): |
640 |
self.list_avail.DeleteAllItems() |
self.list_avail.DeleteAllItems() |
641 |
self.list_avail_data = [] |
self.list_avail_data = [] |
642 |
|
|
643 |
list = self.layer.table.GetUniqueValues(self.fieldName) |
list = self.layer.table.UniqueValues(self.fieldName) |
644 |
index = 0 |
index = 0 |
645 |
for v in list: |
for v in list: |
646 |
self.dataList.append(v) |
self.dataList.append(v) |