Print Page | Close Window

SetIconId ignored in ribbon bar system button

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=9729
Printed Date: 27 September 2024 at 9:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SetIconId ignored in ribbon bar system button
Posted By: adrien
Subject: SetIconId ignored in ribbon bar system button
Date Posted: 28 February 2008 at 2:01am
I'm trying to animate the icon in the system button in a ribbon by using a timer and setting the icon id with.
 
 CXTPCommandBars* pCommandBars = GetCommandBars();
 if(pCommandBars)
 {
  CXTPRibbonBar* pRibbonBar = (CXTPRibbonBar*)pCommandBars->GetToolBar(nRibbonId);
  if(pRibbonBar)
   pRibbonBar->GetSystemButton()->SetIconId( nId );
 }
 
however, this calls through to (when it paints the button).
 
  HICON hIcon = GetFrameLargeIcon(pSite);
which always just sets the icon to the main frame icon, not the one set.
 
How do I do animation?
 
There's no documentaion for CXTPCommandBarAnimation, is that what I'm supposed to use, or does that just animate expansion etc of menus etc?
 
Regards
 
Adrien
 
 



Replies:
Posted By: adrien
Date Posted: 28 February 2008 at 2:03am
p.s, that's in
 
CXTPRibbonTheme::DrawRibbonFrameSystemButton


Posted By: adrien
Date Posted: 28 February 2008 at 2:19am
never mind... found you need to add the icon to the image manager first.


Posted By: adrien
Date Posted: 28 February 2008 at 2:25am
cancel that never mind....
 
there's another problem.
 
SetIconId( nId ) calls through to RedrawParent()
 
However, RedrawParent() has a BOOL parameter about whether to animate or not.
 
If you're trying to animate the icon yourself, this really screws it.
 
I suggest changing the prototype
 
AFX_INLINE void CXTPControl::SetIconId(int nId) {
to
 
AFX_INLINE void CXTPControl::SetIconId(int nId, BOOL bAnimate = TRUE) {
 
then I can override animation for setting of the system icon.

 



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