void ListImageItem::onDraw() { Brush* brush = Brush::getSingletonPtr(); brush->setFilterMode(mDesc->widget_brushFilterMode); brush->drawSkinElement(Rect(mTexturePosition,mWidgetDesc->widget_dimensions.size),mSkinElement); ColourValue prevColor = brush->getColour(); Rect prevClipRegion = brush->getClipRegion(); if(mDesc->listimageitem_imageName != "") { ColourValue prevColor = brush->getColour(); Rect prevClipRegion = brush->getClipRegion(); Rect clipRegion = mClientDimensions; clipRegion.translate(mTexturePosition); brush->setClipRegion(prevClipRegion.getIntersection(clipRegion)); brush->setTexture(mDesc->listimageitem_imageName); if(mDesc->listimageitem_tileImage) brush->drawTiledRectangle(clipRegion,UVRect(0,0,1,1)); else brush->drawRectangle(clipRegion,UVRect(0,0,1,1)); brush->setClipRegion(prevClipRegion); Brush::getSingleton().setColor(prevColor); } }
void ListTextItem::onDraw() { Brush* brush = Brush::getSingletonPtr(); brush->setFilterMode(mDesc->widget_brushFilterMode); brush->drawSkinElement(Rect(mTexturePosition,mWidgetDesc->widget_dimensions.size),mSkinElement); ColourValue prevColor = brush->getColour(); Rect prevClipRegion = brush->getClipRegion(); // Clip to client dimensions Rect clipRegion(mClientDimensions); clipRegion.translate(mTexturePosition); brush->setClipRegion(prevClipRegion.getIntersection(clipRegion)); // Adjust Rect to Text drawing region clipRegion = mClientDimensions; clipRegion.translate(mTexturePosition); mText->draw(clipRegion.position); brush->setClipRegion(prevClipRegion); brush->setColor(prevColor); }
void TreeViewCheckBoxNode::onDraw() { Brush* brush = Brush::getSingletonPtr(); brush->setFilterMode(mDesc->widget_brushFilterMode); // Draw Background Point backgroundPosition(mTexturePosition); backgroundPosition.x += mWidgetDesc->widget_dimensions.size.height; brush->drawSkinElement(Rect(backgroundPosition,mWidgetDesc->widget_dimensions.size),mSkinElement); // if Selected, draw Selected SkinElement if(mDesc->treeviewnode_selected) brush->drawSkinElement(Rect(backgroundPosition,mWidgetDesc->widget_dimensions.size),mSkinType->getSkinElement(SELECTED)); ColourValue prevColor = brush->getColour(); Rect prevClipRegion = brush->getClipRegion(); // Draw Icon Point iconPosition(mTexturePosition.x + (mWidgetDesc->widget_dimensions.size.height * 2),mTexturePosition.y); brush->drawSkinElement(Rect(iconPosition,Size(mWidgetDesc->widget_dimensions.size.height)),mSkinType->getSkinElement(ICON)); // Clip to client dimensions Rect clipRegion(mTexturePosition,Size(mWidgetDesc->widget_dimensions.size.width - mWidgetDesc->widget_dimensions.size.height,mWidgetDesc->widget_dimensions.size.height)); clipRegion.translate(Point(mWidgetDesc->widget_dimensions.size.height * 3,0)); brush->setClipRegion(prevClipRegion.getIntersection(clipRegion)); // Adjust Rect to Text drawing region Point textPosition = clipRegion.position; mText->draw(textPosition); // Restore Clipping brush->setClipRegion(prevClipRegion); brush->setColor(prevColor); }