Print Page | Close Window

How to change a bitmap on a ToolBar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=3279
Printed Date: 06 October 2024 at 3:29am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to change a bitmap on a ToolBar
Posted By: VAGB
Subject: How to change a bitmap on a ToolBar
Date 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!




Replies:
Posted By: Oleg
Date 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



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