Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Problem with Ribbon Controls ?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with Ribbon Controls ?

 Post Reply Post Reply
Author
Message
OpelAstra92 View Drop Down
Newbie
Newbie


Joined: 03 April 2007
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote OpelAstra92 Quote  Post ReplyReply Direct Link To This Post Topic: Problem with Ribbon Controls ?
    Posted: 13 April 2007 at 9:15am
Hello,
 
 Can I use Ribbon Controls in Dialog Application, not MDI ?
 
 
Regards,
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 13 April 2007 at 9:31am
Yes,
 start from DialogSample and copy code where you create Ribbon.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
OpelAstra92 View Drop Down
Newbie
Newbie


Joined: 03 April 2007
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote OpelAstra92 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
OpelAstra92 View Drop Down
Newbie
Newbie


Joined: 03 April 2007
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote OpelAstra92 Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2007 at 4:25am
 
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,
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
OpelAstra92 View Drop Down
Newbie
Newbie


Joined: 03 April 2007
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote OpelAstra92 Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2007 at 9:40am
Hi,
 
Thank you very much!
 
It works fine now!
 
 
Regards,
 
Tihomir Ivanov
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.027 seconds.