| 734 | //----------------------------------------------------------------------------- |
| 735 | |
| 736 | void GuiWindowCtrl::onMouseDown(const GuiEvent &event) |
| 737 | { |
| 738 | setUpdate(); |
| 739 | |
| 740 | mOrigBounds = getBounds(); |
| 741 | |
| 742 | mMouseDownPosition = event.mousePoint; |
| 743 | Point2I localPoint = globalToLocalCoord(event.mousePoint); |
| 744 | |
| 745 | // Select this window - move it to the front, and set the first responder |
| 746 | selectWindow(); |
| 747 | |
| 748 | mMouseMovingWin = false; |
| 749 | |
| 750 | S32 hitEdges = findHitEdges( event.mousePoint ); |
| 751 | |
| 752 | mResizeEdge = edgeNone; |
| 753 | |
| 754 | // Set flag by default so we only clear it |
| 755 | // if we don't match either edge |
| 756 | mMouseResizeHeight = true; |
| 757 | |
| 758 | // Check Bottom/Top edges (Mutually Exclusive) |
| 759 | if( mResizeHeight && hitEdges & edgeBottom ) |
| 760 | mResizeEdge |= edgeBottom; |
| 761 | else if( mResizeHeight && hitEdges & edgeTop ) |
| 762 | mResizeEdge |= edgeTop; |
| 763 | else |
| 764 | mMouseResizeHeight = false; |
| 765 | |
| 766 | // Set flag by default so we only clear it |
| 767 | // if we don't match either edge |
| 768 | mMouseResizeWidth = true; |
| 769 | |
| 770 | // Check Left/Right edges (Mutually Exclusive) |
| 771 | if( mResizeWidth && hitEdges & edgeLeft ) |
| 772 | mResizeEdge |= edgeLeft; |
| 773 | else if( mResizeWidth && hitEdges & edgeRight ) |
| 774 | mResizeEdge |= edgeRight; |
| 775 | else |
| 776 | mMouseResizeWidth = false; |
| 777 | |
| 778 | |
| 779 | // If we clicked within the title bar |
| 780 | if ( !(mResizeEdge & ( edgeTop | edgeLeft | edgeRight ) ) && localPoint.y < mTitleHeight) |
| 781 | { |
| 782 | if (mCanClose && mCloseButton.pointInRect(localPoint)) |
| 783 | { |
| 784 | mCloseButtonPressed = mCanClose; |
| 785 | } |
| 786 | else if (mCanMaximize && mMaximizeButton.pointInRect(localPoint)) |
| 787 | { |
| 788 | mMaximizeButtonPressed = mCanMaximize; |
| 789 | } |
| 790 | else if (mCanMinimize && mMinimizeButton.pointInRect(localPoint)) |
| 791 | { |
| 792 | mMinimizeButtonPressed = mCanMinimize; |
| 793 | } |
nothing calls this directly
no test coverage detected