Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtResizableDialog Caption Font Collapse All
Subject Author Date
Paul Giblock Jul 8, 2004 - 1:51 AM

I recently changed my windows DPI setting from 96 to 120.  I have been busy getting my fonts and bitmaps scaling relative to LOGPIXELSX and LOGPIXELSY. Anyways, I can’t figure out how to enlarge the caption font on CExtResizableDialog. Any help would be appreciated


 

Technical Support Nov 24, 2009 - 2:16 PM

The CExtPaintManager::m_FontBoldBC font defines the bar caption font.

Technical Support Nov 19, 2009 - 1:51 PM

It’s possible to change caption font only if the currently installed Prof-UIS paint manager supports skinned window non-client areas. You should change the CExtPaintManager::m_FontCaption property.


Takis Takoglou Nov 20, 2009 - 1:12 AM

Hi,


how do i know if the paint manager supports these features? I am using Prof-UIS v2.87.

Btw i tried to modify your sample "FunnyBars". I added the following lines but still the captions of the toolbars/controlbars didn’t change:


(Bold lines added)



void CChildView::_ConrolsData_2_UiSettings()
{
    ASSERT( !m_bInitializingControls );
    if( g_PaintManager->m_FontNormal.GetSafeHandle() != NULL )
        g_PaintManager->m_FontNormal.DeleteObject();
    if( g_PaintManager->m_FontCaption.GetSafeHandle() != NULL )
        g_PaintManager->m_FontCaption.DeleteObject();

CString s;

    m_ComboFontFaceName.GetWindowText( s );
    if( !s.IsEmpty() )
        __EXT_MFC_STRCPY( m_lf.lfFaceName, LF_FACESIZE, s );

    m_EditFontWidth.GetWindowText( s );
    if( !s.IsEmpty() )
        m_lf.lfWidth = _ttol( s );
    m_EditFontHeight.GetWindowText( s );
    if( !s.IsEmpty() )
        m_lf.lfHeight = _ttol( s );

    m_lf.lfWeight = m_BtnFontBold.GetCheck() ? 900 : 400;
    m_lf.lfItalic = (BYTE)(m_BtnFontItalic.GetCheck() ? TRUE : FALSE);
    m_lf.lfUnderline = (BYTE)(m_BtnFontUnderline.GetCheck() ? TRUE : FALSE);
    m_lf.lfStrikeOut = (BYTE)(m_BtnFontStrikeout.GetCheck() ? TRUE : FALSE);

    g_PaintManager->m_FontNormal.CreateFontIndirect( &m_lf );
    g_PaintManager->m_FontCaption.CreateFontIndirect( &m_lf );
    ASSERT( g_PaintManager->m_FontNormal.GetSafeHandle() != NULL );
    ASSERT( g_PaintManager->m_FontCaption.GetSafeHandle() != NULL );

CMainFrame * pMainFrame =
        STATIC_DOWNCAST( CMainFrame, GetParentFrame() );
    pMainFrame->RecalcLayout();
    RedrawWindow(
        NULL,
        NULL,
        RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN
        );
    CExtControlBar::stat_RedrawFloatingFrames( pMainFrame );
    CExtControlBar::stat_RecalcBarMetrics( pMainFrame );
    
    m_wndSliderHTBB.UpdateSliderWnd();
}


 


 

Technical Support Nov 20, 2009 - 2:40 PM

Here is the fixed version:
void CChildView::_ConrolsData_2_UiSettings()
{
ASSERT( !m_bInitializingControls );
if( g_PaintManager->m_FontNormal.GetSafeHandle() != NULL )
g_PaintManager->m_FontNormal.DeleteObject();

CString s;

m_ComboFontFaceName.GetWindowText( s );
if( !s.IsEmpty() )
__EXT_MFC_STRCPY( m_lf.lfFaceName, LF_FACESIZE, s );

m_EditFontWidth.GetWindowText( s );
if( !s.IsEmpty() )
m_lf.lfWidth = _ttol( s );
m_EditFontHeight.GetWindowText( s );
if( !s.IsEmpty() )
m_lf.lfHeight = _ttol( s );

m_lf.lfWeight = m_BtnFontBold.GetCheck() ? 900 : 400;
m_lf.lfItalic = (BYTE)(m_BtnFontItalic.GetCheck() ? TRUE : FALSE);
m_lf.lfUnderline = (BYTE)(m_BtnFontUnderline.GetCheck() ? TRUE : FALSE);
m_lf.lfStrikeOut = (BYTE)(m_BtnFontStrikeout.GetCheck() ? TRUE : FALSE);

g_PaintManager->m_FontNormal.CreateFontIndirect( &m_lf );
ASSERT( g_PaintManager->m_FontNormal.GetSafeHandle() != NULL );

CMainFrame * pMainFrame = STATIC_DOWNCAST( CMainFrame, GetParentFrame() );

bool bReCreateCaptionFont = pMainFrame->NcFrameImpl_IsSupported();
if( bReCreateCaptionFont )
{
if( g_PaintManager->m_FontCaption.GetSafeHandle() != NULL )
g_PaintManager->m_FontCaption.DeleteObject();
g_PaintManager->m_FontCaption.CreateFontIndirect( &m_lf );
ASSERT( g_PaintManager->m_FontCaption.GetSafeHandle() != NULL );
}

pMainFrame->RecalcLayout();
RedrawWindow(
NULL,
NULL,
RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN
);
CExtControlBar::stat_RedrawFloatingFrames( pMainFrame );
CExtControlBar::stat_RecalcBarMetrics( pMainFrame );

if( bReCreateCaptionFont )
pMainFrame->SendMessage( WM_NCPAINT );

m_wndSliderHTBB.UpdateSliderWnd();
}


stakon K. Nov 24, 2009 - 1:10 AM

The above code changes the caption of the main window. It does not change the captions of the floating toolbars/menubar...

Takis Takoglou Nov 19, 2009 - 3:49 AM

Good day,


I realize this is an outdated post, but i came across the same problem.

Is it still impossible to change the font of the title (caption) of a control bar programatically?


Thanx in advance.

Technical Support Jul 9, 2004 - 9:38 AM

It seems the issue relates to Windows settings. No matter what kind of dialog you use (CExtResizableDialog or CDialog): The size of the caption font is configured in the Windows appearance settings.

Please note, neither Prof-UIS classes nor those in MFC affect non-client areas of dialog windows.