Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

Override draw circle selection

This is a discussion on Override draw circle selection within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, i wont something simple.. i dont want to load the drawing toolbar on my OCX... but i wont to ...

  1. #1
    Gianmaria is offline Member Yellow Belt
    Join Date
    Dec 2004
    Posts
    47

    Exclamation Override draw circle selection

    Hi,
    i wont something simple.. i dont want to load the drawing toolbar on my OCX... but i wont to use a button instead on my form. It's ok if the underling logic remain the same.. same event and so on... simply.. i wont that a user press my button it's like he pressed the draw circle button on the toolbar.

    I use this handler for th event:

    private void axMappointControl1_SelectionChange(object sender, AxMapPoint._IMappointCtrlEvents_SelectionChangeEve nt e)
    {

    object o = e.pNewSelection;

    MapPoint.Shape s = (MapPoint.Shape)e.pNewSelection;

    if (s.AutoShapeType == MapPoint.GeoAutoShapeType.geoShapeRadius)
    {}
    }

    is it possible???

    regards..
    Gianmaria

  2. #2
    Gianmaria is offline Member Yellow Belt
    Join Date
    Dec 2004
    Posts
    47
    Anything in the hidden features of Mappoint ocx?

  3. #3
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    To do exacly same behavour is not an easy task, but I think you can do it simple if behavour is a little different. Let's think:

    - User click your button, then he have to click on the map where he want the center of the shape.
    - User move mouse away, shape will redraw automatically to the place where the mouse is.
    - User click again, and the drawing stops.

    I think this is acceptable procedure. Other approach could be drawing as long as mouse button is down, or whatever. Anyway if this kind is good for you then you can do following:

    - In the button click you set a global bool drawingCircle = true;
    - In the beforeClick you check drawingCircle, and if true you create the shape with diameter of 0. the Shape variable has to be global to the class of course.
    - In mouseMove you check drawingCircle and calculate the distance to the center of the shape. If you have the distance then re set the diameter.
    - In beforeClick you stop drawing.

    It is not complete, you have to make the difference to the 2 beforeClicks, but It should give an idea I hope. What do you think ?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Radius of a Circle
    By Gianmaria in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-14-2006, 02:32 PM
  2. How to draw radius circle of a specific altitude...
    By Learner in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 03-24-2006, 05:17 AM
  3. Override a route
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-14-2005, 06:56 AM
  4. Override Mp 2004 Contextual menus with VB .Net 2003
    By tardifj in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-29-2004, 10:42 PM
  5. How do I draw a circle, rectangle, ellipse or free....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-26-2000, 01:35 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96