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

Method EvMouseMove

roomedit/source/editcli.cpp:1157–1320  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////// TEditorClient ------------- Mouse MOVE: - Draw mouse pointer coord. - Either - Draw dragging objects OR Draw stretch selection box OR Highlight pointed object (and set it to new current object), only if CTRL key not pressed

Source from the content-addressed store, hash-verified

1155// if CTRL key not pressed
1156//
1157void TEditorClient::EvMouseMove (UINT modKeys, const TPoint& point)
1158{
1159 TLayoutWindow::EvMouseMove(modKeys, point);
1160
1161 if ( PointerX != point.x || PointerY != point.y )
1162 {
1163 // Display mouse coord. in MAP coord.
1164 TClientDC dc (Handle);
1165 DrawMouseCoord (dc);
1166 }
1167
1168 // Space+drag panning
1169 if (SpacePanning && SpaceDragging)
1170 {
1171 long dx = point.x - PanLastX;
1172 long dy = point.y - PanLastY;
1173 OrigX -= (SHORT)(dx * DIV_SCALE);
1174 OrigY += (SHORT)(dy * DIV_SCALE);
1175 PanLastX = point.x;
1176 PanLastY = point.y;
1177 AdjustScroller();
1178 RefreshWindows();
1179 PointerX = point.x;
1180 PointerY = point.y;
1181 return;
1182 }
1183
1184 PointerX = point.x;
1185 PointerY = point.y;
1186
1187 // If Inserting object, don't do anything
1188 if ( InsertingObject )
1189 {
1190 // Maybe we should draw the object(s) ?
1191 }
1192 // If stretching selection box
1193 else if (StretchSelBox)
1194 {
1195 SHORT x = MAPX(PointerX);
1196 SHORT y = MAPY(PointerY);
1197 TMapDC dc (this);
1198
1199 if ( !StretchMoved )
1200 StretchMoved = TRUE;
1201 else
1202 // Delete old selection box
1203 DrawStretchSelBox (dc);
1204
1205 // Draw new selection box
1206 OldSelBoxX = x;
1207 OldSelBoxY = y;
1208 DrawStretchSelBox (dc);
1209 }
1210
1211 // If dragging object
1212 else if (DragObject)
1213 {
1214 TMapDC dc (this);

Callers

nothing calls this directly

Calls 9

StartUndoRecordingFunction · 0.85
HighlightObjectFunction · 0.85
HighlightSelectionFunction · 0.85
MoveObjectsToCoordsFunction · 0.85
UnSelectObjectFunction · 0.85
SelectObjectFunction · 0.85
GetCurObjectFunction · 0.85
PlaySoundFunction · 0.85
IsSelectedFunction · 0.70

Tested by

no test coverage detected