Hey Steve
If you want to copy the Zoom tool, you can mkáke your button call the Zoom tool directly.
If I remember correctly, you don't even have to specify a Cursor or DrawMode.
Toolbutton
HelpMsg "Zoom"
Calling 1705 'Define M_TOOLS_EXPAND 1705
icon 4
But maybe you want your tool to do more?
Cheers
Peter
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------
Original Message:
Sent: 01-15-2026 08:56
From: Steve Oram
Subject: Tool buttons on custom tabs
Hi,
I have created a custom tab group that recreates some regular tool buttons for ease of access, but when I use them I have to click on the map window twice to get them to activate. The map window is active and "front". I may not be recreating them in the best way. Any tips welcome.
For example, I replicate the Zoom tool like this:
Toolbutton
HelpMsg "Zoom"
Calling ZoomTool
Cursor 129
icon 4
Sub ZoomTool
Run Menu Command 1722 'Define M_TOOLS_SEARCH_RECT 1722
Run Menu Command 1705 'Define M_TOOLS_EXPAND 1705
End Sub
Other things I've tried
Set Window intWnd Front (at the top of the subroutine)
Run Menu Command 2951
Run Menu Command 2952
Run Menu Command M_LAYOUT_ZOOM_IN (etc.)
Similarly, I recreate the Draw Polygon tool:
Sub DrawTool
Run Menu Command 1714
End Sub
Thanks,
Steve
------------------------------
Steve Oram
Biodiversity Officer
PTES
London
------------------------------