Quote:
Originally Posted by Marvin Hlavac
Hey Toni (a.k.a. Neludok),
It's great to see you here! It's been a long time! I'm glad you are still around!
I'm not sure about the hotkey to place a pushpin on the map. I agree it would be a very helpful feature, but even though I've on several occasions thought about it, I just simply don't know a good way of implementing it. I think it would be easily doable in MapPoint, which is programmable, but it is more complicated in AutoRoute and/or Streets & Trips :-(
Not too sure about writing the coding part in autoit but how about this idea for a pushpin hot key?
i) Ensure "keep position centered" is actived (optional if run speed allows it, if not people could activate it manually when they start S&T)
ii) Ensure the Draw toolbar is open. (optional if run speed allows it)
iii) controlclick on "create pushpin" button in the draw toolbar
iv) focus on the map pane
v) control click in the map pane (default is center for x and y coordinates)
In theory, I think that should insert a pushpin at the center of the map pane. If the GPS position is centered in the map, that should create a pushpin at the desired location. What do you think? You have much more experience in this.
Edit:
Did some testing with the draw toolbar open. This code inserts a pushpin in the center of the map pane in my 2006 version where
$createpushpin = 58202
$AfxControlbar702 = 59422
Func create_pushpin()
ControlFocus($productname, "", $AfxControlbar702) ;maybe repeat this line twice for increased reliability.
Sleep(100)
ControlClick($productname, "", $createpushpin)
Sleep(100)
ControlFocus($productname, "", "AfxWnd702") ;maybe repeat this line twice for increased reliability.
Sleep(100)
ControlClick($productname, "", "AfxWnd702")
Sleep(100)
EndFunc
I assigned it F10 temporarily to test. (F10 is assigned to Find nearby places in the 2006 version). If a user keeps the draw toolbar open and Keep position centered, this code might work. Sleep time will have to be adjusted and field testing done. If it's too slow to respond, the pushpin will be off by several meters at 50 km/hr. I noticed the mouse pointer has to be over any point in the map pane for it to click reliably in the center.