/** * @file XTPScrollBarThemeVisualStudio2022.cpp * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ #include "StdAfx.h" #include "Common/XTPTypeId.h" #include "Common/XTPFramework.h" #include "Common/XTPSystemHelpers.h" #include "Common/XTPSynchro.h" #include "Common/XTPApplication.h" #include "Common/XTPSingleton.h" #include "Common/XTPGdiObjects.h" #include "Common/XTPDrawHelpers.h" #include "Common/XTPResourceImage.h" #include "Common/ScrollBar/XTPScrollBase.h" #include "Common/ScrollBar/XTPScrollBarPaintManager.h" #include "Common/ScrollBar/Themes/XTPScrollBarThemeVisualStudio2012.h" #include "Common/ScrollBar/Themes/XTPScrollBarThemeVisualStudio2022.h" #include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" #ifdef _DEBUG # define new DEBUG_NEW # undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ////////////////////////////////////////////////////////////////////////// // CXTPScrollBarThemeVisualStudio2022 void CXTPScrollBarThemeVisualStudio2022::DrawScrollBar(CDC* pDC, CXTPScrollBase* pScroll) { _ASSERTE(NULL != pScroll); XTP_SCROLLBAR_TRACKINFO* pSBTrack = pScroll->GetScrollBarTrackInfo(); XTP_SCROLLBAR_POSINFO* pSBInfo = pScroll->GetScrollBarPosInfo(); int cWidth = (pSBInfo->pxRight - pSBInfo->pxLeft); if (cWidth <= 0) { return; } m_State.nPressedHt = pSBTrack ? (pSBTrack->bTrackThumb || pSBTrack->fHitOld ? pSBInfo->ht : -1) : -1; m_State.nHotHt = pSBTrack ? -1 : pSBInfo->ht; m_State.bEnabled = (pSBInfo->posMax - pSBInfo->posMin - pSBInfo->page + 1 > 0) && pScroll->IsScrollBarEnabled(); m_State.nBtnTrackSize = pSBInfo->pxThumbBottom - pSBInfo->pxThumbTop; m_State.nBtnTrackPos = pSBInfo->pxThumbTop - pSBInfo->pxUpArrow; if (!m_State.bEnabled || pSBInfo->pxThumbBottom > pSBInfo->pxDownArrow) m_State.nBtnTrackPos = m_State.nBtnTrackSize = 0; m_State.clrBackground = XTPIniColor(_T("Common.ScrollBar"), _T("NormalBack"), RGB(243, 243, 243)); m_State.clrArrowDisabled = XTPIniColor(_T("Common.ScrollBar"), _T("DisabledScrollArrow"), RGB(171, 171, 171)); m_State.clrArrowEnabled = XTPIniColor(_T("Common.ScrollBar"), _T("NormalScrollArrow"), RGB(119, 119, 119)); m_State.clrArrowHot = XTPIniColor(_T("Common.ScrollBar"), _T("SelectedScrollArrow"), RGB(119, 119, 119)); m_State.clrArrowPressed = XTPIniColor(_T("Common.ScrollBar"), _T("PressedScrollArrow"), RGB(119, 119, 119)); m_State.clrBtnTrackEnabled = XTPIniColor(_T("Common.ScrollBar"), _T("NormalThumbBack"), RGB(255, 255, 255)); m_State.clrBtnTrackHot = XTPIniColor(_T("Common.ScrollBar"), _T("SelectedThumbBack"), RGB(240, 240, 240)); m_State.clrBtnTrackPressed = XTPIniColor(_T("Common.ScrollBar"), _T("PressedThumbBack"), RGB(240, 240, 240)); CXTPScrollBarPaintManager::DrawScrollBar(pDC, pScroll); }