MAPX VC Custom Rotating Tool (POLYTOOLUSED Event)

zhaozj2021-02-16  56

[Function]: MAPX VC Custom Ranging Tool (POLYTOOLUSED Event) [Environment]: VC6 MAPX4.5 Win2000 [Original]: www.51gis.com//1. Define constants #define mytool_distance 100 // 1 ~ 999 // 2 creation tools m_ctrlMap.CreateCustomTool (MYTOOL_DISTANCE, miToolTypePoly, miCrossCursor);. // 3 in response to events void CMapXSampleView :: OnPolyToolUsedMap (short ToolNum, long Flags, LPDISPATCH Points, BOOL bShift, BOOL bCtrl, BOOL FAR * EnableDefault) {// Calculating distance if (flags == mipolytoolinprogress) {// This sentence can have no IF (toolnum == mytool_distance) {cmapxpoints PTS; long N; long i; try {pts.attachdispatch (Points, False); / / GET POINTS Objectdouble DdistanceTot = 0.0; N = Pts.getCount (); for (i = 1; i m_wndstatus bar.setpanetExt (0, str);} catch (ColedispatChexception * e) {e-> ReportError (); E -> delete ();} catch (ColeException * e) {E-> ReportError (); e-> delete ();}}} // if (flags == MipolyToolInProgres S)} // 4. Call Tool Void CMAPXSampleView :: OnMaptoolDistanceTool () {m_ctrlmapx.setcurrenttool (MyTool_Distance); //}

================== MapX expert forum (www.51gis.com) ==============================================================================================================================================

转载请注明原文地址:https://www.9cbs.com/read-21855.html

New Post(0)