Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtPaintManagerOffice2007_Blue and CLEARTYPE_QUALITY Collapse All
Subject Author Date
Fabien Masson Jan 9, 2007 - 7:06 AM

Dear Support Team,

First of all, let me wish you an happy new year !

I was looking for forcing CLEARTYPE_QUALITY in our application and saw that all the relevant code was commented out in CExtPaintManagerOffice2007_Impl::CreateDefaultFont().
Is there any reason for ? Is it work in progress ?

I then declare my "Paint Manager" based on your code and all of your "100% from scratch" GUI is working great with ClearType but not basic controls like CExtLabel, etc...

What would be the best way to go :
1. Override all controls that I use for methods like CExtLabel::OnDrawLabelText, CExtButton::OnQueryFont, ... ?
2. Override OnInitDialog or OnInitialUpdate for all controls like static, button, etc with a generic method based on fonts from PaintMnager?
3. Set the correct font for each control in OnInitDialog or OnInitialUpdate ?

Best regards,
Fabien.

Fabien Masson Jan 18, 2007 - 5:35 AM

Dear Team Support,
Dear Sergiy,

Any hints to my 3 questions ?

Regards,
Fabien.

Fabien Masson Jan 15, 2007 - 7:59 AM

Dear Sergiy,

I derivated the CExtPaintManager and add a property flag to control the ClearType effect (based also on m_bIsWinXPorLater).

I add to implement the following methods :
- virtual HFONT CreateDefaultFont();
- virtual HFONT CreateCaptionFont();
- the 2 static functions needed by CreateXXXFont methods.

At the end of each OnInitialUpdate (CFormView) or OnInitDialog (CDialog), I call an internal method of my paint manager which check what kind of font is set to all my controls (normal or bold) and replace it with the correct font of my paint manager.
So, all the code is placed in my paint manager and it’s not so complicated to handle it.
Would you have a better method than doing this way ? (Question 1)

Everything is working great (or at least 99% of it) ; in fact, sometime, It doesn’t use my font in CExtDateTimeWnd (when the control is created dynamically). Any hint ? (Question 2)

When I play with the lfHeight attribute of LOGFONT (+ some ressources tweaking at run-time in Create...), everything is painted correctly except the CExtStatusControlBar which is not "height" enough. Any tip for it ? (Question 3)

Best regards,
Fabien.

Technical Support Jan 18, 2007 - 1:34 PM

1. This is an acceptable way.

2. We discovered that the custom controls, derived from CWnd, do not respond to the WM_SETFONT message automatically. The WM_SETFONT and WM_GETFONT messages simply do not work. So we had to handle these massages manually and store the font handler inside all our custom controls, such as the CExtDateTimeWnd. The latest library version 2.63.3, available from the Download page, is already free from this bug.

3. You can change the height of the status bar using the CStatusBarCtrl::SetMinHeight() method:

CStatusBar & wndStatusBar = . . .
    wndStatusBar.GetStatusBarCtrl.SetMinHeight( 50 ); // sets the height of 50 pixels

Fabien Masson Jan 10, 2007 - 3:30 PM

Dear Support Team,

Do you think I should go the 1st way ? override all controls painting methods ?

By the way, it seems that when you use an higher lfHeight, the bottom status bar is not updated correctly. What do I miss ?

Regards,
Fabien.

Sergiy Lavrynenko Jan 11, 2007 - 2:04 AM

Dear Fabien,

Currently the clear type font effect is applied if it is turned on in the Windows settings. The Office 2007 (release version) applications allow to turn on the clear type font effect independently from Windows settings. Yes, it is possible to re-assign fonts to any windows, but it is not an effective way. I see two solutions:


  • Implement some property flags in the CExtPaintManager class which will control whether the clear type font effect should be used in CFont objects stored in the paint manager. This should not be difficult to do for the nearest release or, even, provide you with the source code update as soon as possible.

  • You can create and use your own paint manager class which will initialize fonts with the clear type effect turned on.