?
Solved

Menu CheckBox Bitmap

Posted on 2004-08-16
4
Medium Priority
?
483 Views
Last Modified: 2013-11-20
Im currently using the following code to toggle between different modes of operation via the menu:

    CMenu* menu = AfxGetMainWnd()->GetMenu();
    CMenu* subMenu = menu->GetSubMenu(1);

    subMenu->CheckMenuRadioItem( ID_MODE_EDIT, ID_MODE_ZOOM, ID_MODE_EDIT, MF_BYCOMMAND | MF_CHECKED );

The default bitmap for this displays a bullet point bitmap, instead of the tick\check bitmap.
Any ideas on how to achieve this without the SetMenuBitmap function again.

The event handler function is written in the doc class
0
Comment
Question by:spiffles
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:Nass89
ID: 11817613
Hi,
Add OnUpdate menu item for the menu you wat to tick:

void ViewClass::OnUpdateMyMenu(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if(condition==TRUE)
pCmdUI->SetCheck(1);
else
pCmdUI->SetCheck(0);

}

Good Luck!
0
 

Author Comment

by:spiffles
ID: 11817685
thanks but i need to be
able to switch between to menu items
i.e. one checked and one not checked.
how do i uncheck the other one?

Thats why i was using CheckMenuRadioItem(). cept it has the stupid
bullet point bitmap
0
 
LVL 5

Accepted Solution

by:
Nass89 earned 100 total points
ID: 11827519
Hi,
Add the same OnUpdate for another Menu item and while you check first one uncheck another.

void ViewClass::OnUpdateMyMenuItem1(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if(condition==TRUE)
pCmdUI->SetCheck(1);
else
pCmdUI->SetCheck(0);

}

void ViewClass::OnUpdateMyMenuItem2(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if(condition==TRUE)
pCmdUI->SetCheck(0);
else
pCmdUI->SetCheck(1);

}

Good Luck!
0
 

Author Comment

by:spiffles
ID: 11889251
Thanks Nass!
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month13 days, 6 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question