Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Skin and menu font problem, need help!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Skin and menu font problem, need help!

 Post Reply Post Reply
Author
Message
hamvui2005 View Drop Down
Newbie
Newbie


Joined: 10 December 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote hamvui2005 Quote  Post ReplyReply Direct Link To This Post Topic: Skin and menu font problem, need help!
    Posted: 10 December 2008 at 8:41pm
I changed menu font in a skin file. When I use the skin in CMainFrame::CMainFrame, the menu font is displayed correctly.
 
CMainFrame::CMainFrame()
{
 // TODO: add member initialization code here
 TCHAR szStylesPath[_MAX_PATH];
 VERIFY(::GetModuleFileName(
  AfxGetApp()->m_hInstance, szStylesPath, _MAX_PATH));  
 
 CString csStylesPath(szStylesPath);
 int nIndex  = csStylesPath.ReverseFind(_T('\\'));
 if (nIndex > 0) {
  csStylesPath = csStylesPath.Left(nIndex);
 }
 else {
  csStylesPath.Empty();
 }
 
 m_strStylesPath = csStylesPath + _T("\\Styles\\");
 
 XTPSkinManager()->SetApplyOptions(xtpSkinApplyFrame | xtpSkinApplyColors | xtpSkinApplyMetrics);
 LoadSkin(1);
 
}
 
But when I change to other skin and changed back to this skin, menu font is not update (it is not display correctly)
I use LoadSkin and OnSkinChanged as SkinSDISample.
Please help me. Thanks very much.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 December 2008 at 1:08am
Hi,

Try add
pCommandBars->GetPaintManager()->RefreshMetrics();
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
hamvui2005 View Drop Down
Newbie
Newbie


Joined: 10 December 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote hamvui2005 Quote  Post ReplyReply Direct Link To This Post Posted: 11 December 2008 at 10:01pm

Thanks, but after changing the skin I called

void CMainFrame::OnSkinChanged()
{
 XTPPaintManager()->RefreshMetrics();

 OnSysColorChange();
 RedrawWindow(0, 0, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ALLCHILDREN);  
 
 GetCommandBars()->GetPaintManager()->RefreshMetrics();

 GetCommandBars()->RedrawCommandBars(); 

}
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.171 seconds.