Print Page | Close Window

Bug CXTPStatusBarSwitchPane using Vector icons

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=24583
Printed Date: 21 July 2025 at 9:04pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bug CXTPStatusBarSwitchPane using Vector icons
Posted By: hpuck
Subject: Bug CXTPStatusBarSwitchPane using Vector icons
Date Posted: 18 July 2025 at 8:40am
Using vector icons in an StatusBarSwitchPane causes:
* asserts in debug build
* icons not drawn centered but left aligned

When debugging using Office2013 theme the Asset is triggered by the call to
pIcon->GetExtent()
and the left aligned drawing happens because due to sz being zeroed 
Since ICON_SMALL is used a preferred icon size, why not use a fixed icon size for vector icons?


int CXTPStatusBarThemeOffice2013::DrawStatusBarSwitchPane(CDC* pDC, CRect rcItem, CXTPStatusBarSwitchPane* pPane)
{
.....

  CXTPImageManagerIcon* pIcon =
pPane->GetStatusBar()->GetImageManager()->GetImage(pSwitch->nID, ICON_SMALL);
  if (pIcon)
  {
     CSize sz = CXTPPaintManager::AdjustDpiIconSize(
pIcon, pIcon->GetExtent(),
XTP_SAFE_GET2(pPane, GetStatusBar(), GetCommandBars(), NULL),                                                  rcItem.Size()
                      );
.....



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net