Event "New polygon created"

11 views
Skip to first unread message

esrispy

unread,
Feb 6, 2008, 11:00:01 AM2/6/08
to MapInfo-L
How can you fire a dialog after digitizing a new polygon?

After a double click or snapped to at the start node so a new polygon
is created i want to prompt the user with a dialog "Select Type of
surface"

Spencer Simpson

unread,
Feb 6, 2008, 1:19:56 PM2/6/08
to mapi...@googlegroups.com
You create your own custom tool that uses DrawMode DM_CUSTOM_POLYGON. You
then call CommandInfo (CMD_INFO_CUSTOM_OBJ) in the tool's handler procedure
to get the object that was drawn, then prompt for the attributes you want to
prompt for. If the user clicks OK on the dialog, the tool handler routine
then has to insert the new record.

HTH

________________________________

Spencer M. Simpson, Jr.
Information Technology Coordinator
Baltimore Metropolitan Council
http://www.baltometro.org

Confidentiality Statement

This electronic mail transmission contains confidential information
belonging to the sender which is legally privileged and confidential. The
information is intended only for the use of the individual or entity named
above. If you are not the intended recipient, you are hereby notified that
any disclosure, copying, distribution, or taking of any action based on the
contents of this electronic mail transmission is strictly prohibited. If you
have received this electronic mail transmission in error, please immediately
notify the sender.

Spencer Simpson

unread,
Feb 6, 2008, 1:48:21 PM2/6/08
to mapi...@googlegroups.com
For a little more clarity I suppose I should say:

-1. You create your own custom tool that uses DrawMode DM_CUSTOM_POLYGON.

-2. The user selects your polygon-drawing tool, not MapInfo's built-in one
(you'll have to hide it), and draws a polygon. This invokes the tool
handler procedure you wrote.

-3. Your tool handler procedure:
--a. calls CommandInfo (CMD_INFO_CUSTOM_OBJ) to get the object that was
drawn
--b. displays a dialog you created to prompt for the attributes you want.
--c. The user fills in the requested information (or not) and clicks OK or
Cancel. This returns control to your tool handler procedure.
--d. If the user clicks OK on the dialog, the tool handler routine
then has to insert the new record along with the new object.

________________________________

Lawley, Russell S

unread,
Feb 6, 2008, 5:57:02 PM2/6/08
to mapi...@googlegroups.com
Esrispy,
there is code included in this app that does similar to what you want and you can hack it around...a lot of the app you probably wont need, but it was designed to be a generic-tool-for-preset-objstyles-and-data capture and it covers the basics of capture/populate/content predefinition and content transfer..its also as easy as it gets (in case your users are not carto/gis folk)

http://www.directionsmag.com/files/index.php/view/556

..health warning..it has a real doh! of a bug in it (look for a brit nat grig coordsys clause that shouldnt be there...take it out and the app will work with any projection..)

r

***************************************************************************************************************
This message (and any attachments) is for the recipient only. NERC is subject to the Freedom of Information Act 2000 and the contents of this email and any reply you make may be disclosed by NERC unless it is exempt from release under the Act. Any material supplied to NERC may be stored in an electronic records management system.
***************************************************************************************************************

winmail.dat
Reply all
Reply to author
Forward
0 new messages