|
I've just read the def of the map modes:
MM_ANISOTROPIC Logical units are converted to arbitrary units with arbitrarily scaled axes.
It didnt work because it was set to that mode (again code is from a sample).
Now it works because right before printing, the mode is re-set to
MM_LOENGLISH Each logical unit is converted to 0.01 inch. Positive x is to the right; positive y is up.
It makes sense.
Thanks for helping.
mnnca
|
|
|
|
|
mnnca wrote: Thanks for helping.
I think I've only provided emotional support LOL
Anyway, OnPrepareDC() is called before OnPrint() is repeatedly called for each page,
so you are overriding any map mode set in OnPrepareDC().
If you want to, you can remove the code you have in OnPrepareDC() and
replace it with the pDC->SetMapMode(MM_LOENGLISH); call.
This should work the same:
void CDISKVERView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
CFormView::OnPrepareDC(pDC, pInfo);
pDC->SetMapMode(MM_LOENGLISH);
}
void CDISKVERView::OnPrint(CDC* pDC, CPrintInfo* pInfo )
{
CDISKVERView::PrintPage( pDC, pInfo);
} Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, the scale mode should be set in OnPrepareDC (cleaner).
mnnca
|
|
|
|
|
Which Font are you using? It can be tht the font in your view fits and is visible, but after conversions to the printer is too small. In my project I had a similar problem. The output was just a single point because my font was so dammned small that a complete sentence was not visible. Take a look to the size of your document, the dimension that you are stablishing and create a compatible font to that dimensions/device printer
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I think it's a different and strange problem because it works fine in debug mode.
The font I select is the "default" font which user is using, but I control the height and weight so it should not be the problem:
logFont.lfHeight = 35; // 3/4th inch high in MM_LOENGLISH
logFont.lfWeight = 400;//700;//max bold
CFont font;
if (font.CreateFontIndirect(&logFont))
pOldFont = pDC->SelectObject(&font);
Thanks.
mnnca
|
|
|
|
|
Hello,
I have a read only CEdit control on my dialog, when i run the application and there is always wait cursor
( | - this sign of wait cursor) on the Control, How can we hide the cursor?
thanks
|
|
|
|
|
Cursor or caret?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
yeah, i think it is called caret, the sign ( | ) is always flashing on the control
|
|
|
|
|
You could adjust the order of the controls in the dialog
so a different control gets the initial focus.
And/or you can use SetFocus() or WM_NEXTDLGCTL/GotoDlgCtrl()
to move the focus to a different control.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I just saw a method HideCaret(), but it didnt work
this->GetDlgItem(IDC_EDIT1)->HideCaret(); is this right?
|
|
|
|
|
HideCaret is a bad idea unless you're the one that called ShowCaret.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have only one control on my dialog, if so, what should i do?
thanks
|
|
|
|
|
In your dialog class OnOnitDialog() override, try
SetFocus();
...
return FALSE; //<-- just doing this may work
You can also disable the control, but it will look different.
You can also use a static text control, but it too will look different (although
you can maybe use WM_CTLCOLORSTATIC to provide a specific background).
That's all I can think of at the moment
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
No problem.
Did you get a solution? If so, what worked?
BTW, I still think it's silly that read-only edit controls show the caret
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: BTW, I still think it's silly that read-only edit controls show the caret
How else would you copy text from them?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
With the mouse, duh
Well there it is then.. I no longer think it's silly!
Thanks!
MArk
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello,
No i didnt get any solution, i just thanked for trying to help me.
i still have the same problem
|
|
|
|
|
Gofur Halmurat wrote: How can we hide the cursor?
Can you change the Z-order of the controls, such that this edit control is not the first one given focus? Or, can you disable the control?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
There is only one control on my dialog, yeah, i can disable it, but i need enabled Cedit control, what happens if i change z-order?
thanks
|
|
|
|
|
Gofur Halmurat wrote: ...but i need enabled Cedit control...
You need it enabled but read-only, is that right?
Gofur Halmurat wrote: what happens if i change z-order?
Nothing, when there is only one control.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
So what is the purpose of this read-only control?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The purpose is to show some text on it, that is all
|
|
|
|
|
Then why not just use a static control, or a disabled edit control?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|