edit box
Rommel Songco -- rsongco@spectrasoft.com
Friday, August 09, 1996
Pete,
Thanks for the reply.
Changing the fonts is actually my current solution.
But the result is just not "pretty" enough.
I want to retain the font I use for the Win 95 version of my program.
Is there absolutely no way to tell the edit control to display
the text centered vertically in Win 3.1?
Rommel
rsongco@spectrasoft.com
Pete Chestna wrote:
>
> What you need to do is override the OnInitDialog method and set a new font
> into all of the controls. It was trial and error to find the correct point
> size, but thats how you need to do it.
>
> If you are using a CFormView (God help you!!!), you have to do some pretty
> funky stuff to actually get the WM_INITDIALOG. If you need it, let me know.
>
> Pete
>
> At 12:30 PM 7/31/96 +0800, you wrote:
> >[Mini-digest: 3 responses]
> >
> >I'm also writing a program under Visual C++ 4.1 that runs on all
> >Windows platforms -- Win 3.1, Win 95 and Win NT. I use Win32s on
> >the 3.1 machine. The program looks good enough on all platforms
> >except for the CEdit controls. I subclassed CEdit to customize
> >its behavior. My edit boxes are smaller than the usual (20 pixels
> >in height). The problem is that on Win 3.1, the text in the
> >edit box is not centered vertically, meaning it appears at a fixed
> >offset from the top margin of the edit box. Thus the text is
> >cut off at the bottom. On Win 95, the edit box looks fine since
> >the text is centered. Anyone else had this problem before? How
> >can I explicitly center the text vertically?
> >
> >TIA.
> >
> >Regards,
> >Rommel Songco
> >rsongco@spectrasoft.com
> >-----From: Tony Goodhew
> >
> >I just finished an app in VC 4.1 under Win32s which linked statically =
> >and I had no problems. The only thing I could recommend is that you use =
> >Win32s 1.30c
> >
> >TonyG
> >
> >-----From: Frank Froelich
> >
> >Graham,
> >
> >When my customers report error 21 they are using an earlier
> >version of Win32s than I require. Try one of the later versions
> >(1.25 or 1.3).
> >
> >Frank
> >
> >-----From: Hugh Robinson
> >
> >I have not had this message in the circumstances which you describe, but =
> > =20
> >I have had just that error message with VC 4.1 running on Windows 3.11. =
> >I =20
> >got the message when I linked my app with MFC statically and I =20
> >accidentally linked a third party library dynamically with MFC. When I =
> >
> >linked the third party library statically with MFC, it worked OK. Maybe =
> >=20
> >that means I have two copies of MFC linked in, mind you...
> >
> >I have been linking my program (and the static version of MFC which I =20
> >created) to the single-threaded version of the runtime library (under =20
> >Build|Settings, C++ tab, Code Generation option) as I read that Win32s =
> >
> >does not support multithreading, which makes sense as for 3.x.
> >
> >Hugh Robinson
> >hugh@ssihou.ssii.com
> >
> >
> >-----From: David Wine
> >
> >Check the version of Win32s you are running. You may have inadvertently
> >changed it to an earlier version.
> >
> >
> ---
> "To you -- is it movement or is it action? Peter J. Chestna
> It is contact or just reaction? HighGround Systems
> And you -- revolution or just resistance? PChestna@highground.com
> Is it living, or just existence?" - RUSH (508) 263-5588 x.125
Pete Chestna -- pchestna@highground.com
Monday, August 12, 1996
[Mini-digest: 2 responses]
If memory serves, I believe the problem is that the edit box has internal
borders in Win 3.1. I don't remember where they are defined, but it is
similar to the window border sizes, etc. There may be a way to fix it there.
Under Win95, the font scales automatically to fit the area you give it.
I screwed with this problem for quite a while and found that the font change
was the only way under 3.1.
My actual solution involved creating the scaled font at runtime and parsing
the binary resource to resizing/move the controls and set the new font. It
was a generic solution for a product that had 400+ dialogs. If you would
like to hear more about this possible solution, let me know.
Sorry
Pete
---
"To you -- is it movement or is it action? Peter J. Chestna
It is contact or just reaction? HighGround Systems
And you -- revolution or just resistance? PChestna@highground.com
Is it living, or just existence?" - RUSH (508) 263-5588 x.125
-----From: Gabriel Parlea-Visalon
Get the DC of your edit contol and use DrawText(). By trial and error you can
slide the Rect up to fit in the bottom pat of your font.
--
Gabriel Parlea-Visalon
Software Engineer
Derivative Trading Systems
gabriel@derivs.demon.co.uk
| Вернуться в корень Архива
|