| 226 | } |
| 227 | |
| 228 | void GuiIconButtonCtrl::renderButton( Point2I &offset, const RectI& updateRect ) |
| 229 | { |
| 230 | bool highlight = mMouseOver; |
| 231 | bool depressed = mDepressed; |
| 232 | |
| 233 | ColorI fontColor = mActive ? (highlight ? mProfile->mFontColorHL : mProfile->mFontColor) : mProfile->mFontColorNA; |
| 234 | |
| 235 | RectI boundsRect(offset, getExtent()); |
| 236 | |
| 237 | GFXDrawUtil *drawer = GFX->getDrawUtil(); |
| 238 | |
| 239 | if (mDepressed || mStateOn) |
| 240 | { |
| 241 | // If there is a bitmap array then render using it. |
| 242 | // Otherwise use a standard fill. |
| 243 | if(mProfile->mUseBitmapArray && mProfile->mBitmapArrayRects.size()) |
| 244 | renderBitmapArray(boundsRect, statePressed); |
| 245 | else |
| 246 | renderSlightlyLoweredBox(boundsRect, mProfile); |
| 247 | } |
| 248 | else if(mMouseOver && mActive) |
| 249 | { |
| 250 | // If there is a bitmap array then render using it. |
| 251 | // Otherwise use a standard fill. |
| 252 | if(mProfile->mUseBitmapArray && mProfile->mBitmapArrayRects.size()) |
| 253 | renderBitmapArray(boundsRect, stateMouseOver); |
| 254 | else |
| 255 | renderSlightlyRaisedBox(boundsRect, mProfile); |
| 256 | } |
| 257 | else |
| 258 | { |
| 259 | // If there is a bitmap array then render using it. |
| 260 | // Otherwise use a standard fill. |
| 261 | if(mProfile->mUseBitmapArray && mProfile->mBitmapArrayRects.size()) |
| 262 | { |
| 263 | if(mActive) |
| 264 | renderBitmapArray(boundsRect, stateNormal); |
| 265 | else |
| 266 | renderBitmapArray(boundsRect, stateDisabled); |
| 267 | } |
| 268 | else |
| 269 | { |
| 270 | drawer->drawRectFill(boundsRect, mProfile->mFillColorNA); |
| 271 | drawer->drawRect(boundsRect, mProfile->mBorderColorNA); |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | Point2I textPos = offset; |
| 276 | if(depressed) |
| 277 | textPos += Point2I(1,1); |
| 278 | |
| 279 | RectI iconRect( 0, 0, 0, 0 ); |
| 280 | |
| 281 | // Render the icon |
| 282 | if ( mTextureNormal && mIconLocation != GuiIconButtonCtrl::IconLocNone ) |
| 283 | { |
| 284 | // Render the normal bitmap |
| 285 | drawer->clearBitmapModulation(); |
nothing calls this directly
no test coverage detected