![]() |
Yet another bug: Ribbon, SetCurSel |
Post Reply ![]() |
Author | ||
ABuenger ![]() Newbie ![]() ![]() Joined: 02 February 2006 Status: Offline Points: 1075 |
![]() ![]() ![]() ![]() ![]() Posted: 03 August 2006 at 4:59pm |
|
In the RibbonSample add the following lines to CRibbonSampleView::OnUpdateRibbonTab at the end of the method:
...
pTab = pControl->FindTab(ID_TAB_CHARTFORMAT);
pTab->SetVisible(bVisible); if (bVisible)
{ pTab->GetRibbonBar()->SetCurSel(7); } Then start the app and click on Insert > Chart....
![]() That makes it impossible to automatically select the first visible contextual tab like in Office 2007.
I've the same problem in my app and it worked with 10.20
|
||
Codejock support
|
||
![]() |
||
ABuenger ![]() Newbie ![]() ![]() Joined: 02 February 2006 Status: Offline Points: 1075 |
![]() ![]() ![]() ![]() ![]() |
|
The problem is in CXTPRibbonBar::RebuildControls where now OnIdleUpdateCmdUI is beeing called.
Is there any reason why OnIdleUpdateCmdUI is beeing called explicitly?
|
||
Codejock support
|
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
Hi,
This is not good idea to select tab each time in update handler - user will not be able to switch tabs. I'd change it to
pTab = pControl->FindTab(ID_TAB_CHARTFORMAT);
BOOL bOldVisible = pTab->IsVisible();
pTab->SetVisible(bVisible); if (bVisible && !bOldVisible)
{ pTab->Select(); } it will activate it only once when it first become visible and resolve stack overflow problem |
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
ABuenger ![]() Newbie ![]() ![]() Joined: 02 February 2006 Status: Offline Points: 1075 |
![]() ![]() ![]() ![]() ![]() |
|
Sure, the sample was just to reproduct the problem.
I test my apps before releasing them
![]()
That workaround works, but it's not perfect. If I call SetCurSel in the update handler the update handler is beeing called again but GetCurSel still returns the old index and not the one I've set before.
|
||
Codejock support
|
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
I agree... For 10.3.1 Update will call anyway but GetCurSel will return correct index.
|
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
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 |