33 |
|
|
34 |
from Thuban.UI.classgen import ClassGenDialog, ClassGenerator |
from Thuban.UI.classgen import ClassGenDialog, ClassGenerator |
35 |
|
|
36 |
from dialogs import NonModalDialog |
from dialogs import NonModalNonParentDialog |
37 |
|
|
38 |
ID_CLASS_TABLE = 40011 |
ID_CLASS_TABLE = 40011 |
39 |
|
|
670 |
EB_SELECT_FIELD = 1 |
EB_SELECT_FIELD = 1 |
671 |
EB_GEN_CLASS = 2 |
EB_GEN_CLASS = 2 |
672 |
|
|
673 |
class Classifier(NonModalDialog): |
class Classifier(NonModalNonParentDialog): |
674 |
|
|
675 |
type2string = {None: _("None"), |
type2string = {None: _("None"), |
676 |
FIELDTYPE_STRING: _("Text"), |
FIELDTYPE_STRING: _("Text"), |
678 |
FIELDTYPE_DOUBLE: _("Decimal")} |
FIELDTYPE_DOUBLE: _("Decimal")} |
679 |
|
|
680 |
def __init__(self, parent, name, layer, group = None): |
def __init__(self, parent, name, layer, group = None): |
681 |
NonModalDialog.__init__(self, parent, name, "") |
NonModalNonParentDialog.__init__(self, parent, name, "") |
682 |
|
|
683 |
self.__SetTitle(layer.Title()) |
self.__SetTitle(layer.Title()) |
684 |
|
|
749 |
self.fields.SetSelection(self.__cur_field) |
self.fields.SetSelection(self.__cur_field) |
750 |
self.__SelectField(self.__cur_field, group = group) |
self.__SelectField(self.__cur_field, group = group) |
751 |
|
|
752 |
button_try = wxButton(panel, ID_PROPERTY_TRY, _("Try")) |
button_try = wxButton(self, ID_PROPERTY_TRY, _("Try")) |
753 |
button_revert = wxButton(panel, ID_PROPERTY_REVERT, _("Revert")) |
button_revert = wxButton(self, ID_PROPERTY_REVERT, _("Revert")) |
754 |
button_ok = wxButton(panel, wxID_OK, _("OK")) |
button_ok = wxButton(self, wxID_OK, _("OK")) |
755 |
button_ok.SetDefault() |
button_ok.SetDefault() |
756 |
button_close = wxButton(panel, wxID_CANCEL, _("Close")) |
button_close = wxButton(self, wxID_CANCEL, _("Close")) |
757 |
|
|
758 |
############################ |
############################ |
759 |
# Layout the controls |
# Layout the controls |
813 |
|
|
814 |
|
|
815 |
buttonBox = wxBoxSizer(wxHORIZONTAL) |
buttonBox = wxBoxSizer(wxHORIZONTAL) |
816 |
buttonBox.Add(button_try, 0, wxALL, 4) |
buttonBox.Add(button_try, 0, wxRIGHT|wxEXPAND, 10) |
817 |
buttonBox.Add(60, 20, 0, wxALL, 4) |
buttonBox.Add(button_revert, 0, wxRIGHT|wxEXPAND, 10) |
818 |
buttonBox.Add(button_revert, 0, wxALL, 4) |
buttonBox.Add(button_ok, 0, wxRIGHT|wxEXPAND, 10) |
819 |
buttonBox.Add(60, 20, 0, wxALL, 4) |
buttonBox.Add(button_close, 0, wxRIGHT|wxEXPAND, 10) |
|
buttonBox.Add(button_ok, 0, wxALL, 4) |
|
|
buttonBox.Add(60, 20, 0, wxALL, 4) |
|
|
buttonBox.Add(button_close, 0, wxALL, 4) |
|
|
panelBox.Add(buttonBox, 0, |
|
|
wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 0) |
|
820 |
|
|
821 |
panel.SetAutoLayout(True) |
panel.SetAutoLayout(True) |
822 |
panel.SetSizer(panelBox) |
panel.SetSizer(panelBox) |
824 |
panelBox.SetSizeHints(panel) |
panelBox.SetSizeHints(panel) |
825 |
|
|
826 |
topBox.Add(panel, 1, wxGROW | wxALL, 4) |
topBox.Add(panel, 1, wxGROW | wxALL, 4) |
827 |
|
topBox.Add(buttonBox, 0, wxALIGN_RIGHT|wxBOTTOM|wxTOP, 10) |
828 |
|
|
829 |
self.SetAutoLayout(True) |
self.SetAutoLayout(True) |
830 |
self.SetSizer(topBox) |
self.SetSizer(topBox) |
989 |
self.Close() |
self.Close() |
990 |
|
|
991 |
def OnClose(self, event): |
def OnClose(self, event): |
992 |
NonModalDialog.OnClose(self, event) |
NonModalNonParentDialog.OnClose(self, event) |
993 |
|
|
994 |
def _OnCloseBtn(self, event): |
def _OnCloseBtn(self, event): |
995 |
"""Close is similar to Cancel except that any changes that were |
"""Close is similar to Cancel except that any changes that were |
1176 |
buttonBox = wxBoxSizer(wxHORIZONTAL) |
buttonBox = wxBoxSizer(wxHORIZONTAL) |
1177 |
button_ok = wxButton(self, wxID_OK, _("OK")) |
button_ok = wxButton(self, wxID_OK, _("OK")) |
1178 |
button_ok.SetDefault() |
button_ok.SetDefault() |
1179 |
buttonBox.Add(button_ok, 0, wxALL, 4) |
buttonBox.Add(button_ok, 0, wxRIGHT|wxEXPAND, 10) |
1180 |
buttonBox.Add(wxButton(self, wxID_CANCEL, _("Cancel")), |
buttonBox.Add(wxButton(self, wxID_CANCEL, _("Cancel")), |
1181 |
0, wxALL, 4) |
0, wxRIGHT|wxEXPAND, 10) |
1182 |
topBox.Add(buttonBox, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 10) |
topBox.Add(buttonBox, 0, wxALIGN_RIGHT|wxBOTTOM|wxTOP, 10) |
1183 |
|
|
1184 |
#EVT_BUTTON(self, wxID_OK, self._OnOK) |
#EVT_BUTTON(self, wxID_OK, self._OnOK) |
1185 |
#EVT_BUTTON(self, ID_SELPROP_CANCEL, self._OnCancel) |
#EVT_BUTTON(self, ID_SELPROP_CANCEL, self._OnCancel) |