Hey Mayca
I'm not quite sure I understand what you are trying to achieve.
Are you trying to control if the drawn polygon can overlap an existing polygon or if it should get erased by potential overlapping polygons?
In DrawTools, I have tools that add area to an existing polygon or remove area from an existing polygon. Maybe this can be helpful to see the code of these?
Look for the Sub DTRegionAdd and Sub DTRegionRemove in the DrawTools.mb.
Or is the question more about adding a toggle button to the ribbon that controls how your tool behaves?
In the WindowHelper tool, I add a button to the ribbon and make it a togglebutton: Call RBNControlToggleIdx(nCtrlIdx, TRUE)
nCtrlIdx = RBNGroupAddButton("btnSelInfoHandler", "Show Info", "", sTabName, sGroupName)
If nCtrlIdx > 0 Then
Call SELINFOSetControlIndex(nCtrlIdx)
Call RBNControlToggleIdx(nCtrlIdx, TRUE) 'This what makes the button a togglebutton
Call RBNControlSetToolTipIdx(nCtrlIdx, PRGIGetApplicationName(), "Enable/disable Show Info", "")
Call RBNControlSetIconsIdx(nCtrlIdx, CONTROL_SIZE_SMALL, "", PATH_IMAGES & "InfoSelHandler_32x32.png")
Call RBNControlSetCustomMBXHandlerIdx(nCtrlIdx, "SELINFOSwitchDisplay")
End If
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------