OriginPro 9.1 SR1 64-bit/32-bit, Win7 Pro 64-bit, running in VMware Fusion 5.0.4
I have created my own subclass of the GridControl class. The dialog that uses my grid uses the default font settings from when I created it in VC++:
Font(Size): MS Shell Dlg(8)
Use System Font: True
However, I noticed that when I add cells to my grid, the font size in the cells is larger than the rest of the dialog- it looks ugly. I was able to track the font size increase to a few lines in GridControl.h. (Lines 2227-2236):
/// Bill 09/20/2011 ORG-3799-P1 FONT_IN_GRIDS_UNDER_WIN7_LOOKS_BLURRING
// I found that most dialog's font size in odlg8.dll is 8 and they look
// blurring in win7. So I change the grid's font size to 9.
//m_flx.FontSize = FontSize();
int nFontSize = FontSize();
if (is_Windows_7(TRUE) && nFontSize == 8)
m_flx.FontSize = 9;
else
m_flx.FontSize = nFontSize;
/// End FONT_IN_GRIDS_UNDER_WIN7_LOOKS_BLURRING
So, I wanted to get the font size back to that of the dialog and found a way that "works". If you look at the example code below, you will see it commented.
Can someone let me know if this would be the best way to go or is there another more robust way.
class MyGridControl : public GridControl
{
public:
void Init(UINT uID, WndContainer &Dlg)
{
GridControl::Init(uID, Dlg);
// Put the grid font size back to dialog size
m_flx.FontSize = FontSize();
}
};