![]() |
Problem with Ribbon Controls ? |
Post Reply
|
| Author | |
OpelAstra92
Newbie
Joined: 03 April 2007 Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
Topic: Problem with Ribbon Controls ?Posted: 13 April 2007 at 9:15am |
|
Hello,
Can I use Ribbon Controls in Dialog Application, not MDI ?
Regards,
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 April 2007 at 9:31am |
|
Yes,
start from DialogSample and copy code where you create Ribbon.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
OpelAstra92
Newbie
Joined: 03 April 2007 Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
OpelAstra92
Newbie
Joined: 03 April 2007 Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 April 2007 at 4:25am |
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
OpelAstra92
Newbie
Joined: 03 April 2007 Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 April 2007 at 9:40am |
|
Hi,
Thank you very much!
It works fine now!
Regards,
Tihomir Ivanov
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |