| 644 | } |
| 645 | |
| 646 | void NSFTrackDialog::OnSizing(UINT fwSide, LPRECT pRect) |
| 647 | { |
| 648 | __super::OnSizing(fwSide, pRect); |
| 649 | |
| 650 | CRect rect, rect2; |
| 651 | GetClientRect(&rect); |
| 652 | GetWindowRect(&rect2); |
| 653 | int min_height = rect2.Height()-rect.Height(); |
| 654 | int min_width = rect2.Width()-rect.Width(); |
| 655 | int max_width = rect2.Width()-rect.Width(); |
| 656 | m_keydlg.GetWindowRect(&rect); |
| 657 | min_height += rect.Height(); |
| 658 | min_width += m_keydlg.MinWidth(); |
| 659 | max_width += m_keydlg.MaxWidth(); |
| 660 | |
| 661 | |
| 662 | switch(fwSide) |
| 663 | { |
| 664 | case WMSZ_LEFT: |
| 665 | case WMSZ_TOPLEFT: |
| 666 | case WMSZ_BOTTOMLEFT: |
| 667 | if(pRect->bottom-pRect->top < min_height) |
| 668 | pRect->top = pRect->bottom - min_height; |
| 669 | if(pRect->right-pRect->left < min_width) |
| 670 | pRect->left = pRect->right - min_width; |
| 671 | if(pRect->right-pRect->left > max_width) |
| 672 | pRect->left = pRect->right - max_width; |
| 673 | break; |
| 674 | case WMSZ_RIGHT: |
| 675 | case WMSZ_TOPRIGHT: |
| 676 | case WMSZ_BOTTOMRIGHT: |
| 677 | if(pRect->bottom-pRect->top < min_height) |
| 678 | pRect->bottom = pRect->top + min_height; |
| 679 | if(pRect->right-pRect->left < min_width) |
| 680 | pRect->right = pRect->left + min_width; |
| 681 | if(pRect->right-pRect->left > max_width) |
| 682 | pRect->right = pRect->left + max_width; |
| 683 | break; |
| 684 | |
| 685 | case WMSZ_TOP: |
| 686 | if(pRect->bottom-pRect->top < min_height) |
| 687 | pRect->top = pRect->bottom - min_height; |
| 688 | break; |
| 689 | |
| 690 | case WMSZ_BOTTOM: |
| 691 | if(pRect->bottom-pRect->top < min_height) |
| 692 | pRect->bottom = pRect->top + min_height; |
| 693 | break; |
| 694 | default: |
| 695 | break; |
| 696 | } |
| 697 | } |
| 698 | |
| 699 | void NSFTrackDialog::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) |
| 700 | { |