Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all articles
Browse latest Browse all 2341

New Post: problem with ShowDialog()

$
0
0
Tristan--"possibleMouseClick" is the flag I was talking about. Someone else probably has a more elegant solution but this works great for me. --Don
    public static void Map_MouseDownEvent(object sender, _DMapEvents_MouseDownEvent e) {
        // Only process if in select mode
        if (mouseMode != MouseModes.Select) return;

        if (e.button == 2) {
            MouseDownRight(e.x, e.y);
        }
        else {
            possibleMouseClick = true;
        }
    }

    public static void Map_MouseUpEvent(object sender, _DMapEvents_MouseUpEvent e) {
        if (mouseMode != MouseModes.Select) return;

        if (possibleMouseClick) {//no movement since mouse down is a click
            MouseClick();
            possibleMouseClick = false;
        }
    }

    public static void Map_MouseMoveEvent(object sender, _DMapEvents_MouseMoveEvent e) {
        // Moving mouse cancels possible click
        if (e.button == 0) { //no button means can't be dragging
            IsDragging = false;
        }
        if (mouseMode != MouseModes.Pan && !IsDragging) {  //mouse ignored if in pan or dragging (i.e., selection box) mode
            previousMousePositionX = e.x;
            previousMousePositionY = e.y;
            possibleMouseClick = false;
            AppController.NotifyMouseOrGpsPositionUpdate(Globals.Globals.PositionUpdateEventSource.Mouse, e.x, e.y);
        }
    }

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>