780 |
# calling __SelectField after creating the classGrid fills in the |
# calling __SelectField after creating the classGrid fills in the |
781 |
# grid with the correct information |
# grid with the correct information |
782 |
#print "2------------------" |
#print "2------------------" |
783 |
|
self.fields.SetSelection(self.__cur_field) |
784 |
self.__SelectField(self.__cur_field, group = group) |
self.__SelectField(self.__cur_field, group = group) |
785 |
|
|
786 |
#self.classGrid.SelectGroup(group) |
#self.classGrid.SelectGroup(group) |
909 |
self.fieldTypeText.SetLabel(_("Field Type: %s") % text) |
self.fieldTypeText.SetLabel(_("Field Type: %s") % text) |
910 |
|
|
911 |
def __SelectField(self, newIndex, oldIndex = -1, group = None): |
def __SelectField(self, newIndex, oldIndex = -1, group = None): |
912 |
|
"""This method assumes that the current selection for the |
913 |
|
combo has already been set by a call to SetSelection(). |
914 |
|
""" |
915 |
|
|
916 |
#print "3------------------" |
#print "3------------------" |
917 |
|
|
918 |
assert oldIndex >= -1 |
assert oldIndex >= -1 |
919 |
|
|
|
self.fields.SetSelection(newIndex) |
|
|
|
|
920 |
if oldIndex != -1: |
if oldIndex != -1: |
921 |
clazz = self.__BuildClassification(oldIndex) |
clazz = self.__BuildClassification(oldIndex) |
922 |
self.fields.SetClientData(oldIndex, clazz) |
self.fields.SetClientData(oldIndex, clazz) |
1133 |
|
|
1134 |
def __GetColor(self, cur): |
def __GetColor(self, cur): |
1135 |
dialog = wxColourDialog(self) |
dialog = wxColourDialog(self) |
1136 |
if cur is not Color.None: |
if cur is not Color.Transparent: |
1137 |
dialog.GetColourData().SetColour(Color2wxColour(cur)) |
dialog.GetColourData().SetColour(Color2wxColour(cur)) |
1138 |
|
|
1139 |
ret = None |
ret = None |
1151 |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
1152 |
|
|
1153 |
def _OnChangeLineColorTrans(self, event): |
def _OnChangeLineColorTrans(self, event): |
1154 |
self.prop.SetLineColor(Color.None) |
self.prop.SetLineColor(Color.Transparent) |
1155 |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
1156 |
|
|
1157 |
def _OnChangeFillColor(self, event): |
def _OnChangeFillColor(self, event): |
1161 |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
1162 |
|
|
1163 |
def _OnChangeFillColorTrans(self, event): |
def _OnChangeFillColorTrans(self, event): |
1164 |
self.prop.SetFill(Color.None) |
self.prop.SetFill(Color.Transparent) |
1165 |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer |
1166 |
|
|
1167 |
def GetClassGroupProperties(self): |
def GetClassGroupProperties(self): |
1214 |
h = rect.GetHeight() |
h = rect.GetHeight() |
1215 |
|
|
1216 |
stroke = prop.GetLineColor() |
stroke = prop.GetLineColor() |
1217 |
if stroke is Color.None: |
if stroke is Color.Transparent: |
1218 |
pen = wxTRANSPARENT_PEN |
pen = wxTRANSPARENT_PEN |
1219 |
else: |
else: |
1220 |
pen = wxPen(Color2wxColour(stroke), |
pen = wxPen(Color2wxColour(stroke), |
1222 |
wxSOLID) |
wxSOLID) |
1223 |
|
|
1224 |
stroke = prop.GetFill() |
stroke = prop.GetFill() |
1225 |
if stroke is Color.None: |
if stroke is Color.Transparent: |
1226 |
brush = wxTRANSPARENT_BRUSH |
brush = wxTRANSPARENT_BRUSH |
1227 |
else: |
else: |
1228 |
brush = wxBrush(Color2wxColour(stroke), wxSOLID) |
brush = wxBrush(Color2wxColour(stroke), wxSOLID) |