Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - how to create ribbon bar in dialog
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to create ribbon bar in dialog

 Post Reply Post Reply
Author
Message
elizabeth.h1 View Drop Down
Newbie
Newbie


Joined: 21 July 2009
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote elizabeth.h1 Quote  Post ReplyReply Direct Link To This Post Topic: how to create ribbon bar in dialog
    Posted: 21 July 2009 at 7:21am
Hello

I  recently downloaded the evulation version of

ToolkitPro for Visual C++. And I am trying to create ribbon bar on dialog. I searched the documentation code samples but could not find nothing similar. I also searched the posts, with no luck.
Here is what I tried so far :


// This is DialogRibbonBar.h

#define CDialogSampleDlgBase CXTPDialogBase<CXTResizeDialog>

class CDialogsoRibbonDlg : public CDialogSampleDlgBase
{
// Construction
public:
    CDialogsoRibbonDlg(CWnd* pParent = NULL); // standard constructor


    enum { IDD = IDD_DIALOGSORIBBON_DIALOG };
   
    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support   


protected:   
  
    virtual BOOL OnInitDialog();
   
    DECLARE_MESSAGE_MAP()
};


/// This is DialogRibbonBar.cpp
#include "stdafx.h"
#include " DialogRibbonBar.h "



CDialogsoRibbonDlg::CDialogsoRibbonDlg(CWnd* pParent /*=NULL*/)
    : CDialogSampleDlgBase(CDialogsoRibbonDlg::IDD, pParent)
{
   
}

void CDialogsoRibbonDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialogSampleDlgBase::DoDataExchange(pDX);
   
}

BEGIN_MESSAGE_MAP(CDialogsoRibbonDlg, CDialogSampleDlgBase)
    //{{AFX_MSG_MAP(CDialogSampleDlg)
   
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CDialogSampleDlg message handlers

BOOL CDialogsoRibbonDlg::OnInitDialog()

   
    CDialogSampleDlgBase::OnInitDialog();
   
    VERIFY(InitCommandBars());  
    CXTPCommandBars* pCommandBars = GetCommandBars();
   CXTPRibbonBar* pRibbonBar = (CXTPRibbonBar*)pCommandBars->Add(_T("The Ribbon"), xtpBarTop, RUNTIME_CLASS(CXTPRibbonBar));
     pRibbonBar->AddTab(L"Hello");
   pRibbonBar->AddTab(L"Hello again");      

    return TRUE;  // return TRUE  unless you set the focus to a control
}


The code that calls the dialog is in the InitInstance of my dialog based application :

    CDialogsoRibbonDlg dlg;
    m_pMainWnd = &dlg;
    INT_PTR nResponse = dlg.DoModal()


Can someone review my code and tell my what I am missing , because the dialog box shows no ribbon bar at all.

Thank you


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: 22 July 2009 at 4:03am
Hello,
 
Start from DialogSample we have and replace standard Toolbar to RibbonBar.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
rebmem View Drop Down
Newbie
Newbie


Joined: 17 August 2012
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote rebmem Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2012 at 5:02am
i think you should see again OnInitDialog in DialogSample application. There is a function that plays a role very importantly. It's "RepositionControls" function. When i delete it, there is no command bar. May be it makes command bars appear.
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.172 seconds.