Solved

mapping mode prob

Posted on 2003-12-03
3
206 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
[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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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
MFC Dialog 9 53
difference between String.subString() and String.subSequence() 6 271
how to split multiple lines delimiter : 8 119
JQuery serialize and unserialize 8 198
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.

733 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