Solved

mapping mode prob

Posted on 2003-12-03
3
197 Views
Last Modified: 2013-11-20
hi...i am facing a small prob..

void CEditorView::OnDraw(CDC* pDC)
{
      CEditorDoc* pDoc = GetDocument();
      ASSERT_VALID(pDoc);
      
      //
      //Set the mapping mode to LOENGLISH
      //
      pDC->SetMapMode(MM_LOENGLISH);

      //
      //Convert arguments to coordinates to MM_LOENGLISH units.
      //
      CPoint pos;
      pos.x = pDoc->GetGridWidth()*100;
      pos.y = pDoc->GetGridHeight();
      pDC->DPtoLP(&pos);

      //
      //Draw the square the has to bound the grid
      //
//      CRect rect(10, -10, pos.x, pos.y);//getting wrong rect in this way..WHY?
      CRect rect(10, -10, 2000, -1000);
      pDC->Rectangle(rect);//rectangle drawn okwhen i do this
CRect rect(10, -10, pos.x, pos.y);
the rectangle that is drawn isboundless...i.e no mater how long i put the scroll bars..i still cant see the end of therect..wherea as if i do this
CRect rect(10, -10, 2000, 1000);
i can see the rectangle...
why is that???why cant i see the rect when iuse the first method??
can somebody gimme an explanation pls ????
tks for any help...
0
Comment
Question by:joseph-r-thomas
3 Comments
 
LVL 12

Expert Comment

by:migel
ID: 9868081
Hi!
May be you need to set WindowOrigin with proper walue getted from the scrollPositions?
0
 

Author Comment

by:joseph-r-thomas
ID: 9868098
i dont think u get my question.....
0
 
LVL 13

Accepted Solution

by:
SteH earned 20 total points
ID: 9926576
What values do pos.x and pos.y have?

Why do you use a CPoint to store x and y when you and later get back x and y seperatly? Perhaps using
CPoint ltpos (10, -10);
CRect (ltpos, pos); could be used instead?
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 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

24 Experts available now in Live!

Get 1:1 Help Now