Make MFC View "read only" while allowing viewing, scrolling etc.
-
The MFC SDI program has a document/view architecture and a dialog based flat file database. At times, 1. the rich text in the view must be "read only" (preferably the user is unable to obtain focus in the view) 2. while the user makes changes to the database 3. and saves the changes to the document as a whole (which of course does not contain any changes to the rich text the user can read but not edit in the view). At other times, all parts of the document view and database are availble for edit and save. QUESTION: How does one prevent changes to the view while allowing full "read only" access (including scrolling) of the rich text in the view (preferably from OnInitialUpdate), and still allow editing and normal file save (savemodified and dosave) for the (changed) dialog-based database? NOTE: Using PretranslateMessage in the Doc file traps keyboard input for a partial resolution, however, it also disables the scroll bar so only one page of the view may be displayed. SUGGESTIONS? Thanks.
"For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash
-
The MFC SDI program has a document/view architecture and a dialog based flat file database. At times, 1. the rich text in the view must be "read only" (preferably the user is unable to obtain focus in the view) 2. while the user makes changes to the database 3. and saves the changes to the document as a whole (which of course does not contain any changes to the rich text the user can read but not edit in the view). At other times, all parts of the document view and database are availble for edit and save. QUESTION: How does one prevent changes to the view while allowing full "read only" access (including scrolling) of the rich text in the view (preferably from OnInitialUpdate), and still allow editing and normal file save (savemodified and dosave) for the (changed) dialog-based database? NOTE: Using PretranslateMessage in the Doc file traps keyboard input for a partial resolution, however, it also disables the scroll bar so only one page of the view may be displayed. SUGGESTIONS? Thanks.
"For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash
Have you tried EM_SETOPTIONS with ECO_READONLY flag (CRichEditCtrl::SetReadOnly(BOOL)) ? I can't remember if that still lets the user scroll...
-
Have you tried EM_SETOPTIONS with ECO_READONLY flag (CRichEditCtrl::SetReadOnly(BOOL)) ? I can't remember if that still lets the user scroll...
Thank you! EM_SETOPTIONS with the ECO_READONLY flag set rings the bel when the user attempts to edit the view, and does allow scrolling. Thanks again! It appears you are the person who helped me before. Your assistance is very much appreciated!
"For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash