Print Page | Close Window

Problem Status bar icon

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=5528
Printed Date: 11 November 2025 at 4:48pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problem Status bar icon
Posted By: rocco
Subject: Problem Status bar icon
Date Posted: 15 November 2006 at 9:23am
Since I upgraded to 10.x, icons in the statusbar have no longer transparent background. Nothig has changed in my code. Do I something wrong?


// .h
CXTPStatusBar m_wndStatusBar
CXTPStatusBarIconPane m_wndIconPane

// Mainfrm.cpp
static UINT indicators[] =
{
 ID_INDICATOR_ICON  // Service indicator
};

(In OnCreate method)

 if (!m_wndStatusBar.Create(this) ||
  !m_wndStatusBar.SetIndicators(indicators,
  sizeof(indicators)/sizeof(UINT)))
 {
  TRACE0("Failed to create status bar\n");
  return -1;      // fail to create
 }

 // -----> Icon Pane
 if (!m_wndIconPane.Create(NULL, &m_wndStatusBar))
 {
  TRACE0("Failed to create icon pane.\n");
  return -1;
 }
 
 // Initialize the pane info and add the control.
 int nIndex = m_wndStatusBar.CommandToIndex(ID_INDICATOR_ICON);
 ASSERT (nIndex != -1);

 m_wndStatusBar.SetPaneWidth(nIndex, xtAfxData.cxSmIcon);
 m_wndStatusBar.AddControl(&m_wndIconPane, ID_INDICATOR_ICON, FALSE);




Replies:
Posted By: pascal
Date Posted: 16 November 2006 at 5:15pm

Set the incon index for the pane in which you want to show the icon.

1. retrieve the pane index:
int nIndex = CommandToIndex(ID_INDICATOR_THEPANE);
ASSERT( nIndex != -1 );
2. retrieve the pane object
CXTPStatusBarPane* pPane = GetPane(nIndex);
3. set the icon index
pPane->SetIconIndex(uCommandID);
 
Note uCommandID is a resource ID. An icon must be mapped to this ID. The is the case for toolbar buttons, menus etc. To create a map, you can use e.g. the method XTPImageManager()->SetIcons( ... ).
 
regards
 
pascal


-------------
Pascal Verdier
Software Engineer Manager



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