Print Page | Close Window

Ribbons and xtpControlCustom

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=5991
Printed Date: 15 July 2025 at 10:45am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Ribbons and xtpControlCustom
Posted By: gibbo
Subject: Ribbons and xtpControlCustom
Date 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



Replies:
Posted By: Oleg
Date Posted: 05 January 2007 at 2:06am
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


Posted By: gibbo
Date Posted: 05 January 2007 at 3:17am
Thanks,
Got that working
 
I based the CMyDialog on a CDialog Class, I assume this was correct?
I notice a few problems:
  1. When I resize the main app, which resizes the ribbon bar, the dialog is flickering
  2. The Dialog doesn't seem to be applying the styles/themes colours.

Any Ideas?

 
Thanks
 


-------------
Gibbo


Posted By: Oleg
Date Posted: 05 January 2007 at 8:59am
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


Posted By: gibbo
Date Posted: 05 January 2007 at 10:10am
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


Posted By: terrym
Date Posted: 11 June 2007 at 7:31am
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


Posted By: Oleg
Date Posted: 12 June 2007 at 2:40am
Hi,
 
CAddCustomDlg::IDD is enum?


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


Posted By: terrym
Date Posted: 12 June 2007 at 3:59am

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


Posted By: Oleg
Date Posted: 12 June 2007 at 7:27am
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


Posted By: terrym
Date Posted: 12 June 2007 at 7:58am
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


Posted By: gsl_nb
Date Posted: 18 January 2010 at 10:52pm
but it does not look fine like other ribbon ctrls?
How can i do?



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