![]() |
ribbon group withmutually exclusive buttons? |
Post Reply
|
| Author | |
andujar
Newbie
Joined: 02 August 2006 Location: United States Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Topic: ribbon group withmutually exclusive buttons?Posted: 02 August 2006 at 8:01pm |
|
We are developing an application with a ribbon and have multiple control buttons in a group and would like the behavior of the buttons in this group to be mutually exclusive. So, we are trying to create a scenario where:
One button will always be checked Clicking on one button unchecks the currently checked button and checks the button just clicked And therefore, no two buttons can be checked at the same time Here is how we create the group:
CXTPRibbonGroup* pDirectoriesGroup = pTabMain->AddGroup(ID_GROUP_DIRECTORIES); We also have message handlers to initiate actions on button push and to check/uncheck each button individually (as in ribbonsample):
ON_UPDATE_COMMAND_UI_RANGE(ID_Directories_C_DRIVE, ID_Directories_E_DRIVE, OnUpdateDirectories) Any thoughts on the code we can replace ours with to create the behavior above? Thanks |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 August 2006 at 9:25pm |
|
Hello,
Something like this:
ON_UPDATE_COMMAND_UI_RANGE(ID_Directories_C_DRIVE, ID_Directories_E_DRIVE, OnUpdateDirectories)
ON_COMMAND_RANGE(ID_Directories_D_DRIVE, ID_Directories_E_DRIVE,OnDirectories) CMainFrame::CMainFrame()
{
m_nDirectory = ID_Directories_C_DRIVE;
} void CMainFrame::OnDirectories(UINT nID) { m_nDirectory = nID; } void CMDIChildWndEx::OnUpdateDirectories(CCmdUI* pCmdUI)
{ pCmdUI->SetCheck(pCmdUI->m_nID == m_nDirectory ? 1 : 0); }
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
andujar
Newbie
Joined: 02 August 2006 Location: United States Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 August 2006 at 9:46pm |
|
Perfect. Thank you very much, Oleg.
|
|
![]() |
|
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 |