更新时间:2023-11-26 08:31:04
使用OnMouseDown
事件可获取有关鼠标单击的通知.如果是TMouseButton.mbLeft
,请调用GetHitTestInfoAt()
,并检查THitInfo.HitPositions
中是否包含THitPositions.ctCheckBox
.如果是这样,THitInfo.HitNode
包含相应的节点.然后,您可能会显示确认对话框,并将结果保存到成员变量中,您可以在OnChecking事件中使用该变量来允许或禁止更改检查状态.
Use the OnMouseDown
event to get notified about a mouse click. If it's TMouseButton.mbLeft
call GetHitTestInfoAt()
and check if THitPositions.ctCheckBox
is included in THitInfo.HitPositions
. If so, THitInfo.HitNode
contains the corresponding node. You may then show the confirmation dialog and save the result in a member variable, that you can use in the OnChecking event to allow or disallow the change of the check state.