Manipulator: modal callback can now cancel & pass events

Re-use operator return flags for manipulator modal & invoke,
this means manipulators can allow navigation or other events to be
handled as they run - see T52499
This commit is contained in:
Campbell Barton
2017-08-24 17:04:28 +10:00
parent 134e927965
commit e20c825b05
15 changed files with 107 additions and 57 deletions

View File

@@ -93,6 +93,7 @@ class MyCustomShapeWidget(Manipulator):
def invoke(self, context, event):
self.init_mouse_y = event.mouse_y
self.init_value = self.target_get_value("offset")
return {'RUNNING_MODAL'}
def exit(self, context, cancel):
context.area.header_text_set()
@@ -108,6 +109,7 @@ class MyCustomShapeWidget(Manipulator):
value = self.init_value + delta
self.target_set_value("offset", value)
context.area.header_text_set("My Manipulator: %.4f" % value)
return {'RUNNING_MODAL'}
class MyCustomShapeWidgetGroup(ManipulatorGroup):