| 485 | } |
| 486 | |
| 487 | void CEditUI::PaintStatusImage(HDC hDC) |
| 488 | { |
| 489 | if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED; |
| 490 | else m_uButtonState &= ~ UISTATE_FOCUSED; |
| 491 | if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED; |
| 492 | else m_uButtonState &= ~ UISTATE_DISABLED; |
| 493 | |
| 494 | if( (m_uButtonState & UISTATE_DISABLED) != 0 ) { |
| 495 | if( !m_sDisabledImage.IsEmpty() ) { |
| 496 | if( !DrawImage(hDC, (LPCTSTR)m_sDisabledImage) ) m_sDisabledImage.Empty(); |
| 497 | else return; |
| 498 | } |
| 499 | } |
| 500 | else if( (m_uButtonState & UISTATE_FOCUSED) != 0 ) { |
| 501 | if( !m_sFocusedImage.IsEmpty() ) { |
| 502 | if( !DrawImage(hDC, (LPCTSTR)m_sFocusedImage) ) m_sFocusedImage.Empty(); |
| 503 | else return; |
| 504 | } |
| 505 | } |
| 506 | else if( (m_uButtonState & UISTATE_HOT) != 0 ) { |
| 507 | if( !m_sHotImage.IsEmpty() ) { |
| 508 | if( !DrawImage(hDC, (LPCTSTR)m_sHotImage) ) m_sHotImage.Empty(); |
| 509 | else return; |
| 510 | } |
| 511 | } |
| 512 | |
| 513 | if( !m_sNormalImage.IsEmpty() ) { |
| 514 | if( !DrawImage(hDC, (LPCTSTR)m_sNormalImage) ) m_sNormalImage.Empty(); |
| 515 | else return; |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | void CEditUI::PaintText(HDC hDC) |
| 520 | { |