Solved

not to disable undo menu

Posted on 2002-04-03
3
310 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
[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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need a Shell script to start a service checking the port 6 56
Generic progress indicator 6 121
iSeries DB2 Query 2 101
Annoying "thing" blocks my view 4 147
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.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.

752 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