Print Page | Close Window

MDI-app with ribbon cannot be maximized!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4744
Printed Date: 15 May 2024 at 9:14am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MDI-app with ribbon cannot be maximized!
Posted By: znakeeye
Subject: MDI-app with ribbon cannot be maximized!
Date Posted: 05 August 2006 at 7:41am
When I add a simple ribbon to my MDI-application, the right border is not painted when maximized. The same is true for the bottom border. See attached pictures. Worth mentioning is that I can click in this "unpainted" area - like the desktop. Thus, the window is not trully maximized!
 
http://www.bostream.nu/krisse/ribbon_maximized_gap.zip - http://www.bostream.nu/krisse/ribbon_maximized_gap.zip
 
 
If I remove my call to CreateRibbonBar(), the borders are painted correctly.
What can be wrong?
 
// Before call to CreateRibbonBar():
pCommandBars->SetTheme(xtpThemeRibbon);

BOOL CMainFrame::CreateRibbonBar()
{
    CXTPCommandBars* pCommandBars = GetCommandBars();

    CMenu menu;
    menu.Attach(::GetMenu(m_hWnd));
    SetMenu(NULL);

    CXTPRibbonBar* pRibbonBar = (CXTPRibbonBar*)pCommandBars->Add(_T("The Ribbon"), xtpBarTop, RUNTIME_CLASS(CXTPRibbonBar));
    if (!pRibbonBar)
    {
        return FALSE;
    }
    pRibbonBar->EnableDocking(0);
    //pRibbonBar->GetTabPaintManager()->m_bSelectOnButtonDown = FALSE;

    CXTPControlPopup* pControlFile = (CXTPControlPopup*)pRibbonBar->AddSystemButton(ID_MENU_FILE);
    pControlFile->SetCommandBar(menu.GetSubMenu(0));

    pControlFile->SetIconId(IDB_GEAR);
    UINT uCommand = {IDB_GEAR};
    pCommandBars->GetImageManager()->SetIcons(IDB_GEAR, &uCommand, 1, xtpImageNormal);

    pRibbonBar->GetQuickAccessControls()->Add(xtpControlButton, ID_FILE_SAVE);
    pRibbonBar->GetQuickAccessControls()->Add(xtpControlButton, ID_EDIT_UNDO);
    pRibbonBar->GetQuickAccessControls()->Add(xtpControlButton, ID_FILE_PRINT);
    pRibbonBar->GetQuickAccessControls()->CreateOriginalControls();


    pRibbonBar->SetCloseable(FALSE);

    pRibbonBar->EnableFrameTheme();

    return TRUE;
}




Replies:
Posted By: znakeeye
Date Posted: 06 August 2006 at 6:06am

// pRibbonBar->EnableFrameTheme();

That solves it, but then I get no "nice frame" :(. This frame looks ok in the Ribbon Sample. I'll take a look and see what else needs to be called to get the frame paint itself correctly.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net