Solved

Menu CheckBox Bitmap

Posted on 2004-08-16
4
471 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
  • 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 25 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand macro to ask for filename column 8 37
ORA-01403: no data found 43 89
Use of condition with 'serial' in ansible 2 49
Unix Command -- Challenging  question 7 86
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

930 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now