368 |
l.Subscribe(LAYER_VISIBILITY_CHANGED, |
l.Subscribe(LAYER_VISIBILITY_CHANGED, |
369 |
self._OnMsgLayerVisibilityChanged) |
self._OnMsgLayerVisibilityChanged) |
370 |
self.SetPyData(id, l) |
self.SetPyData(id, l) |
371 |
font = self.GetItemFont(id) |
self.__SetVisibilityStyle(l.Visible(), id) |
|
if not l.Visible(): |
|
|
font.SetStyle(wxITALIC) |
|
|
self.SetItemFont(id, font) |
|
372 |
|
|
373 |
self.layer2id[l] = id |
self.layer2id[l] = id |
374 |
|
|
388 |
|
|
389 |
shapeType = layer.ShapeType() |
shapeType = layer.ShapeType() |
390 |
|
|
391 |
|
show = layer.Visible() |
392 |
for g in clazz: |
for g in clazz: |
393 |
id = self.AppendItem(pid, g.GetDisplayText()) |
id = self.AppendItem(pid, g.GetDisplayText()) |
394 |
self.SetPyData(id, g) |
self.SetPyData(id, g) |
395 |
|
self.__SetVisibilityStyle(show, id) |
396 |
|
|
397 |
bmp = self.__BuildGroupImage(g, shapeType) |
bmp = self.__BuildGroupImage(g, shapeType) |
398 |
|
|
428 |
|
|
429 |
self.DeleteAllItems() |
self.DeleteAllItems() |
430 |
|
|
431 |
def __ShowHideHelper(self, show, id): |
def __SetVisibilityStyle(self, visible, id): |
432 |
font = self.GetItemFont(id) |
font = self.GetItemFont(id) |
433 |
|
|
434 |
if show: |
if visible: |
435 |
font.SetStyle(wxNORMAL) |
font.SetStyle(wxNORMAL) |
436 |
color = wxBLACK |
color = wxBLACK |
437 |
else: |
else: |
445 |
parent = self.layer2id[layer] |
parent = self.layer2id[layer] |
446 |
assert parent.IsOk() |
assert parent.IsOk() |
447 |
|
|
448 |
show = layer.Visible() |
visible = layer.Visible() |
|
|
|
449 |
|
|
450 |
self.__ShowHideHelper(show, parent) |
self.__SetVisibilityStyle(visible, parent) |
451 |
|
|
452 |
id, cookie = self.GetFirstChild(parent, 123) |
id, cookie = self.GetFirstChild(parent, 123) |
453 |
|
|
454 |
while id.IsOk(): |
while id.IsOk(): |
455 |
self.__ShowHideHelper(show, id) |
self.__SetVisibilityStyle(visible, id) |
456 |
id, cookie = self.GetNextChild(parent, cookie) |
id, cookie = self.GetNextChild(parent, cookie) |
457 |
|
|