SetIconId ignored in ribbon bar system button |
Post Reply |
Author | |
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
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
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
p.s, that's in
CXTPRibbonTheme::DrawRibbonFrameSystemButton
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
never mind... found you need to add the icon to the image manager first.
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
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.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |