Solved

CRichEditCtrl Problem?

Posted on 1998-03-23
5
291 Views
Last Modified: 2013-11-19
I am trying to develop application that support simple drawing shapes and allow to insert as well a text frame.
I made a doc/view application. In my document class I have a CMyList member that contains object representing various shapes: rect, circle and so on. I drew them using CDC class members. For text frame I use CRichEditCtrl.
The problem is that I can't make them work together. When  I drag some of the simple objects the text frame don't repaint itself correctly. Beside that I can't put it in my Z-order supported by my view class and can't zoom it.
0
Comment
Question by:cyrilbdt
  • 3
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1317155
If you are going to do it with this method, you will need to make sure that when you drag one of your own objects, and when the user lets go, you will have to invalidate all of the rich edits because they have been overwritten by your drawing. However, if you create your view with the WS_CLIPCHILDREN flag, then it should be okay. You can add

  ModifyStyle(0, WS_CLIPCHILDREN);

in your view's OnInitialUpdate() or in the OnCreate() member function.

Zooming is much harder because you need to go through every single text formatting change in the rich edit control and increase the size of the font by the zooming percentage. Note that you will have to change the size of the rich edit control itself too. You have to do this manually because the rich edit control wasn't designed with zooming.
0
 
LVL 2

Author Comment

by:cyrilbdt
ID: 1317156
Thansk for answer, it works fine!
About zooming - I have idea but I don't know how to do it.
Can I draw CRichEditCtrl in memory dc and then, using StrechBlt to draw it in view?
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1317157
No, you cannot tell the control to draw to a memory dc. You'll have to use the font changing method.


0
 
LVL 2

Author Comment

by:cyrilbdt
ID: 1317158
I find better decision to the problem - CRichEditCtrl::FormatRange(). It paint control in target dc and can zoom it, just what I want. But know I have problems with finding out what "TWIPS" means, but I'll handle it.
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1317159
There are 1440 twips to an inch. Do a query (not a search) on twips in the VC++ online help.
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
deburging in oracle form 12 99
Execute multiple curl cmds with sleep and send output to file 10 97
firstChar challenge 13 115
Message not shown 5 50
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.

810 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