//////////////////////////////////////////////////////////////// TEditorClient -------------
| 1608 | // ------------- |
| 1609 | // |
| 1610 | void TEditorClient::EvRButtonDown (UINT modKeys, const TPoint& point) |
| 1611 | { |
| 1612 | // Ignore if "insert object" mode |
| 1613 | if ( InsertingObject ) |
| 1614 | return; |
| 1615 | |
| 1616 | TLayoutWindow::EvRButtonDown(modKeys, point); |
| 1617 | |
| 1618 | // If SHIFT + RIGHT mouse button: center map |
| 1619 | if ( modKeys & MK_SHIFT) |
| 1620 | { |
| 1621 | // Center map around the selected pointer map. coord |
| 1622 | CenterMapAroundCoords (MAPX(point.x), MAPY(point.y)); |
| 1623 | |
| 1624 | Invalidate() ; // Redraw map |
| 1625 | AdjustScroller(); // Adjust scroller units |
| 1626 | return; |
| 1627 | } |
| 1628 | |
| 1629 | // If Right mouse button, display popup menu |
| 1630 | SHORT PointerObject; |
| 1631 | PointerObject = GetCurObject (EditMode, |
| 1632 | MAPX(point.x - 4), MAPY(point.y - 4), |
| 1633 | MAPX(point.x + 4), MAPY(point.y + 4)); |
| 1634 | |
| 1635 | TResId MenuResID; |
| 1636 | |
| 1637 | // If not on an object, select general popup menu |
| 1638 | if ( PointerObject < 0 ) |
| 1639 | { |
| 1640 | MenuResID = MENU_OBJECTS; |
| 1641 | } |
| 1642 | // If on an object, select sensitive popup menu |
| 1643 | else |
| 1644 | { |
| 1645 | // Not realy useful, but to be sure |
| 1646 | if ( CurObject != PointerObject ) |
| 1647 | { |
| 1648 | TRACE ("CurObject != PointerObject: strange happening"); |
| 1649 | TMapDC dc(this); |
| 1650 | HighlightObject (dc, EditMode, CurObject, HL_COLOR); |
| 1651 | CurObject = PointerObject; |
| 1652 | HighlightObject (dc, EditMode, CurObject, HL_COLOR); |
| 1653 | DisplayObjectInfo (EditMode, CurObject); |
| 1654 | } |
| 1655 | assert (PointerObject == CurObject); |
| 1656 | |
| 1657 | switch ( EditMode ) |
| 1658 | { |
| 1659 | case OBJ_THINGS: |
| 1660 | MenuResID = MENU_THINGS; |
| 1661 | break; |
| 1662 | case OBJ_LINEDEFS: |
| 1663 | MenuResID = MENU_LINEDEFS; |
| 1664 | break; |
| 1665 | case OBJ_VERTEXES: |
| 1666 | MenuResID = MENU_VERTEXES; |
| 1667 | break; |
nothing calls this directly
no test coverage detected