I cannot figure out why my menu items are getting updated but my toolbar buttons are not. There are 4 items in each area and I triple checked that matching items have the same ID string and therefore same resource number. This is the code in my message map for my CScrollView-based class:
ON_COMMAND_RANGE(ID_VIEW50, ID_VIEW150, OnViewScale)
ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW50, ID_VIEW150, OnUpdateViewScale)
This is the actual code of the functions:
void CInvoices2View::OnUpdateViewScale(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(pCmdUI->m_nID == m_iHowScale);
}
//////////////////
// Handle zoom command.
//
void CInvoices2View::OnViewScale(UINT nID)
{
if (m_iHowScale != nID) {
m_iHowScale = nID;
ScrollToPosition(CPoint(0,0));
OnInitialUpdate();
}
}
The toolbar buttons and menu items actually work but when I click on an item in either location it will be checked in the menu item (with the other items unchecked)...with the toolbar buttons, it will either be pressed or unpressed based on its current state and nothing else, which leads to multiple buttons appearing pressed at once when only one zoom level can appear pressed. For more information, please ask...hoping this is enough information
ON_COMMAND_RANGE(ID_VIEW50, ID_VIEW150, OnViewScale)
ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW50, ID_VIEW150, OnUpdateViewScale)
This is the actual code of the functions:
void CInvoices2View::OnUpdateViewScale(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(pCmdUI->m_nID == m_iHowScale);
}
//////////////////
// Handle zoom command.
//
void CInvoices2View::OnViewScale(UINT nID)
{
if (m_iHowScale != nID) {
m_iHowScale = nID;
ScrollToPosition(CPoint(0,0));
OnInitialUpdate();
}
}
The toolbar buttons and menu items actually work but when I click on an item in either location it will be checked in the menu item (with the other items unchecked)...with the toolbar buttons, it will either be pressed or unpressed based on its current state and nothing else, which leads to multiple buttons appearing pressed at once when only one zoom level can appear pressed. For more information, please ask...hoping this is enough information