Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - SetIconId ignored in ribbon bar system button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SetIconId ignored in ribbon bar system button

 Post Reply Post Reply
Author
Message
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Topic: SetIconId ignored in ribbon bar system button
    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
 
 
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 28 February 2008 at 2:03am
p.s, that's in
 
CXTPRibbonTheme::DrawRibbonFrameSystemButton
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 28 February 2008 at 2:19am
never mind... found you need to add the icon to the image manager first.
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post 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.

 
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.203 seconds.