Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Problem Status bar icon
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem Status bar icon

 Post Reply Post Reply
Author
Message
rocco View Drop Down
Newbie
Newbie


Joined: 01 December 2003
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote rocco Quote  Post ReplyReply Direct Link To This Post Topic: Problem Status bar icon
    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);

Back to Top
pascal View Drop Down
Groupie
Groupie


Joined: 07 February 2005
Location: Germany
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote pascal Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.