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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 GridControl and font Size Help

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
cdrozdowski111 Posted - 02/15/2014 : 1:59:57 PM
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();
	}
};


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000