Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Ribbons and xtpControlCustom
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Ribbons and xtpControlCustom

 Post Reply Post Reply
Author
Message
gibbo View Drop Down
Groupie
Groupie
Avatar

Joined: 04 January 2007
Location: United Kingdom
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibbo Quote  Post ReplyReply Direct Link To This Post Topic: Ribbons and xtpControlCustom
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
gibbo View Drop Down
Groupie
Groupie
Avatar

Joined: 04 January 2007
Location: United Kingdom
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibbo Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
gibbo View Drop Down
Groupie
Groupie
Avatar

Joined: 04 January 2007
Location: United Kingdom
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibbo Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
terrym View Drop Down
Senior Member
Senior Member


Joined: 13 April 2007
Status: Offline
Points: 836
Post Options Post Options   Thanks (0) Thanks(0)   Quote terrym Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 12 June 2007 at 2:40am
Hi,
 
CAddCustomDlg::IDD is enum?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
terrym View Drop Down
Senior Member
Senior Member


Joined: 13 April 2007
Status: Offline
Points: 836
Post Options Post Options   Thanks (0) Thanks(0)   Quote terrym Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
terrym View Drop Down
Senior Member
Senior Member


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

Joined: 11 January 2010
Location: China
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote gsl_nb Quote  Post ReplyReply Direct Link To This Post Posted: 18 January 2010 at 10:52pm
but it does not look fine like other ribbon ctrls?
How can i do?
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.141 seconds.