MCPcopy Create free account
hub / github.com/WheretIB/nullc / OnRightMouseDown

Method OnRightMouseDown

GUI/RichTextarea.cpp:2333–2355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2331}
2332
2333void TextareaData::OnRightMouseDown(unsigned int x, unsigned int y)
2334{
2335 POINT coords;
2336 coords.x = x;
2337 coords.y = y;
2338 ClientToScreen(areaWnd, &coords);
2339
2340 if(!selectionOn)
2341 {
2342 RichTextarea::AreaCursorUpdate(areaWnd, 0, NULL, 0);
2343 // Reset I-bar tick count
2344 ibarState = 0;
2345 currLine = ClientToCursor(x, y, dragStartX, dragStartY, true);
2346 cursorCharX = dragStartX;
2347 cursorCharY = dragStartY;
2348 }
2349
2350 HMENU contextMenu = CreatePopupMenu();
2351 InsertMenu(contextMenu, 0, MF_BYPOSITION | MF_STRING, RichTextarea::CONTEXT_CUT, "Cut");
2352 InsertMenu(contextMenu, 1, MF_BYPOSITION | MF_STRING, RichTextarea::CONTEXT_COPY, "Copy");
2353 InsertMenu(contextMenu, 2, MF_BYPOSITION | MF_STRING, RichTextarea::CONTEXT_PASTE, "Paste");
2354 TrackPopupMenu(contextMenu, TPM_TOPALIGN | TPM_LEFTALIGN, coords.x, coords.y, 0, areaWnd, NULL);
2355}
2356
2357// This function register RichTextarea window class, so it can be created with CreateWindow call in client application
2358// Because there is global state for this control, only one instance can be created.

Callers 1

TextareaProcMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected