Solved

not to disable undo menu

Posted on 2002-04-03
3
292 Views
Last Modified: 2013-11-20
In CEditView, if  I select some text and cut it, my Undo menu gets disabled. Also my toolbar button to handle Undo command gets greyed. I want to control the enable/disable of these by myself. How can I do it?
0
Comment
Question by:britney
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
mblat earned 100 total points
ID: 6915672
first you need to set

m_bAutoMenuEnable  = FALSE;

it is member of CFrameWnd, so if you are using standard SDI/MDI app you can do it in CMainFrame constractor

Downside here is that now you need to overwrite UPDATE_COMMAND_UI handler for EVERY menu item you want to enable/disable based on certain conditions.

something like this:

void CMainFrame::OnUpdateFileLogon(CCmdUI* pCmdUI)
{
     if (SecurityDLL_IsUserLoggedOn())
          pCmdUI->Enable(FALSE);
}
otherwise they will always be enabled.

Hope it helps
0
 

Author Comment

by:britney
ID: 6915934
hi mblat,
I set m_bAutoMenuEnable  = FALSE; in constructor of my CMainFrame. It still disables the menu and toolbar button on using Cut. It's ok for  me if they never get disabled. Comment with m_bAutoMenuEnable in AFXWIN.H says:

BOOL m_bAutoMenuEnable;
          // TRUE => menu items without handlers will be disabled

I think this is for automatic enabling/disabling of menu items with/without handlers. What I need is the  menu item never gets automatically disabled.



0
 
LVL 4

Expert Comment

by:mblat
ID: 6916197
// TRUE => menu items without handlers will be disabled

so, did you define handler?  try to define it and then try to define UPDATE_COMMAND_UI handler.
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
Windows Drag & Drop Location 2 94
sum13 challenge 24 90
MaxSpan challenge 9 80
Remove Password Protection from pdf (with password) using an command line executable 5 30
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

920 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

16 Experts available now in Live!

Get 1:1 Help Now