/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
| 392 | /****************************************************************************************************/ |
| 393 | /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ |
| 394 | LRESULT CALLBACK G4UIWin32::MainWindowProc( |
| 395 | HWND aWindow, UINT aMessage, WPARAM wParam, LPARAM lParam) |
| 396 | { |
| 397 | switch (aMessage) { |
| 398 | case WM_CREATE: { |
| 399 | auto* This = (G4UIWin32*)tmpSession; |
| 400 | if (This != nullptr) { |
| 401 | if (! This->CreateComponents(aWindow)) { |
| 402 | MessageBoxA(aWindow, "Could not create components.", "Error", MB_OK | MB_ICONERROR); |
| 403 | return false; |
| 404 | } |
| 405 | } |
| 406 | } |
| 407 | return 0; |
| 408 | |
| 409 | case WM_SIZE: { |
| 410 | auto* This = (G4UIWin32*)::GetWindowLongPtr(aWindow, GWLP_USERDATA); |
| 411 | if (This != nullptr) { |
| 412 | if (! This->ResizeComponents(aWindow)) { |
| 413 | MessageBoxA(aWindow, "Could not resize components.", "Error", MB_OK | MB_ICONERROR); |
| 414 | return false; |
| 415 | } |
| 416 | } |
| 417 | } |
| 418 | return 0; |
| 419 | |
| 420 | case WM_CLOSE: |
| 421 | DestroyWindow(aWindow); |
| 422 | return 0; |
| 423 | |
| 424 | case WM_DESTROY: |
| 425 | PostQuitMessage(0); |
| 426 | return 0; |
| 427 | |
| 428 | case WM_SETFOCUS: { |
| 429 | auto* This = (G4UIWin32*)::GetWindowLongPtr(aWindow, GWLP_USERDATA); |
| 430 | if (This != nullptr) SetFocus(This->fHWndComboBox); |
| 431 | } |
| 432 | return 0; |
| 433 | |
| 434 | case WM_NOTIFY: { |
| 435 | auto* This = (G4UIWin32*)::GetWindowLongPtr(aWindow, GWLP_USERDATA); |
| 436 | if (This != nullptr) { |
| 437 | switch (((LPNMHDR)lParam)->code) { |
| 438 | // Tooltip for Toolbar |
| 439 | case TTN_NEEDTEXT: { |
| 440 | auto lpttt = (LPTOOLTIPTEXT)lParam; |
| 441 | lpttt->hinst = nullptr; |
| 442 | UINT idButton = lpttt->hdr.idFrom; |
| 443 | lpttt->lpszText = (PTSTR)This->GetToolTips(idButton).c_str(); |
| 444 | } break; |
| 445 | |
| 446 | // Tooltip for TreeView |
| 447 | case TVN_GETINFOTIP: { |
| 448 | auto pTip = (LPNMTVGETINFOTIP)lParam; |
| 449 | pTip->pszText = (PTSTR)This->GetHelpTreeToolTips(pTip->hItem).c_str(); |
| 450 | } break; |
| 451 |
nothing calls this directly
no test coverage detected