Mark
Thu Apr 21 15:04:11 CDT 2005
With CDialog, ON_UPDATE_COMMAND_UI is not called unless you explicitly set
it to be so, I cannot remember how.
Easier idea is simply to change its setting as required using simple setting
macro's or functions. The CDialog preserves their values.
/* macros for changing the menu options quickly */
#define SwitchMenuCheck(m, i) m->CheckMenuItem(i, m->GetMenuState(i,
MF_BYCOMMAND) == MF_CHECKED ? 0 : MF_CHECKED)
#define SwitchMenu(x) const int nID = x; CMenu* menu = GetMenu();
SwitchMenuCheck(menu, x); this->ForceResize();
#define SwitchCheck(x) const int nID = x; CMenu* menu = GetMenu();
SwitchMenuCheck(menu, x);
--
- Mark Randall
http://zetech.swehli.com
"Pieter Claassens" <erica.altini@blueyonder.co.uk> wrote in message
news:enM5IujRFHA.904@tk2msftngp13.phx.gbl...
> I've got a simple menu, created it in the resource editor and made it the
> menu for my main Dialog window. (CRSMDlg)
>
> How do I get my menu to display a check / tick box next to the item when I
> click on it. I tried adding the ON_UPDATE_COMMAND_UI event handler but no
> matter what I do the menu item is not "ticked" :
>
> void CRSMDlg::OnUpdateOps(CCmdUI *pCmdUI) {
> pCmdUI->SetCheck(1);
>
> }
>
> Is there an update / repaint method I must call, some property I must set
> on
> the Dialog box to inform it ?
>
> Also I found that the shortcut keys does not display when you click on
> File,
> but if you keep the ALT button , then only it displays it - can we switch
> this behaviour off ?
>
>
>
>
>