/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
| 671 | /****************************************************************************************************/ |
| 672 | /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ |
| 673 | G4bool G4UIWin32::ResizeComponents(HWND aWindow) |
| 674 | { |
| 675 | RECT rcTool; |
| 676 | G4int iToolHeight, iToolWidth; |
| 677 | |
| 678 | RECT rcStatus; |
| 679 | G4int iStatusHeight; |
| 680 | |
| 681 | RECT rcComboBox; |
| 682 | G4int iComboBoxHeight; |
| 683 | |
| 684 | G4int iTreeViewHeight, iTreeViewWidth; |
| 685 | G4int iEditHeight, iEditWidth; |
| 686 | |
| 687 | RECT rcClient; |
| 688 | |
| 689 | // Size toolbar and get height and width |
| 690 | SendMessage(fHWndToolBar, TB_AUTOSIZE, 0, 0); |
| 691 | |
| 692 | GetWindowRect(fHWndToolBar, &rcTool); |
| 693 | iToolHeight = rcTool.bottom - rcTool.top; |
| 694 | iToolWidth = rcTool.right - rcTool.left; |
| 695 | |
| 696 | // Size status bar and get height |
| 697 | SendMessage(fHWndStatus, WM_SIZE, 0, 0); |
| 698 | |
| 699 | GetWindowRect(fHWndStatus, &rcStatus); |
| 700 | iStatusHeight = rcStatus.bottom - rcStatus.top; |
| 701 | |
| 702 | // Size status the Combo Box and get height |
| 703 | SendMessage(fHWndComboBox, WM_SIZE, 0, 0); |
| 704 | |
| 705 | GetWindowRect(fHWndComboBox, &rcComboBox); |
| 706 | iComboBoxHeight = rcComboBox.bottom - rcComboBox.top; |
| 707 | |
| 708 | // Calculate remaining height and size edit |
| 709 | GetClientRect(aWindow, &rcClient); |
| 710 | |
| 711 | iTreeViewHeight = rcClient.bottom - iToolHeight - iStatusHeight; |
| 712 | iTreeViewWidth = iToolWidth / 4; |
| 713 | |
| 714 | iEditHeight = rcClient.bottom - iToolHeight - iComboBoxHeight - iStatusHeight; |
| 715 | iEditWidth = iToolWidth - iTreeViewWidth; |
| 716 | |
| 717 | // TreeView location and size |
| 718 | SetWindowPos( |
| 719 | fHWndHelpTree, nullptr, 0, iToolHeight, iTreeViewWidth, iTreeViewHeight, SWP_NOZORDER); |
| 720 | |
| 721 | // Editor location and size |
| 722 | SetWindowPos( |
| 723 | fHWndEditor, nullptr, iTreeViewWidth, iToolHeight, iEditWidth, iEditHeight, SWP_NOZORDER); |
| 724 | |
| 725 | // ComboBox location and size |
| 726 | SetWindowPos( |
| 727 | fHWndComboBox, nullptr, iTreeViewWidth, iToolHeight + iEditHeight, iEditWidth, 200, 0); |
| 728 | |
| 729 | return true; |
| 730 | } |