The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 GridControl and font Size Help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cdrozdowski111

USA
247 Posts

Posted - 02/15/2014 :  1:59:57 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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();
	}
};

  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000