MCPcopy Create free account
hub / github.com/beefytech/Beef / WindowProc

Method WindowProc

BeefySysLib/platform/win/WinBFApp.cpp:504–1219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504LRESULT WinBFWindow::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
505{
506 WinBFApp* app = (WinBFApp*) gBFApp;
507
508 if (app == NULL)
509 {
510 PrintStuff();
511 }
512
513 switch (uMsg)
514 {
515 case WM_KEYDOWN:
516 case WM_KEYUP:
517 case WM_SYSKEYDOWN:
518 case WM_CHAR:
519 for (auto child : mChildren)
520 {
521 auto childWindow = (WinBFWindow*)child;
522 if ((childWindow->mSoftHasFocus) && (childWindow->mFlags & BFWINDOW_FAKEFOCUS))
523 {
524 return childWindow->WindowProc(hWnd, uMsg, wParam, lParam);
525 }
526 }
527 break;
528 }
529
530 switch (uMsg)
531 {
532 case WM_CLOSE:
533 {
534 //OutputDebugStrF("WM_CLOSE %08X NewFocus:%08X\n", hWnd, GetFocus());
535
536 if (mCloseQueryFunc(this) != 0)
537 gBFApp->RemoveWindow(this);
538 HWND newFocus = GetFocus();
539 for (auto window : gBFApp->mWindowList)
540 {
541 WinBFWindow* winWindow = (WinBFWindow*)window;
542 if (winWindow->mHWnd == newFocus)
543 {
544 while (true)
545 {
546 WinBFWindow* altFocusWindow = NULL;
547 for (auto checkChild : winWindow->mChildren)
548 {
549 auto checkWinChild = (WinBFWindow*)checkChild;
550 if (checkWinChild->mFlags & BFWINDOW_FAKEFOCUS)
551 altFocusWindow = checkWinChild;
552 }
553 if (altFocusWindow == NULL)
554 break;
555 winWindow = altFocusWindow;
556 }
557
558 winWindow->mHasFocus = true;
559 winWindow->mSoftHasFocus = true;
560 winWindow->mGotFocusFunc(winWindow);
561 }

Callers 1

WindowProcStubMethod · 0.80

Calls 10

PrintStuffFunction · 0.85
KeyboardLayoutHasAltGrFunction · 0.85
RemoveWindowMethod · 0.80
IsEmptyMethod · 0.45
ResizedMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
ProcessMethod · 0.45
PhysSetCursorMethod · 0.45

Tested by

no test coverage detected