Print Page | Close Window

CXTPToolBar in Dialog Box

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=11370
Printed Date: 23 May 2025 at 8:02am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPToolBar in Dialog Box
Posted By: gautambjain
Subject: CXTPToolBar in Dialog Box
Date Posted: 10 July 2008 at 2:19am

Using 12.0.1

I created a MFC project derived from CDialog (not SDI or MDI)

Based on DialogSample, I changed CDialog to CXTPDialogBase<CXTResizeDialog> everywhere.

After which I added the following code. But the toolbar is not showing up. Please help.

This code is copied and pasted from CDialogSample except for some menu names and toolbar names.



    VERIFY(InitCommandBars());
    CXTPCommandBars* pCommandBars = GetCommandBars();

    pCommandBars->SetMenu(_T("Menu Bar"), IDR_MENU_TOOLS);

    CXTPToolBar *pToolBar = pCommandBars->Add(_T("Standard"), xtpBarTop, RUNTIME_CLASS(CXTPToolBar));
    pToolBar->LoadToolBar(IDR_TOOLBAR_STANDARD);
   
    ((CXTPControlButton*)pToolBar->GetControls()->FindControl(xtpControlButton, ID_BUTTON_STAYONTOP, TRUE, FALSE))->SetStyle(xtpButtonIconAndCaption);

    pToolBar->GetControls()->CreateOriginalControls();
    pCommandBars->GetCommandBarsOptions()->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault);
    pCommandBars->GetToolTipContext()->SetStyle(xtpToolTipOffice);




The problem is that the toolbar is not showing up. It is invisible.

Please help.



Replies:
Posted By: Oleg
Date Posted: 10 July 2008 at 5:32am
Hi,
Did you copy code from OnSize ?


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


Posted By: gautambjain
Date Posted: 10 July 2008 at 6:54am

Thanks, that worked.

I added OnSize and RepositionControls and it worked.

You sample projects are nice, but seriously, I think that you must add comments to your sample projects.

Improving your help docs and sample projects will reduce support cost.



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