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

Method TextareaProc

GUI/RichTextarea.cpp:2387–2541  ·  view source on GitHub ↗

Textarea message handler

Source from the content-addressed store, hash-verified

2385
2386// Textarea message handler
2387LRESULT CALLBACK RichTextarea::TextareaProc(HWND hWnd, unsigned int message, WPARAM wParam, LPARAM lParam)
2388{
2389 static int lastX, lastY;
2390
2391 TextareaData *data = GetData(hWnd);
2392
2393 __try
2394 {
2395 switch(message)
2396 {
2397 case WM_CREATE:
2398 OnCreate(hWnd);
2399 break;
2400 case WM_DESTROY:
2401 OnDestroy(hWnd);
2402 break;
2403 case WM_ERASEBKGND:
2404 break;
2405 case WM_PAINT:
2406 data->OnPaint();
2407 break;
2408 case WM_KILLFOCUS:
2409 ibarState = 0;
2410 RichTextarea::AreaCursorUpdate(hWnd, 0, NULL, 0);
2411 break;
2412 case WM_SIZE:
2413 data->OnSize(LOWORD(lParam), HIWORD(lParam));
2414 break;
2415 case WM_MOUSEACTIVATE:
2416 SetFocus(hWnd);
2417 EnableWindow(hWnd, true);
2418 break;
2419 case WM_CHAR:
2420 data->OnCharacter((char)(wParam & 0xFF));
2421 break;
2422 case WM_KEYDOWN:
2423 if(wParam == VK_CONTROL || wParam == VK_SHIFT)
2424 break;
2425 data->OnKeyEvent((int)wParam);
2426 break;
2427 case WM_LBUTTONDBLCLK:
2428 data->OnLeftMouseDoubleclick(LOWORD(lParam), HIWORD(lParam));
2429 break;
2430 case WM_LBUTTONDOWN:
2431 lastX = LOWORD(lParam);
2432 lastY = HIWORD(lParam);
2433
2434 data->OnLeftMouseDown(LOWORD(lParam), HIWORD(lParam));
2435 break;
2436 case WM_MOUSEMOVE:
2437 // If mouse is in the tooltip area
2438 if(LOWORD(lParam) < RichTextarea::toolSize)
2439 {
2440 unsigned int blankX, blankY;
2441 AreaLine *cLine = data->ClientToCursor(LOWORD(lParam), HIWORD(lParam), blankX, blankY, true);
2442 data->toolInfo.lpszText = lStyle[cLine->lineStyle].tooltip;
2443 SendMessage(data->toolTip, TTM_SETTOOLINFO, 0, (LPARAM)&data->toolInfo);
2444 }

Callers

nothing calls this directly

Calls 15

assertFunction · 0.85
OnPaintMethod · 0.80
OnSizeMethod · 0.80
OnCharacterMethod · 0.80
OnKeyEventMethod · 0.80
OnLeftMouseDownMethod · 0.80
ClientToCursorMethod · 0.80
OnMouseMoveMethod · 0.80
OnRightMouseDownMethod · 0.80
ClampShiftMethod · 0.80
UpdateScrollBarMethod · 0.80

Tested by

no test coverage detected