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