| 2331 | } |
| 2332 | |
| 2333 | void 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. |