![]() |
Ribbons and xtpControlCustom |
Post Reply ![]() |
Author | |
gibbo ![]() Groupie ![]() ![]() Joined: 04 January 2007 Location: United Kingdom Status: Offline Points: 47 |
![]() ![]() ![]() ![]() ![]() Posted: 04 January 2007 at 6:19pm |
Hi all,
Just come across the ribbons in the CommandBars, so far looks very easy to use
![]() Have had a quick look through the forum and samples in the trial version, but can't seem to find any examples of the ribbon with xtpControlCustom.
Was wondering if it was possible to write a xtpControlCustom based upon a CDialog class. I have a dialog that I would like to place in the ribbon bar. Strange I know, but needs must..
Any ideas?
Thanks
Gibbo
|
|
Gibbo
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Create Dialog template with Style - Child and Borders - None.
Create CMyDialog class based on template.
Add code:
m_wndDialog.Create(CMyDialog::IDD, this);
CXTPControlCustom* pControlCustom = CXTPControlCustom::CreateControlCustom(&m_wndDialog); pGroupTable->Add(pControlCustom, 0); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
gibbo ![]() Groupie ![]() ![]() Joined: 04 January 2007 Location: United Kingdom Status: Offline Points: 47 |
![]() ![]() ![]() ![]() ![]() |
Thanks,
Got that working
![]() I based the CMyDialog on a CDialog Class, I assume this was correct?
I notice a few problems:
Any Ideas? Thanks
|
|
Gibbo
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
1. Add
BOOL CMyDialog::OnInitDialog() { CDialog::OnInitDialog(); ModifyStyle(0, WS_CLIPCHILDREN|WS_CLIPSIBLINGS); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } 2. Catch WM_CTLCOLOR color.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
gibbo ![]() Groupie ![]() ![]() Joined: 04 January 2007 Location: United Kingdom Status: Offline Points: 47 |
![]() ![]() ![]() ![]() ![]() |
Hi,
When you say Catch WM_CTLCOLOR, sorry what am I suppose to do with it.. Is there some functions that I can call to obtain the skin colours?
Sorry if I'm being dumb..
Thanks
|
|
Gibbo
|
|
![]() |
|
terrym ![]() Senior Member ![]() Joined: 13 April 2007 Status: Offline Points: 836 |
![]() ![]() ![]() ![]() ![]() |
I get the following error when I try this:
Error 1 error C2664: 'BOOL CDialog::Create(LPCTSTR,CWnd *)' : cannot convert parameter 1 from '' to 'LPCTSTR' c:\users\terry\documents\visual studio 2005\projects\alphabet names\cribbonformat.cpp 121
CXTPControlPopup *pControlAddCustom = (CXTPControlPopup *)pRibbonGroup->Add( xtpControlPopup, ID_FORMAT_ADDCUSTOM );
pControlAddCustom->SetBeginGroup( TRUE );
m_AddCustomDlg.Create( CAddCustomDlg::IDD, this );
CXTPControlCustom *pControlCustom = CXTPControlCustom::CreateControlCustom( &m_AddCustomDlg );
pRibbonGroup->Add( pControlCustom, 0 );
Any ideas, cheers
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
CAddCustomDlg::IDD is enum?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
terrym ![]() Senior Member ![]() Joined: 13 April 2007 Status: Offline Points: 836 |
![]() ![]() ![]() ![]() ![]() |
Hi Sorry typed that line wrong as I actually had MAKEINTRESOURCE( CAddCustomDlg::IDD )
But still nothing shows when I click popup
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Just tried in our sample this code:
CXTPControlPopup* pControlPaste = (CXTPControlPopup*)pGroupClipborad->Add(xtpControlSplitButtonPopup, ID_EDIT_PASTE);
m_AddCustomDlg.Create( CAddCustomDlg::IDD, this ); CXTPControlCustom* pControlCustom = CXTPControlCustom::CreateControlCustom( &m_AddCustomDlg ); (CXTPControlCustom*)pControlPaste->GetCommandBar()->GetControls()->Add(pControlCustom); Works fine. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
terrym ![]() Senior Member ![]() Joined: 13 April 2007 Status: Offline Points: 836 |
![]() ![]() ![]() ![]() ![]() |
perfection, this code now works
Cheers for great support
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
![]() |
|
gsl_nb ![]() Newbie ![]() ![]() Joined: 11 January 2010 Location: China Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
but it does not look fine like other ribbon ctrls?
How can i do?
|
|
![]() |
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 |