您可以定义鼠标工具,然后从 MCG 工具的卷展栏调用这些工具。
为此,只需以常规方式定义鼠标工具,然后添加一个按钮在“自定义 UI”属性中调用即可。
例如:
-- Define mouse tool before it is called
tool myMouseCapture
(
on mousePoint click do
(
format "Captured click!!! % \n" click
)
--Right-Click to stop
)
rollout params "Parameters"
(
-- Restore the default rollout
<<ParamUIDefs>>
<<RolloutParamsHanders>>
-- Define button to start mouse tool
button ToolStart "Begin Mouse Capture" width:140
on ToolStart pressed do
(
startTool myMouseCapture
)
)