| 375 | } |
| 376 | |
| 377 | void CButtonUI::PaintStatusImage(HDC hDC) |
| 378 | { |
| 379 | if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED; |
| 380 | else m_uButtonState &= ~ UISTATE_FOCUSED; |
| 381 | if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED; |
| 382 | else m_uButtonState &= ~ UISTATE_DISABLED; |
| 383 | |
| 384 | if( (m_uButtonState & UISTATE_DISABLED) != 0 ) { |
| 385 | if( !m_sDisabledImage.IsEmpty() ) |
| 386 | { |
| 387 | if( !DrawImage(hDC, (LPCTSTR)m_sDisabledImage) ) m_sDisabledImage.Empty(); |
| 388 | else goto Label_ForeImage; |
| 389 | } |
| 390 | } |
| 391 | else if( (m_uButtonState & UISTATE_PUSHED) != 0 ) { |
| 392 | if( !m_sPushedImage.IsEmpty() ) { |
| 393 | if( !DrawImage(hDC, (LPCTSTR)m_sPushedImage) ){ |
| 394 | m_sPushedImage.Empty(); |
| 395 | } |
| 396 | if( !m_sPushedForeImage.IsEmpty() ) |
| 397 | { |
| 398 | if( !DrawImage(hDC, (LPCTSTR)m_sPushedForeImage) ) |
| 399 | m_sPushedForeImage.Empty(); |
| 400 | return; |
| 401 | } |
| 402 | else goto Label_ForeImage; |
| 403 | } |
| 404 | } |
| 405 | else if( (m_uButtonState & UISTATE_HOT) != 0 ) { |
| 406 | if( !m_sHotImage.IsEmpty() ) { |
| 407 | if( !DrawImage(hDC, (LPCTSTR)m_sHotImage) ){ |
| 408 | m_sHotImage.Empty(); |
| 409 | } |
| 410 | if( !m_sHotForeImage.IsEmpty() ) { |
| 411 | if( !DrawImage(hDC, (LPCTSTR)m_sHotForeImage) ) |
| 412 | m_sHotForeImage.Empty(); |
| 413 | return; |
| 414 | } |
| 415 | else goto Label_ForeImage; |
| 416 | } |
| 417 | else if(m_dwHotBkColor != 0) { |
| 418 | CRenderEngine::DrawColor(hDC, m_rcPaint, GetAdjustColor(m_dwHotBkColor)); |
| 419 | return; |
| 420 | } |
| 421 | } |
| 422 | else if( (m_uButtonState & UISTATE_FOCUSED) != 0 ) { |
| 423 | if( !m_sFocusedImage.IsEmpty() ) { |
| 424 | if( !DrawImage(hDC, (LPCTSTR)m_sFocusedImage) ) m_sFocusedImage.Empty(); |
| 425 | else goto Label_ForeImage; |
| 426 | } |
| 427 | } |
| 428 | |
| 429 | if( !m_sNormalImage.IsEmpty() ) { |
| 430 | if( !DrawImage(hDC, (LPCTSTR)m_sNormalImage) ) m_sNormalImage.Empty(); |
| 431 | else goto Label_ForeImage; |
| 432 | } |
| 433 | |
| 434 | if(!m_sForeImage.IsEmpty() ) |