Print Page | Close Window

Problem with Ribbon Controls ?

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=6860
Printed Date: 12 November 2025 at 3:51pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problem with Ribbon Controls ?
Posted By: OpelAstra92
Subject: Problem with Ribbon Controls ?
Date Posted: 13 April 2007 at 9:15am
Hello,
 
 Can I use Ribbon Controls in Dialog Application, not MDI ?
 
 
Regards,



Replies:
Posted By: Oleg
Date Posted: 13 April 2007 at 9:31am
Yes,
 start from DialogSample and copy code where you create Ribbon.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: OpelAstra92
Date Posted: 14 April 2007 at 8:41am
Hi, thanks for replay.
 
I've created dialog app

class CDlg_RbnDlg : public CXTPDialogBase<CDialog>

...
 
in OnCreate

if (CXTPDialogBase<CDialog>::OnCreate(lpCreateStruct) == -1)

return -1;

....

if (!InitCommandBars())

return -1;

CXTPCommandBars* pCommandBars = GetCommandBars();

pCommandBars->SetPaintManager(new CXTPRibbonTheme());

....

if (!CreateRibbonBar())

{

TRACE0("Failed to create ribbon\n");

return -1;

}

CreateRibbonBar is same as the example of the ribbon project

also, all resource I've copied from the example of the ribbon project in my project.
Everyting was compiled fine but when I run it there are no any ribbons, only dialog app. Have you any idea where's the problem ?
 
Regards,
Tihomir Ivanov


Posted By: OpelAstra92
Date Posted: 15 April 2007 at 4:25am
http://forum.codejock.com/uploads/20070415_042211_DlgRbn.zip -
uploads/20070415_042211_DlgRbn.zip
 
Here is the source code of the dialog app with ribbons,
I've created SDI app, copied the same code for creating the ribbons controls and it works, but in the dialog app there aren't any ribbons
 
Thanks in advance for any help.
 
 
Regards,


Posted By: Oleg
Date Posted: 15 April 2007 at 9:08am
Hi,
 
1. in \res\DlgRbn.rc2  add
#include "Ribbon\Styles\Office2007Blue\Office2007Blue.rc"
and can remove #include <XTToolkitPro.rc> (for static only)
 
2. in DlgRbnDlg.cpp add
 
...
 ON_WM_SIZE()
...
 
void CDlgRbnDlg::OnSize(UINT nType, int cx, int cy)
{
 CDialog::OnSize(nType, cx, cy);
 RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
}


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: OpelAstra92
Date Posted: 15 April 2007 at 9:40am
Hi,
 
Thank you very much!
 
It works fine now!
 
 
Regards,
 
Tihomir Ivanov



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