27 |
ClassGroupSingleton, ClassGroupRange, ClassGroupMap, \ |
ClassGroupSingleton, ClassGroupRange, ClassGroupMap, \ |
28 |
ClassGroupProperties |
ClassGroupProperties |
29 |
|
|
30 |
from Thuban.Model.color import Color |
from Thuban.Model.color import Transparent |
31 |
|
|
32 |
from Thuban.Model.layer import Layer, RasterLayer, \ |
from Thuban.Model.layer import Layer, RasterLayer, \ |
33 |
SHAPETYPE_ARC, SHAPETYPE_POLYGON, SHAPETYPE_POINT |
SHAPETYPE_ARC, SHAPETYPE_POLYGON, SHAPETYPE_POINT |
758 |
button_try = wxButton(self, ID_PROPERTY_TRY, _("Try")) |
button_try = wxButton(self, ID_PROPERTY_TRY, _("Try")) |
759 |
button_revert = wxButton(self, ID_PROPERTY_REVERT, _("Revert")) |
button_revert = wxButton(self, ID_PROPERTY_REVERT, _("Revert")) |
760 |
button_ok = wxButton(self, wxID_OK, _("OK")) |
button_ok = wxButton(self, wxID_OK, _("OK")) |
|
button_ok.SetDefault() |
|
761 |
button_close = wxButton(self, wxID_CANCEL, _("Close")) |
button_close = wxButton(self, wxID_CANCEL, _("Close")) |
762 |
|
button_ok.SetDefault() |
763 |
|
|
764 |
############################ |
############################ |
765 |
# Layout the controls |
# Layout the controls |
909 |
if copyClass: |
if copyClass: |
910 |
clazz = copy.deepcopy(clazz) |
clazz = copy.deepcopy(clazz) |
911 |
|
|
912 |
clazz.SetField(fieldName) |
clazz.SetFieldInfo(fieldName, fieldType) |
|
clazz.SetFieldType(fieldType) |
|
913 |
|
|
914 |
|
|
915 |
# table = self.classGrid.GetTable() |
# table = self.classGrid.GetTable() |
933 |
|
|
934 |
fieldName = self.fields.GetString(fieldIndex) |
fieldName = self.fields.GetString(fieldIndex) |
935 |
fieldType = self.layer.GetFieldType(fieldName) |
fieldType = self.layer.GetFieldType(fieldName) |
936 |
clazz.SetFieldType(fieldType) |
clazz.SetFieldInfo(fieldName, fieldType) |
937 |
|
|
938 |
self.classGrid.CreateTable(clazz, self.layer.ShapeType(), group) |
self.classGrid.CreateTable(clazz, self.layer.ShapeType(), group) |
939 |
|
|
1208 |
# |
# |
1209 |
buttonBox = wxBoxSizer(wxHORIZONTAL) |
buttonBox = wxBoxSizer(wxHORIZONTAL) |
1210 |
button_ok = wxButton(self, wxID_OK, _("OK")) |
button_ok = wxButton(self, wxID_OK, _("OK")) |
|
button_ok.SetDefault() |
|
1211 |
buttonBox.Add(button_ok, 0, wxRIGHT|wxEXPAND, 10) |
buttonBox.Add(button_ok, 0, wxRIGHT|wxEXPAND, 10) |
1212 |
buttonBox.Add(wxButton(self, wxID_CANCEL, _("Cancel")), |
buttonBox.Add(wxButton(self, wxID_CANCEL, _("Cancel")), |
1213 |
0, wxRIGHT|wxEXPAND, 10) |
0, wxRIGHT|wxEXPAND, 10) |
1214 |
topBox.Add(buttonBox, 0, wxALIGN_RIGHT|wxBOTTOM|wxTOP, 10) |
topBox.Add(buttonBox, 0, wxALIGN_RIGHT|wxBOTTOM|wxTOP, 10) |
1215 |
|
|
1216 |
|
button_ok.SetDefault() |
1217 |
|
|
1218 |
#EVT_BUTTON(self, wxID_OK, self._OnOK) |
#EVT_BUTTON(self, wxID_OK, self._OnOK) |
1219 |
#EVT_BUTTON(self, ID_SELPROP_CANCEL, self._OnCancel) |
#EVT_BUTTON(self, ID_SELPROP_CANCEL, self._OnCancel) |
1235 |
|
|
1236 |
def __GetColor(self, cur): |
def __GetColor(self, cur): |
1237 |
dialog = wxColourDialog(self) |
dialog = wxColourDialog(self) |
1238 |
if cur is not Color.Transparent: |
if cur is not Transparent: |
1239 |
dialog.GetColourData().SetColour(Color2wxColour(cur)) |
dialog.GetColourData().SetColour(Color2wxColour(cur)) |
1240 |
|
|
1241 |
ret = None |
ret = None |
1253 |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
1254 |
|
|
1255 |
def _OnChangeLineColorTrans(self, event): |
def _OnChangeLineColorTrans(self, event): |
1256 |
self.prop.SetLineColor(Color.Transparent) |
self.prop.SetLineColor(Transparent) |
1257 |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
1258 |
|
|
1259 |
def _OnChangeFillColor(self, event): |
def _OnChangeFillColor(self, event): |
1263 |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
1264 |
|
|
1265 |
def _OnChangeFillColorTrans(self, event): |
def _OnChangeFillColorTrans(self, event): |
1266 |
self.prop.SetFill(Color.Transparent) |
self.prop.SetFill(Transparent) |
1267 |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
1268 |
|
|
1269 |
def GetClassGroupProperties(self): |
def GetClassGroupProperties(self): |
1319 |
h = rect.GetHeight() |
h = rect.GetHeight() |
1320 |
|
|
1321 |
stroke = prop.GetLineColor() |
stroke = prop.GetLineColor() |
1322 |
if stroke is Color.Transparent: |
if stroke is Transparent: |
1323 |
pen = wxTRANSPARENT_PEN |
pen = wxTRANSPARENT_PEN |
1324 |
else: |
else: |
1325 |
pen = wxPen(Color2wxColour(stroke), |
pen = wxPen(Color2wxColour(stroke), |
1327 |
wxSOLID) |
wxSOLID) |
1328 |
|
|
1329 |
stroke = prop.GetFill() |
stroke = prop.GetFill() |
1330 |
if stroke is Color.Transparent: |
if stroke is Transparent: |
1331 |
brush = wxTRANSPARENT_BRUSH |
brush = wxTRANSPARENT_BRUSH |
1332 |
else: |
else: |
1333 |
brush = wxBrush(Color2wxColour(stroke), wxSOLID) |
brush = wxBrush(Color2wxColour(stroke), wxSOLID) |