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
Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

What causes the MapPoint Control to stop scrolling?

This is a discussion on What causes the MapPoint Control to stop scrolling? within the Development forums, part of the MapPoint Desktop Discussion category; Originally Posted by Wilfried MousePointer property seems not to change when the bitmap changes to the Pan arrow. As for ...

  1. #11
    MarcoK is offline Junior Member White Belt
    Join Date
    Aug 2007
    Posts
    7

    Re: What causes the MapPoint Control to stop scrolling?

    Quote Originally Posted by Wilfried View Post
    MousePointer property seems not to change when the bitmap changes to the Pan arrow. As for the custom code it is not too hard. Only some code to change mousepointer depending where it is on the panel, and on mouse key down creation of a timer that excutes a Pan method every few milliseconds. Destroy timer in onMouseUp.
    I managed to detect the cursor changed by using API hooking.
    However, properly reacting isn't exactly easy, either.
    It's similar to an entirely custom handling like the one you describe.
    Sure, I can do that. However, the actual behavior of the control is much more complex. The map moves faster the closer I draw to the edges.
    And slower again if I move back to the center.
    I can actually "fly" across the map by just keeping the mousekey down and moving the cursor around.
    Replicating this isn't as trivial as making a simple pan.

    Which is why I was hoping to resolve the stuttering in the control itself, but appearently, it's not possible.
    At least nobody here seems to know how to pull it off.
    ______
    MarcoK

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

    Re: What causes the MapPoint Control to stop scrolling?

    Hi,

    You have to make code that calculate where you are. For example if you go near top or bottom on the left or right you have to change already from eg E to NE (and same for the others. Using a transparant panel it is very easy. So you also could change the incrementing of the pan in 2 or 3 steps.

  3. #13
    MarcoK is offline Junior Member White Belt
    Join Date
    Aug 2007
    Posts
    7

    Re: What causes the MapPoint Control to stop scrolling?

    Well, like I wrote, it IS possible, just not really THAT simple.
    As you appearently have done this before ... any idea how I can pass a mouseclick event through to the control?
    Or, alternatively, how I can disable the stock arrows (so they don't appear under any cicrumstances)?

    Thanks for your help.
    ______
    MarcoK

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

    Re: What causes the MapPoint Control to stop scrolling?

    Hi,

    I think I not made it clear, sorry for that. I try again

    As soon as you have dropped a (transparant) panel (4 of them, top, left, bottom, right) on the control (and anchored it), then from the moment the mouse hoover over it the Mappoint control will not receive OnMouseMove messages. Because it is not received the cursor is not changing, but the default cursor of the panel will display. This means that the arrows will never display and you can do your own arrows and also handling of the pan.

    You panels will now receive all the mouse events, not MP control anymore. So you give each panel 3 cursors (eventually a copy of the original captured with a print_screen and put in a bitmap. In OnMouseMove of the panel you check where the pointer is and display the right cursor.

    In OnMouseDown you start pan the map, but not with passing mouse events trough it, but using the Pan method and a Timer. Direction of the pan is depending the mouse position, eventually the increment also.

    In OnMouseUp you disable the timer.

    Is this more make sense ?

  5. #15
    MarcoK is offline Junior Member White Belt
    Join Date
    Aug 2007
    Posts
    7

    Re: What causes the MapPoint Control to stop scrolling?

    Heh, no worries Wilfried, I DID understand it like that and have already implemented the foundation of this behavior, down to the timer.
    I actually used a single custom transparent panel (a standard panel with bgcolor set to transparent didn't work, it wouldn't actually be transparent for some reason) and changed the mouse cursor depending on the position. Works like a charm. I still have to implement some of the advanced stuff (moving faster when closer to the edge etc.), but it already works in a basic fashion.

    My question was aimed at the fact that I wouldn't like to replicate all the rest of MapPoints behavior, nor would I want to entirely forsake it.
    I found that you can disable the stock arrows by setting AllowEdgePan to false.
    This allowed me to have another "mode" in the map for dragging the map along with a hand-cursor - in this case the MP control never "hangs".
    For this purpose I just remove the panel from the container, reAdding it when I go into arrow-mode again.

    Now the only thing I dislike is that, for some odd reason, disabling AllowEdgePan also disabled the ability to draw rectangles for zooming into them. But maybe there's another property controlling this I have overlooked so far.

    Other than that, my map basically now works as I intended.
    I still feel it would've been much easier and better if the control didn't cause this stuttering in the first place (shame on you Microsoft), but I'll get along with what I have.

    Thanks for your help and input.
    _______
    MarcoK

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

    Re: What causes the MapPoint Control to stop scrolling?

    Hi,

    Just tryed to disable AllowEdgePan. But I have still the ability to draw rectangles for zooming into them. So something else must wrong. I don't know what but a combination of properties maybe ? Try to experiment a little with it. I disabled it after opening a map.

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Re: Keyboard control in mappoint activex control
    By djcapslock in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-10-2005, 11:16 AM
  2. Stop User from exiting
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-02-2004, 10:37 AM
  3. How to stop MapPoint from selecting a wrong address?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-09-2004, 09:03 AM
  4. Need help with map scrolling arrows please!
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 09-09-2003, 11:29 AM
  5. Map scrolling
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 07-28-2003, 04:27 AM

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