| 713 | //----------------------------------------------------------------------------- |
| 714 | |
| 715 | void GuiEditCtrl::onRender(Point2I offset, const RectI &updateRect) |
| 716 | { |
| 717 | Point2I ctOffset; |
| 718 | Point2I cext; |
| 719 | bool keyFocused = isFirstResponder(); |
| 720 | |
| 721 | GFXDrawUtil *drawer = GFX->getDrawUtil(); |
| 722 | |
| 723 | if (mActive) |
| 724 | { |
| 725 | if( getCurrentAddSet() != getContentControl() ) |
| 726 | { |
| 727 | // draw a white frame inset around the current add set. |
| 728 | cext = getCurrentAddSet()->getExtent(); |
| 729 | ctOffset = getCurrentAddSet()->localToGlobalCoord(Point2I(0,0)); |
| 730 | RectI box(ctOffset.x, ctOffset.y, cext.x, cext.y); |
| 731 | |
| 732 | box.inset( -5, -5 ); |
| 733 | drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) ); |
| 734 | box.inset( 1, 1 ); |
| 735 | drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) ); |
| 736 | box.inset( 1, 1 ); |
| 737 | drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) ); |
| 738 | box.inset( 1, 1 ); |
| 739 | drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) ); |
| 740 | box.inset( 1, 1 ); |
| 741 | drawer->drawRect( box, ColorI( 50, 101, 152, 128 ) ); |
| 742 | } |
| 743 | Vector<GuiControl *>::iterator i; |
| 744 | bool multisel = mSelectedControls.size() > 1; |
| 745 | for(i = mSelectedControls.begin(); i != mSelectedControls.end(); i++) |
| 746 | { |
| 747 | GuiControl *ctrl = (*i); |
| 748 | cext = ctrl->getExtent(); |
| 749 | ctOffset = ctrl->localToGlobalCoord(Point2I(0,0)); |
| 750 | RectI box(ctOffset.x,ctOffset.y, cext.x, cext.y); |
| 751 | ColorI nutColor = multisel ? ColorI( 255, 255, 255, 100 ) : ColorI( 0, 0, 0, 100 ); |
| 752 | ColorI outlineColor = multisel ? ColorI( 0, 0, 0, 100 ) : ColorI( 255, 255, 255, 100 ); |
| 753 | if(!keyFocused) |
| 754 | nutColor.set( 128, 128, 128, 100 ); |
| 755 | |
| 756 | drawNuts(box, outlineColor, nutColor); |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | renderChildControls(offset, updateRect); |
| 761 | |
| 762 | // Draw selection rectangle. |
| 763 | |
| 764 | if( mActive && mMouseDownMode == DragSelecting ) |
| 765 | { |
| 766 | RectI b; |
| 767 | getDragRect(b); |
| 768 | b.point += offset; |
| 769 | |
| 770 | // Draw outline. |
| 771 | |
| 772 | drawer->drawRect( b, ColorI( 100, 100, 100, 128 ) ); |
nothing calls this directly
no test coverage detected