From: boca4711 <boc...@us...> - 2004-11-01 14:22:04
|
Update of /cvsroot/anyedit/AnyEditToolkit/GuiLib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31317/GuiLib Modified Files: GuiDockToolBarEx.cpp GuiDockToolBarEx.h Log Message: Moved static InitGlobalFont from header to implementation file Index: GuiDockToolBarEx.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditToolkit/GuiLib/GuiDockToolBarEx.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GuiDockToolBarEx.cpp 15 Oct 2004 14:01:50 -0000 1.3 --- GuiDockToolBarEx.cpp 1 Nov 2004 14:21:47 -0000 1.4 *************** *** 27,30 **** --- 27,64 ---- #include "GuiFrameWnd.h" + static CFont m_fontHorzMenu, m_fontVertMenu; + static int _cyHorzFont, _cyMenuOnBar, _cyTextMargin; + const int CXTEXTMARGIN = 5; + + static BOOL InitGlobalFont() + { + if (m_fontHorzMenu.GetSafeHandle() != NULL && m_fontVertMenu.GetSafeHandle() != NULL) + return TRUE; + m_fontHorzMenu.DeleteObject(); + m_fontVertMenu.DeleteObject(); + + // create fonts + NONCLIENTMETRICS info; info.cbSize = sizeof(info); + ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(info), &info, 0); + if(!m_fontHorzMenu.CreateFontIndirect(&info.lfMenuFont)) + return FALSE; + + // create vertical font + info.lfMenuFont.lfEscapement = -900; + info.lfMenuFont.lfOrientation = -900; + _tcscpy(info.lfMenuFont.lfFaceName,_T("verdana")); + if(!m_fontVertMenu.CreateFontIndirect(&info.lfMenuFont)) + return FALSE; + + _cyHorzFont = abs(info.lfMenuFont.lfHeight); + + // calc Y text margin + _cyMenuOnBar = info.iMenuHeight; + _cyMenuOnBar = max(_cyMenuOnBar, ::GetSystemMetrics(SM_CYSMICON)); + _cyTextMargin = (_cyMenuOnBar - _cyHorzFont) / 2; + + return TRUE; + } + ///////////////////////////////////////////////////////////////////////////// // CDockButton Index: GuiDockToolBarEx.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditToolkit/GuiLib/GuiDockToolBarEx.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GuiDockToolBarEx.h 15 Oct 2004 14:01:50 -0000 1.4 --- GuiDockToolBarEx.h 1 Nov 2004 14:21:47 -0000 1.5 *************** *** 3,41 **** #include "GuiControlBar.h" - static CFont m_fontHorzMenu, m_fontVertMenu; - static int _cyHorzFont, _cyMenuOnBar, _cyTextMargin; - const int CXTEXTMARGIN = 5; - - static BOOL InitGlobalFont() - { - - if (m_fontHorzMenu.GetSafeHandle() != NULL && m_fontVertMenu.GetSafeHandle() != NULL) - return TRUE; - m_fontHorzMenu.DeleteObject(); - m_fontVertMenu.DeleteObject(); - - // create fonts - NONCLIENTMETRICS info; info.cbSize = sizeof(info); - ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(info), &info, 0); - if(!m_fontHorzMenu.CreateFontIndirect(&info.lfMenuFont)) - return FALSE; - - // create vertical font - info.lfMenuFont.lfEscapement = -900; - info.lfMenuFont.lfOrientation = -900; - _tcscpy(info.lfMenuFont.lfFaceName,_T("verdana")); - if(!m_fontVertMenu.CreateFontIndirect(&info.lfMenuFont)) - return FALSE; - - _cyHorzFont = abs(info.lfMenuFont.lfHeight); - - // calc Y text margin - _cyMenuOnBar = info.iMenuHeight; - _cyMenuOnBar = max(_cyMenuOnBar, ::GetSystemMetrics(SM_CYSMICON)); - _cyTextMargin = (_cyMenuOnBar - _cyHorzFont) / 2; - - return TRUE; - } - class CDockButton : public CWnd { --- 3,6 ---- |