Added support undo selection in new LE

This commit is contained in:
Gyedo Jeon 2010-02-06 02:23:50 +00:00
parent 1438fa0078
commit c3b70b120d

View File

@ -141,8 +141,10 @@ class DirectSession(DirectObject):
self.actionEvents = [
['select', self.select],
['DIRECT-select', self.selectCB],
['deselect', self.deselect],
['deselectAll', self.deselectAll],
['DIRECT-preDeselectAll', self.deselectAllCB],
['highlightAll', self.selected.highlightAll],
['preRemoveNodePath', self.deselect],
# Scene graph explorer functions
@ -651,7 +653,11 @@ class DirectSession(DirectObject):
return Task.cont
def select(self, nodePath, fMultiSelect = 0,
fSelectTag = 1, fResetAncestry = 1, fLEPane = 0):
fSelectTag = 1, fResetAncestry = 1, fLEPane=0, fUndo=1):
messenger.send('DIRECT-select', [nodePath, fMultiSelect, fSelectTag, fResetAncestry, fLEPane, fUndo])
def selectCB(self, nodePath, fMultiSelect = 0,
fSelectTag = 1, fResetAncestry = 1, fLEPane = 0, fUndo=1):
dnp = self.selected.select(nodePath, fMultiSelect, fSelectTag)
if dnp:
messenger.send('DIRECT_preSelectNodePath', [dnp])
@ -725,6 +731,9 @@ class DirectSession(DirectObject):
messenger.send('DIRECT_deselectedNodePath', [dnp])
def deselectAll(self):
messenger.send('DIRECT-preDeselectAll')
def deselectAllCB(self):
self.selected.deselectAll()
# Hide the manipulation widget
if self.manipulationControl.fMultiView: