Re: Choosing font for dialog box, some advice please...
From: sigi (sigi_23_at_yahoo.de)
Date: 07/15/04
- Next message: Christopher J. Holland: "Re: ListView SetItemPosition problem, bug?"
- Previous message: Steve Alpert: "Re: Help with ComboBox"
- In reply to: Phlip: "Re: Choosing font for dialog box, some advice please..."
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 15 Jul 2004 16:02:19 +0200
this code includes some nice ideas (and uses functions i can use also
without mfc)
if it would continue querying LANG_JAPAN, LANG_KOREA, ... i would be
satisfied at all:)
thanks,
sigi
"Phlip" <phlip_cpp@yahoo.com> wrote in message
news:%23QpH40iaEHA.2792@TK2MSFTNGP09.phx.gbl...
>> *) is there a smarter way?
>
> I don't know.
>
> But here's trivial WTL code to set a font pro-actively:
>
> LRESULT
> ProjectDlg::OnInitDialog(UINT, WPARAM, LPARAM, BOOL &)
> {
> CListBox aList = GetDlgItem(IDC_LIST_CUSTOMERS);
> .
>
> if (LANG_SANSKRIT == PRIMARYLANGID(::GetThreadLocale()))
> {
> if (!m_fontSanskrit.m_hFont)
> m_fontSanskrit.
> CreatePointFont(180, TEXT("Sanskrit 2003"));
>
> CClientDC aDC(this->m_hWnd);
>
> CFontHandle oldFont = aDC.SelectFont(m_fontSanskrit);
> TEXTMETRIC metrics;
> aDC.GetTextMetrics(&metrics);
> aDC.SelectFont(oldFont);
> aList.SetItemHeight(0, metrics.tmHeight);
>
> CWindow first = GetWindow(GW_CHILD);
> CWindow next = first;
>
> do {
> next.SetFont(m_fontSanskrit);
> next = next.GetWindow(GW_HWNDNEXT);
> } while (next.m_hWnd);
> }
> return 0;
> }
>
> I'm unsure if that could help, but I had it laying around so pasting it
> into
> my editor can't hurt!
>
> --
> Phlip
> http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces
>
>
- Next message: Christopher J. Holland: "Re: ListView SetItemPosition problem, bug?"
- Previous message: Steve Alpert: "Re: Help with ComboBox"
- In reply to: Phlip: "Re: Choosing font for dialog box, some advice please..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|