MCPcopy Create free account
hub / github.com/Meridian59/Meridian59 / EvRButtonDown

Method EvRButtonDown

roomedit/source/editcli.cpp:1610–1698  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////// TEditorClient -------------

Source from the content-addressed store, hash-verified

1608// -------------
1609//
1610void 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;

Callers

nothing calls this directly

Calls 7

GetCurObjectFunction · 0.85
HighlightObjectFunction · 0.85
GetApplicationFunction · 0.85
NotifyFunction · 0.85
GetSubMenuMethod · 0.80
IsOKMethod · 0.45
TrackPopupMenuMethod · 0.45

Tested by

no test coverage detected