Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - How to change a bitmap on a ToolBar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to change a bitmap on a ToolBar

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


Joined: 23 November 2004
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote VAGB Quote  Post ReplyReply Direct Link To This Post Topic: How to change a bitmap on a ToolBar
    Posted: 25 November 2005 at 7:57am

Hello.

I have a ToolBar with a resource of 3 images. I need to change these images according to the actions of the user. I mean, one of the images is a "Play" image. I need to change that image for other in grayscale showing that there is no any playing available, for example when the user selects a non playable item of a list.

I canīt find out the way to make this as I donīt understand very well the tasks that CXTPCommandBars, CXTPCommandBar, CXTPImageManager and CXTPPaintManager develope.

It seems to be an only object of CXTPCommandBars class that acts as a set of all existing CXTPCommandBar elements. I have tried with CXTPImageManager but it seems to deal only with icons and not with images.

In addition I have tried to use pIconsInfo->bUseDisableIcons but it does not work at all. The image remains as it was created.

I know this may be a rather obvious topic for many users, therefore some explanation of these elements would be very welcome.

Thanks in advance!

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2005 at 6:52am

Best way it to set icon in update handler for command id:

void CSliderSampleView::OnUpdatePlayerPlay(CCmdUI* pCmdUI)
{
 CXTPControl* pControl = CXTPControl::FromUI(pCmdUI);
 
 if (pControl) 
 {
  pControl->SetIconId(!m_bPlay || m_bPause ? ID_PLAYER_PLAY : ID_PLAYER_PAUSE);
 } 
}

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.125 seconds.